Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Paweljong
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Teckids
Projekt Hack-n-Fun
AlekSIS-App-Paweljong
Commits
248cb930
Verified
Commit
248cb930
authored
2 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Patches
Plain Diff
Implement retrieval of latitude and longitude for checkpoint
parent
18e38fa8
No related branches found
No related tags found
1 merge request
!30
Resolve "Checkpoint system"
Pipeline
#76030
failed
2 years ago
Stage: prepare
Stage: test
Stage: build
Stage: publish
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aleksis/apps/paweljong/forms.py
+5
-2
5 additions, 2 deletions
aleksis/apps/paweljong/forms.py
aleksis/apps/paweljong/static/js/paweljong/checkpoint.js
+12
-0
12 additions, 0 deletions
aleksis/apps/paweljong/static/js/paweljong/checkpoint.js
with
17 additions
and
2 deletions
aleksis/apps/paweljong/forms.py
+
5
−
2
View file @
248cb930
...
...
@@ -504,6 +504,9 @@ class PersonGroupFormPerson(forms.Form):
class
EventCheckpointForm
(
forms
.
Form
):
class
Media
:
js
=
(
"
js/paweljong/checkpoint.js
"
,)
layout
=
Layout
(
"
username
"
)
comment
=
forms
.
CharField
(
...
...
@@ -525,7 +528,7 @@ class EventCheckpointForm(forms.Form):
max_value
=
90.0
,
max_digits
=
8
,
decimal_palces
=
6
,
widget
=
forms
.
HiddenInput
()
#
widget=forms.HiddenInput()
)
lon
=
forms
.
DecimalField
(
required
=
False
,
...
...
@@ -533,5 +536,5 @@ class EventCheckpointForm(forms.Form):
max_value
=
180.0
,
max_digits
=
9
,
decimal_palces
=
6
,
widget
=
forms
.
HiddenInput
()
#
widget=forms.HiddenInput()
)
This diff is collapsed.
Click to expand it.
aleksis/apps/paweljong/static/js/paweljong/checkpoint.js
0 → 100644
+
12
−
0
View file @
248cb930
function
setCheckpointCoords
(
position
)
{
$
(
"
[name='lat']
"
).
value
=
position
.
coords
.
latitude
;
$
(
"
[name='lon']
"
).
value
=
position
.
coords
.
longitude
;
}
$
(
document
).
ready
(
function
(
$
)
{
if
(
navigator
.
geolocation
)
{
window
.
setInterval
(
function
()
{
navigator
.
geolocation
.
getCurrentPosition
(
setCheckpointCoords
);
})
}
});
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment