From 196020243c6b47e35692f2865c632de941226674 Mon Sep 17 00:00:00 2001 From: christian Date: Sun, 27 Oct 2019 05:23:59 +0100 Subject: [PATCH] changes over changes --- bloomhunt/urls.py | 2 +- map/templates/map/index.html | 2 +- map/urls.py | 1 + map/views.py | 1 + mobile/static/mobile/base.css | 109 +++++++++++++++++++++++++++ mobile/static/mobile/map_icon.png | Bin 0 -> 3635 bytes mobile/templates/mobile/base.html | 28 ++++++- mobile/templates/mobile/index.html | 5 ++ mobile/templates/mobile/scan.html | 7 +- mobile/templates/mobile/scanned.html | 4 +- mobile/urls.py | 2 + mobile/views.py | 8 ++ 12 files changed, 163 insertions(+), 6 deletions(-) create mode 100644 mobile/static/mobile/base.css create mode 100644 mobile/static/mobile/map_icon.png diff --git a/bloomhunt/urls.py b/bloomhunt/urls.py index 64afebc..7f82ced 100644 --- a/bloomhunt/urls.py +++ b/bloomhunt/urls.py @@ -21,6 +21,6 @@ from django.views.generic import RedirectView urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^mobile/', include('mobile.urls')), - url(r'^map/', include('map.urls'), name='map'), + url(r'^map/', include('map.urls')), url(r'', RedirectView.as_view(url='/map/', permanent=False)) ] diff --git a/map/templates/map/index.html b/map/templates/map/index.html index 4f1142b..b5d4c70 100644 --- a/map/templates/map/index.html +++ b/map/templates/map/index.html @@ -144,7 +144,7 @@ var trees_2 = []; for (var i = 0; i < treesFromJSON.length; i++) { let raw = treesFromJSON[i]; - let tree = new Tree(raw["name"], raw["bloom_start"] + 20, + let tree = new Tree(raw["name"], raw["bloom_start"] - 20, raw["latitude"], raw["longitude"]); trees_2.push(tree); } diff --git a/map/urls.py b/map/urls.py index 2fcca0d..25ef061 100644 --- a/map/urls.py +++ b/map/urls.py @@ -2,6 +2,7 @@ from django.urls import path from . import views +app_name = "map" urlpatterns = [ path('', views.index, name='index') ] diff --git a/map/views.py b/map/views.py index 0b7b740..ceecead 100644 --- a/map/views.py +++ b/map/views.py @@ -12,4 +12,5 @@ def index(request): loaded = json.load(f) s = json.dumps(loaded); data = {"trees": s} + return render(request, "map/index.html", context=data); diff --git a/mobile/static/mobile/base.css b/mobile/static/mobile/base.css new file mode 100644 index 0000000..ffd91fb --- /dev/null +++ b/mobile/static/mobile/base.css @@ -0,0 +1,109 @@ +body,html{ + font-size: 16px; + font-family: "Georgia", serif; + line-height: 29px; + color:#0c1a30; + padding:0; + height: 100%; + margin: 0 0 1px; +} + +#main{ + background:#fff scroll repeat-x 0px -100px; + margin: 0; + padding: 0; + width:100%; + min-height: 100%; + /*background: #FFFFFF;*/ +} + +#content { + width: 70%; + margin: 0 auto; + overflow:hidden; + position: relative; +} + +#footer { + position: relative; + top: 0; + left: 0; + width: 100%; + clear: both; + border-top: 1px solid #C2D1E1; + color: #a0acba; + padding: 4px 0px; + height: 41px; + font-family: "PT Sans", sans-serif; + font-size: 0.75em; + /* text-align: right; */ + background: #f5f9ff; + /* vertical-align: middle; */ + line-height: 31px; + overflow: hidden; +} + +#footer p { + padding: 0 20px; + margin: 0; + float: right; +} + +#footer p.left { + padding: 0 20px; + margin: 0; + float: left; +} + +#heading { + width: 100%; + background: #132742 url(nav-back.png) scroll repeat-x bottom left; + color: #FFFFFF; + padding: 25px 0 0 0; + margin:0; + height: 94px; + overflow:hidden; + margin-bottom: 30px; +} + +#heading .inner{ + width: 70%; + margin:0 auto; + overflow:hidden; + line-height: 1em; + vertical-align: top; + height: 100px; + padding: 0; + position: relative; + /*height: 4em;*/ +} + +#heading h1 { + margin:0; + padding: 0; + margin: 0 auto; + position: absolute; + top: 10px; + left: 94px; + vertical-align: top; +} + + +#heading img { + width: 64px; + margin:0; + padding: 0; + margin: 0 auto; + position: absolute; + top: 0px; + left: 0px; + vertical-align: top; +} + +#map_icon { + width: 64px; + margin:0; + position: absolute; + right: 50px; + top: 24px; +} diff --git a/mobile/static/mobile/map_icon.png b/mobile/static/mobile/map_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..d3268369c80738f4b945776b13563a3f76cd106d GIT binary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&1U>MbEG1yiv!A0YF}=h2*~yXA-b6#l+ttJ1pVf7UDMEPwTm zyxf3J-`^c%%;FWM;tT*8G1DwY3r+4Iib|xOIWqEp>zBx=CoL*|N z2v#ST5b$*T2BREG+SwvH-fMnz{x^0|pMIuZdT3Iey(;}p4TU4e&T63dM$9KoJQE)? zC^PVcM~%0fL^uimTq0H@(iOm}FFOz-Plpp+xZ_`^fj3WM5jt**9@vo8;fU9Gh8-V- zG3FI2?tl{c(c5ssgeTF&L%kx%;wS;UqO>(vG!ek_dA@4F3>t8ZP`m^#jNYRkp6Q4l z1X?aiID3d0@lKN|fOlS`)r#XHBbdC1pHZBZs^eX%4ZzqXKiEx^d0iI7PGt$w8kmUR zD&1scB1>EPR4`wT@wcmX7}lH9zq%`?3*eC%mWi-c+J8@KC^Yyv2YpxJb2w%r(S#!= vd>sXx^&ownd<{fV1)5`v-faKekrSi7zqx%MbM{bluNT-Fw@;m7|M-+nfk literal 0 HcmV?d00001 diff --git a/mobile/templates/mobile/base.html b/mobile/templates/mobile/base.html index bb70a85..f5481fe 100644 --- a/mobile/templates/mobile/base.html +++ b/mobile/templates/mobile/base.html @@ -1,18 +1,44 @@ +{% load static %} + + Bloom Hunting + + + -
+
+ + +
{% block content %} {% endblock %}
+
+ + diff --git a/mobile/templates/mobile/index.html b/mobile/templates/mobile/index.html index 088c96d..8739e6f 100644 --- a/mobile/templates/mobile/index.html +++ b/mobile/templates/mobile/index.html @@ -7,4 +7,9 @@

