Procházet zdrojové kódy

changes over changes

master
christian před 6 roky
rodič
revize
196020243c
12 změnil soubory, kde provedl 163 přidání a 6 odebrání
  1. +1
    -1
      bloomhunt/urls.py
  2. +1
    -1
      map/templates/map/index.html
  3. +1
    -0
      map/urls.py
  4. +1
    -0
      map/views.py
  5. +109
    -0
      mobile/static/mobile/base.css
  6. binární
      mobile/static/mobile/map_icon.png
  7. +27
    -1
      mobile/templates/mobile/base.html
  8. +5
    -0
      mobile/templates/mobile/index.html
  9. +6
    -1
      mobile/templates/mobile/scan.html
  10. +2
    -2
      mobile/templates/mobile/scanned.html
  11. +2
    -0
      mobile/urls.py
  12. +8
    -0
      mobile/views.py

+ 1
- 1
bloomhunt/urls.py Zobrazit soubor

@@ -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))
]

+ 1
- 1
map/templates/map/index.html Zobrazit soubor

@@ -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);
}


+ 1
- 0
map/urls.py Zobrazit soubor

@@ -2,6 +2,7 @@ from django.urls import path

from . import views

app_name = "map"
urlpatterns = [
path('', views.index, name='index')
]

+ 1
- 0
map/views.py Zobrazit soubor

@@ -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);

+ 109
- 0
mobile/static/mobile/base.css Zobrazit soubor

@@ -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;
}

binární
mobile/static/mobile/map_icon.png Zobrazit soubor

Před Za
Šířka: 512  |  Výška: 512  |  Velikost: 3.5KB

+ 27
- 1
mobile/templates/mobile/base.html Zobrazit soubor

@@ -1,18 +1,44 @@
{% load static %}

<html>

<head>
<title>Bloom Hunting</title>

<link rel="shortcut icon" type="image/png" href="{% static 'favicon.ico' %}"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="{% static 'mobile/base.css' %}">

</head>

<body>

<div id=content>
<div id="main">
<div id='header'>
<a href="{% url 'map:index' %}">
<img id="map_icon" class="right" src='{% static 'mobile/map_icon.png' %}' />
</a>
<div id='heading'>
<div class='inner'>
<img src='{% static 'favicon.ico' %}' />
<h1 id='title'>Bloom up your city</h1>

</div>
</div>
</div>

<div id="content">
{% block content %}
{% endblock %}
</div>
</div>

<!-- FOOTER -->
<div id='footer'>
<p class='left'>Bloom Hunting - a Ökostadt Heidelberg initiative</p>
<p>A Climathon Heidelberg project</p>
</div>
</body>

</html>

+ 5
- 0
mobile/templates/mobile/index.html Zobrazit soubor

@@ -7,4 +7,9 @@
<p>Hunt blooming trees in your area.</p>

<a class="btn btn-default" id="btn_scan" href="{% url 'mobile:scan' %}">Scan a blooming tree</a>

<p>Hey, some predictions</p>

<p>{{ prediction }}</p>

{% endblock %}

+ 6
- 1
mobile/templates/mobile/scan.html Zobrazit soubor

@@ -7,13 +7,18 @@

<p>{{ question.text }}</p>

<table>
<tr>
{% for option in question.options %}

<td width=30%>
<form action="" method="post">
{% csrf_token %}
<input name="question" type="hidden" value="{{ question.key }}">
<input name="chosen_option" class="btn btn-default" type="submit" value="{{ option.text }}">
</form>
</td>
{% endfor %}
</tr>
</table>

{% endblock %}

+ 2
- 2
mobile/templates/mobile/scanned.html Zobrazit soubor

@@ -11,8 +11,8 @@ tree is blooming.<p>
{% csrf_token %}
<input type="text" name="name">
<input type="hidden" name="tree" value="{{ tree.name }}">
<input id="in_long" type="text" name="longitude">
<input id="in_lat" type="text" name="latitude">
<input id="in_long" type="hidden" name="longitude">
<input id="in_lat" type="hidden" name="latitude">
<input type="submit" value="Name your tree">
</form>



+ 2
- 0
mobile/urls.py Zobrazit soubor

@@ -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'),


+ 8
- 0
mobile/views.py Zobrazit soubor

@@ -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')




Načítá se…
Zrušit
Uložit