Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
MOREAU Elise
project-covid
Commits
da72c989
Commit
da72c989
authored
Nov 01, 2020
by
Moreau Elise
Browse files
add hidden field to get location information
parent
92c3f3f7
Changes
2
Hide whitespace changes
Inline
Side-by-side
templates/user/create_user.twig
View file @
da72c989
...
...
@@ -46,6 +46,8 @@
</input>
</div>
</div>
<input
type=
"hidden"
name=
"longitude"
id=
"longitude-input"
>
<input
type=
"hidden"
name=
"latitude"
id=
"latitude-input"
>
<div
class=
"field col o6"
>
<input
type=
"submit"
class=
"ui submit button"
>
</div>
...
...
@@ -56,7 +58,8 @@
if
(
!
navigator
.
geolocation
)
{
return
;
}
navigator
.
geolocation
.
getCurrentPosition
(
function
(
position
)
{
console
.
log
(
position
.
coords
.
latitude
,
position
.
coords
.
longitude
);
$
(
'
#latitude-input
'
).
val
(
position
.
coords
.
latitude
);
$
(
'
#longitude-input
'
).
val
(
position
.
coords
.
longitude
);
});
});
</script>
...
...
templates/user/user_profile.twig
View file @
da72c989
...
...
@@ -16,6 +16,11 @@
<button
type=
"submit"
class=
"ui button"
><i
class=
"edit icon"
></i></button>
</form>
<button
class=
"ui button"
id=
"delete_user_button"
><i
class=
"trash icon"
></i></button>
<form
action=
"/account/location"
method=
"post"
>
<input
type=
"hidden"
name=
"longitude"
id=
"longitude-input"
>
<input
type=
"hidden"
name=
"latitude"
id=
"latitude-input"
>
<button
type=
"submit"
class=
"ui disabled button"
id=
"location-button"
><i
class=
"street view icon"
></i></button>
</form>
{%
endif
%}
</div>
</div>
...
...
@@ -26,7 +31,7 @@
<div
class=
"col s12 m12 l12 xl12 "
>
<h2>
Groups
</h2>
<div
class=
"ui relaxed divided list"
style=
"overflow:scroll"
>
<div
class=
"ui relaxed divided list"
style=
"overflow:scroll
; min-height: 300px;
"
>
{%
for
group
in
user.getGroups
%}
{%
if
not
group.isPrivate
%}
<div
class=
"item"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment