Tum 4 gadi atpakaļ
vecāks
revīzija
b07d82123d

BIN
app/front/__pycache__/urls.cpython-39.pyc


BIN
app/front/__pycache__/views.cpython-39.pyc


+ 33 - 0
app/front/templates/front/tracking.html

@@ -0,0 +1,33 @@
1
+
2
+{% extends "base.html" %}
3
+
4
+{% block content %}
5
+<div class="alert alert-success" role="alert">
6
+<h1>Tracking</h1>
7
+        <input type='text' class='form-control' name='geo' id='geoText' readonly/><br>
8
+        <br>Last Update
9
+        <span id='lastUpdate'></span>
10
+</div>
11
+{% endblock %}
12
+{% block foot_script %}
13
+<script>
14
+    $(function() {
15
+
16
+        setInterval(function(){
17
+            console.log("Hello");
18
+            if ("geolocation" in navigator){ //check geolocation available
19
+                //try to get user current location using getCurrentPosition() method
20
+                console.log("current location");
21
+                navigator.geolocation.getCurrentPosition(function(position){
22
+                    console.log("xxxx");
23
+                    $("#geoText").val(position.coords.latitude+","+position.coords.longitude );
24
+                    $("#lastUpdate").html(new Date());
25
+
26
+                });
27
+            }else{
28
+                console.log("Browser doesn't support geolocation!");
29
+            }
30
+        }, 5000);
31
+    });
32
+</script>
33
+{% endblock %}

+ 1 - 0
app/front/urls.py

@@ -5,5 +5,6 @@ from . import views
5 5
 
6 6
 urlpatterns = [
7 7
     path('', views.index, name='index'),
8
+    path('tracking', views.tracking, name='tracking'),
8 9
     path('success', views.success, name='success'),
9 10
 ]

+ 3 - 0
app/front/views.py

@@ -26,6 +26,9 @@ def index(request):
26 26
 def success(request):
27 27
     return render(request, 'front/success.html')
28 28
 
29
+def tracking(request):
30
+    return render(request, 'front/tracking.html')
31
+
29 32
 def my404(request,exception):
30 33
     return render(request, 'front/404.html')
31 34
     #return redirect("index")

BIN
app/shaqfindbed/__pycache__/settings.cpython-39.pyc


+ 1 - 1
app/shaqfindbed/settings.py

@@ -25,7 +25,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent
25 25
 SECRET_KEY = 'django-insecure-!=!d6rsewcddw=hr-j46#))^nd-32(kkjmnpxxioi(v&c9!*xn'
26 26
 
27 27
 # SECURITY WARNING: don't run with debug turned on in production!
28
-DEBUG = False
28
+DEBUG = True
29 29
 
30 30
 ALLOWED_HOSTS = [
31 31
     "167.71.218.44",

+ 4 - 2
app/templates/base.html

@@ -32,13 +32,15 @@ s.parentNode.insertBefore(hm, s);
32 32
     <div class='container'>
33 33
     <img src="{% static "/img/heartbeat.png" %}" class='text-center' style='width:100px; margin:20px auto; display:block'/>
34 34
     <h1 class='text-center'>FindBed.xyz</h1>
35
+    <!--
35 36
     <div class="alert alert-info text-center" role="alert">
36 37
         FindBed.xyz ทำเพื่อช่วยเหลือในการหาเตียงสำหรับผู้ป่วย COVID19
37
-    </div>
38
+    </div> -->
38 39
         {% block content %}
39 40
         {% endblock %}
40 41
     </div>
41
-
42
+    {% block foot_script %}
43
+    {% endblock %}
42 44
 
43 45
 </body>
44 46
 </html>