Commit ec53ef17661c27e2479d9d30db3deebec0e0825b
Exists in
master
and in
1 other branch
Merge branch 'master' of https://gitlab.irap.omp.eu/epallier/pyros.git
Showing
14 changed files
with
211 additions
and
1 deletions
Show diff stats
... | ... | @@ -0,0 +1,14 @@ |
1 | +{% load bootstrap3 %} | |
2 | + | |
3 | +{% bootstrap_css %} | |
4 | + | |
5 | +<!DOCTYPE html> | |
6 | +<html> | |
7 | + <head> | |
8 | + <meta charset="UTF-8"> | |
9 | + <title>Alerts</title> | |
10 | + </head> | |
11 | + <body> | |
12 | + <h1 class="text-center page-header">ALERTS</h1> | |
13 | + </body> | |
14 | +</html> | |
0 | 15 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,14 @@ |
1 | +{% load bootstrap3 %} | |
2 | + | |
3 | +{% bootstrap_css %} | |
4 | + | |
5 | +<!DOCTYPE html> | |
6 | +<html> | |
7 | + <head> | |
8 | + <meta charset="UTF-8"> | |
9 | + <title>Devices</title> | |
10 | + </head> | |
11 | + <body> | |
12 | + <h1 class="text-center page-header">DEVICES</h1> | |
13 | + </body> | |
14 | +</html> | |
0 | 15 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,31 @@ |
1 | +{% load bootstrap3 %} | |
2 | + | |
3 | +{% bootstrap_css %} | |
4 | + | |
5 | +<!DOCTYPE html> | |
6 | +<html> | |
7 | + <head> | |
8 | + <meta charset="UTF-8"> | |
9 | + <title>Dashboard</title> | |
10 | + </head> | |
11 | + <body> | |
12 | + <h1 class="text-center page-header">PYROS DASHBOARD</h1> | |
13 | + <div class="container text-center" style="magin-left:-20px" role="main"> | |
14 | + <p class="row"> | |
15 | + <a href="{% url "dashboard.views.users" %}" class="btn btn-lg btn-primary col-md-2" type="a">Users</a> | |
16 | + <a href="{% url "dashboard.views.alerts" %}" class="btn btn-lg btn-primary col-md-2 col-md-offset-3" type="a">Alerts</a> | |
17 | + <a href="{% url "dashboard.views.routines" %}" class="btn btn-lg btn-primary col-md-2 col-md-offset-3" type="a">Routines</a> | |
18 | + </p> | |
19 | + <p class="row"> | |
20 | + <a href="{% url "dashboard.views.weather" %}" class="btn btn-lg btn-primary col-md-2" type="a">Weather</a> | |
21 | + <a href="{% url "dashboard.views.site" %}" class="btn btn-lg btn-primary col-md-2 col-md-offset-3" type="a">Site</a> | |
22 | + <a href="{% url "dashboard.views.devices" %}" class="btn btn-lg btn-primary col-md-2 col-md-offset-3" type="a">Devices</a> | |
23 | + </p> | |
24 | + <p class="row"> | |
25 | + <a href="{% url "dashboard.views.system" %}" class="btn btn-lg btn-primary col-md-2" type="a">System</a> | |
26 | + <a href="{% url "dashboard.views.schedule" %}" class="btn btn-lg btn-primary col-md-2 col-md-offset-3" type="a">Schedule</a> | |
27 | + <a href="{% url "dashboard.views.quotas" %}" class="btn btn-lg btn-primary col-md-2 col-md-offset-3" type="a">Quotas & Priorities</a> | |
28 | + </p> | |
29 | + </div> | |
30 | + </body> | |
31 | +</html> | |
0 | 32 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,14 @@ |
1 | +{% load bootstrap3 %} | |
2 | + | |
3 | +{% bootstrap_css %} | |
4 | + | |
5 | +<!DOCTYPE html> | |
6 | +<html> | |
7 | + <head> | |
8 | + <meta charset="UTF-8"> | |
9 | + <title>Quotas and Priorities</title> | |
10 | + </head> | |
11 | + <body> | |
12 | + <h1 class="text-center page-header">QUOTAS & PRIORITIES</h1> | |
13 | + </body> | |
14 | +</html> | |
0 | 15 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,14 @@ |
1 | +{% load bootstrap3 %} | |
2 | + | |
3 | +{% bootstrap_css %} | |
4 | + | |
5 | +<!DOCTYPE html> | |
6 | +<html> | |
7 | + <head> | |
8 | + <meta charset="UTF-8"> | |
9 | + <title>Routines</title> | |
10 | + </head> | |
11 | + <body> | |
12 | + <h1 class="text-center page-header">ROUTINES</h1> | |
13 | + </body> | |
14 | +</html> | |
0 | 15 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,14 @@ |
1 | +{% load bootstrap3 %} | |
2 | + | |
3 | +{% bootstrap_css %} | |
4 | + | |
5 | +<!DOCTYPE html> | |
6 | +<html> | |
7 | + <head> | |
8 | + <meta charset="UTF-8"> | |
9 | + <title>Schedule</title> | |
10 | + </head> | |
11 | + <body> | |
12 | + <h1 class="text-center page-header">SCHEDULE</h1> | |
13 | + </body> | |
14 | +</html> | |
0 | 15 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,14 @@ |
1 | +{% load bootstrap3 %} | |
2 | + | |
3 | +{% bootstrap_css %} | |
4 | + | |
5 | +<!DOCTYPE html> | |
6 | +<html> | |
7 | + <head> | |
8 | + <meta charset="UTF-8"> | |
9 | + <title>Site</title> | |
10 | + </head> | |
11 | + <body> | |
12 | + <h1 class="text-center page-header">SITE</h1> | |
13 | + </body> | |
14 | +</html> | |
0 | 15 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,14 @@ |
1 | +{% load bootstrap3 %} | |
2 | + | |
3 | +{% bootstrap_css %} | |
4 | + | |
5 | +<!DOCTYPE html> | |
6 | +<html> | |
7 | + <head> | |
8 | + <meta charset="UTF-8"> | |
9 | + <title>System</title> | |
10 | + </head> | |
11 | + <body> | |
12 | + <h1 class="text-center page-header">SYSTEM</h1> | |
13 | + </body> | |
14 | +</html> | |
0 | 15 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,14 @@ |
1 | +{% load bootstrap3 %} | |
2 | + | |
3 | +{% bootstrap_css %} | |
4 | + | |
5 | +<!DOCTYPE html> | |
6 | +<html> | |
7 | + <head> | |
8 | + <meta charset="UTF-8"> | |
9 | + <title>Users</title> | |
10 | + </head> | |
11 | + <body> | |
12 | + <h1 class="text-center page-header">USERS</h1> | |
13 | + </body> | |
14 | +</html> | |
0 | 15 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,14 @@ |
1 | +{% load bootstrap3 %} | |
2 | + | |
3 | +{% bootstrap_css %} | |
4 | + | |
5 | +<!DOCTYPE html> | |
6 | +<html> | |
7 | + <head> | |
8 | + <meta charset="UTF-8"> | |
9 | + <title>Weather</title> | |
10 | + </head> | |
11 | + <body> | |
12 | + <h1 class="text-center page-header">WEATHER</h1> | |
13 | + </body> | |
14 | +</html> | |
0 | 15 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,15 @@ |
1 | +from django.conf.urls import url | |
2 | +from . import views | |
3 | + | |
4 | +urlpatterns = [ | |
5 | + url(r'^$', views.home), | |
6 | + url(r'^users$', views.users, name="users"), | |
7 | + url(r'^alerts$', views.alerts, name="alerts"), | |
8 | + url(r'^routines$', views.routines, name="routines"), | |
9 | + url(r'^weather$', views.weather, name="weather"), | |
10 | + url(r'^site$', views.site, name="site"), | |
11 | + url(r'^devices$', views.devices, name="devices"), | |
12 | + url(r'^system$', views.system, name="system"), | |
13 | + url(r'^schedule$', views.schedule, name="schedule"), | |
14 | + url(r'^quotas$', views.quotas, name="quotas"), | |
15 | + ] | |
0 | 16 | \ No newline at end of file | ... | ... |
src/dashboard/views.py
1 | 1 | from django.shortcuts import render |
2 | 2 | |
3 | -# Create your views here. | |
3 | +def home(request): | |
4 | + # je passe par une vue et pas par un routage statique | |
5 | + # pour prévoir la gestion des permissions | |
6 | + return render(request, 'dashboard/home.html') | |
7 | + | |
8 | +def users(request): | |
9 | + return render(request, 'dashboard/users.html') | |
10 | + | |
11 | +def alerts(request): | |
12 | + return render(request, 'dashboard/alerts.html') | |
13 | + | |
14 | +def routines(request): | |
15 | + return render(request, 'dashboard/routines.html') | |
16 | + | |
17 | +def weather(request): | |
18 | + return render(request, 'dashboard/weather.html') | |
19 | + | |
20 | +def site(request): | |
21 | + return render(request, 'dashboard/site.html') | |
22 | + | |
23 | +def devices(request): | |
24 | + return render(request, 'dashboard/devices.html') | |
25 | + | |
26 | +def system(request): | |
27 | + return render(request, 'dashboard/system.html') | |
28 | + | |
29 | +def schedule(request): | |
30 | + return render(request, 'dashboard/schedule.html') | |
31 | + | |
32 | +def quotas(request): | |
33 | + return render(request, 'dashboard/quotas.html') | ... | ... |
src/pyros/settings.py
... | ... | @@ -40,7 +40,9 @@ INSTALLED_APPS = [ |
40 | 40 | 'django.contrib.sessions', |
41 | 41 | 'django.contrib.messages', |
42 | 42 | 'django.contrib.staticfiles', |
43 | + 'bootstrap3', | |
43 | 44 | 'pyrosapp', |
45 | + 'dashboard', | |
44 | 46 | ] |
45 | 47 | |
46 | 48 | MIDDLEWARE_CLASSES = [ |
... | ... | @@ -138,6 +140,11 @@ USE_TZ = True |
138 | 140 | |
139 | 141 | STATIC_URL = '/static/' |
140 | 142 | |
143 | +# uncomment if staticfiles are needed at src/static | |
144 | +# STATICFILES_DIRS = ( | |
145 | +# os.path.join(BASE_DIR, "static"), | |
146 | +# ) | |
147 | + | |
141 | 148 | # dit ou se trouve la racine de tous les fichiers statiques |
142 | 149 | #STATIC_ROOT = '/home/formation/src/' |
143 | 150 | STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'public', 'static') | ... | ... |
src/pyros/urls.py
... | ... | @@ -26,6 +26,7 @@ urlpatterns = [ |
26 | 26 | ''' |
27 | 27 | urlpatterns = [ |
28 | 28 | url(r'^admin/', admin.site.urls), |
29 | + url(r'^dashboard/', include('dashboard.urls')), | |
29 | 30 | # url(r'^pyrosapp/', include('pyrosapp.urls', namespace="pyros", app_name="pyros")), |
30 | 31 | ] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) |
31 | 32 | ... | ... |