Hunt blooming trees in your area.

Scan a blooming tree + +

Hey, some predictions

+ +

{{ prediction }}

+ {% endblock %} diff --git a/mobile/templates/mobile/scan.html b/mobile/templates/mobile/scan.html index ab9f9f2..8c05043 100644 --- a/mobile/templates/mobile/scan.html +++ b/mobile/templates/mobile/scan.html @@ -7,13 +7,18 @@

{{ question.text }}

+ + {% for option in question.options %} - + {% endfor %} + +
{% csrf_token %}
+
{% endblock %} diff --git a/mobile/templates/mobile/scanned.html b/mobile/templates/mobile/scanned.html index a021c9c..c4a11a0 100644 --- a/mobile/templates/mobile/scanned.html +++ b/mobile/templates/mobile/scanned.html @@ -11,8 +11,8 @@ tree is blooming.

{% csrf_token %} - - + + diff --git a/mobile/urls.py b/mobile/urls.py index f43f719..1d1110a 100644 --- a/mobile/urls.py +++ b/mobile/urls.py @@ -2,6 +2,8 @@ from django.urls import path from . import views +app_name = "mobile" + urlpatterns = [ path('addtree/', views.addtree, name='addtree'), path('scan/', views.scan , name='scan'), diff --git a/mobile/views.py b/mobile/views.py index f88ca85..3739ce5 100644 --- a/mobile/views.py +++ b/mobile/views.py @@ -5,8 +5,16 @@ from datetime import datetime import json import os +import pandas as pd +import matplotlib.pyplot as plt +import numpy as np +import seaborn as sns +import re as re + def index(request): + + return render(request, 'mobile/index.html')