From c328209f0f349158b35819aed8db18cc10c1c5b0 Mon Sep 17 00:00:00 2001 From: Matheus Fernandes Date: Sat, 5 Dec 2015 05:13:13 -0200 Subject: [PATCH] Refactoring pages Signed-off-by: Matheus Fernandes Signed-off-by: Macario Soares --- FGABreja/defaults/templates/base.html | 3 + FGABreja/defaults/templates/topbar.html | 4 +- FGABreja/monitoring/templates/home.html | 84 +++++++++++-------- FGABreja/monitoring/templates/monitoring.html | 52 ++++++++++++ .../monitoring/templates/new_process.html | 49 +++++++++++ FGABreja/monitoring/templates/static_chart_js | 71 ---------------- FGABreja/monitoring/urls.py | 5 +- FGABreja/monitoring/views.py | 17 +++- FGABreja/settings/api.py | 2 +- .../static/sass/components/_fgabreja.scss | 17 ++++ .../static/sass/components/_variables.scss | 2 +- FGABreja/static/stylesheets/materialize.css | 27 +++++- 12 files changed, 217 insertions(+), 116 deletions(-) create mode 100644 FGABreja/monitoring/templates/monitoring.html create mode 100644 FGABreja/monitoring/templates/new_process.html delete mode 100644 FGABreja/monitoring/templates/static_chart_js diff --git a/FGABreja/defaults/templates/base.html b/FGABreja/defaults/templates/base.html index 8029b10..da2d122 100644 --- a/FGABreja/defaults/templates/base.html +++ b/FGABreja/defaults/templates/base.html @@ -34,6 +34,9 @@ }); $('.modal-trigger').leanModal(); $(".dropdown-button").dropdown(); + $('.collapsible').collapsible({ + accordion : false // A setting that changes the collapsible behavior to expandable instead of the default accordion style + }); }); diff --git a/FGABreja/defaults/templates/topbar.html b/FGABreja/defaults/templates/topbar.html index b98d169..47dde72 100644 --- a/FGABreja/defaults/templates/topbar.html +++ b/FGABreja/defaults/templates/topbar.html @@ -16,7 +16,9 @@ + +{% endblock main_content %} \ No newline at end of file diff --git a/FGABreja/monitoring/templates/monitoring.html b/FGABreja/monitoring/templates/monitoring.html new file mode 100644 index 0000000..9aaa928 --- /dev/null +++ b/FGABreja/monitoring/templates/monitoring.html @@ -0,0 +1,52 @@ +{% extends "base.html" %} +{% load i18n %} + +{% block title %}Home{% endblock title %} + +{% block main_content %} +
+
+
+
+
+ {% trans "Brewery" %}. + Actual state +
+
+
+
+ +
+
+
Process Info
+
+
today
+
10 de dezembro de 2015
+
+ +
+
check_box_outline
+
Malt
+
+ +
+
check_box_outline_blank
+
Iodine test
+
+ +
+
timer
+
01:23:40:40
+
+
+
+
+
+ +{% endblock main_content %} + +{% block footer_scripts %} + {% load staticfiles %} + + {% include "realtime_chart_js" %} +{% endblock footer_scripts %} \ No newline at end of file diff --git a/FGABreja/monitoring/templates/new_process.html b/FGABreja/monitoring/templates/new_process.html new file mode 100644 index 0000000..34920a6 --- /dev/null +++ b/FGABreja/monitoring/templates/new_process.html @@ -0,0 +1,49 @@ +{% extends "base.html" %} +{% load i18n %} + +{% block title %}{% trans "New Process" %}{% endblock title %} + +{% block main_content %} +
+
+
+

{% trans "New Process" %}

+
+
+
+ +
+
+
+
+
+ Red Ale + +

{% trans "Recipe description:" %}
5.84% teor de álcool

+ +

{% trans "Malt:" %} 5kg
75% Pilsen, 10% Malte de trigo, 10% CaraAmber, 5% CaraAroma

+ +

{% trans "Yeast:" %}
BRY-97

+ +

{% trans "Hops:" %}
+

    +
  • Hop1
  • +
  • Hop2
  • +

+ + +
+
+
+
+
+
+ +
+
+
+
+
+{% endblock main_content %} \ No newline at end of file diff --git a/FGABreja/monitoring/templates/static_chart_js b/FGABreja/monitoring/templates/static_chart_js deleted file mode 100644 index a7cfe5f..0000000 --- a/FGABreja/monitoring/templates/static_chart_js +++ /dev/null @@ -1,71 +0,0 @@ -{% load i18n %} - - \ No newline at end of file diff --git a/FGABreja/monitoring/urls.py b/FGABreja/monitoring/urls.py index d1332c4..80bcb64 100644 --- a/FGABreja/monitoring/urls.py +++ b/FGABreja/monitoring/urls.py @@ -1,9 +1,12 @@ from django.conf.urls import url -from monitoring.views import get_temperature_average, HomeView +from monitoring.views import (get_temperature_average, HomeView, + NewProcessView, MonitoringView) urlpatterns = [ url(r'^temperature/average/$', get_temperature_average, name='temperature_average'), url(r'^$', HomeView.as_view(), name='home'), + url(r'^monitoring/$', MonitoringView.as_view(), name='monitoring'), + url(r'^process/new$', NewProcessView.as_view(), name='new_process'), ] diff --git a/FGABreja/monitoring/views.py b/FGABreja/monitoring/views.py index 581f60f..95945b6 100644 --- a/FGABreja/monitoring/views.py +++ b/FGABreja/monitoring/views.py @@ -1,5 +1,4 @@ from django.http import HttpResponse -from monitoring.models import ThermalSensor from django.shortcuts import render_to_response from django.template import RequestContext from defaults.views import FGABrejaView @@ -16,7 +15,19 @@ def get_temperature_average(request): class HomeView(FGABrejaView): def get(self, request): - sensor_data = ThermalSensor.objects.filter( - identifier=1).order_by('date', 'time') return render_to_response('home.html', locals(), context_instance=RequestContext(request)) + + +class MonitoringView(FGABrejaView): + + def get(self, request): + return render_to_response('monitoring.html', locals(), + context_instance=RequestContext(request)) + + +class NewProcessView(FGABrejaView): + + def get(self, request): + return render_to_response('new_process.html', locals(), + context_instance=RequestContext(request)) diff --git a/FGABreja/settings/api.py b/FGABreja/settings/api.py index 4fec0fd..b5c631c 100644 --- a/FGABreja/settings/api.py +++ b/FGABreja/settings/api.py @@ -1 +1 @@ -API_URL = 'http://localhost:5000' +API_URL = 'http://localhost:5000/api/' diff --git a/FGABreja/static/sass/components/_fgabreja.scss b/FGABreja/static/sass/components/_fgabreja.scss index 8a74506..ab062c2 100644 --- a/FGABreja/static/sass/components/_fgabreja.scss +++ b/FGABreja/static/sass/components/_fgabreja.scss @@ -16,4 +16,21 @@ .graph { width: 100%; height: 25rem; +} + +.bold { + font-weight: bold; +} + +.collapsible-body{ + padding: 1rem 2rem 1rem; + background-color: darken(white, 4%); +} + +.recipe-item { + margin: 1rem 0rem !important; +} + +.process-info { + padding-top: 3rem; } \ No newline at end of file diff --git a/FGABreja/static/sass/components/_variables.scss b/FGABreja/static/sass/components/_variables.scss index ada886d..15d4795 100644 --- a/FGABreja/static/sass/components/_variables.scss +++ b/FGABreja/static/sass/components/_variables.scss @@ -30,7 +30,7 @@ $card-link-color: color("orange", "accent-2") !default; $card-link-color-light: lighten($card-link-color, 20%) !default; /*** Collapsible ***/ -$collapsible-height: 3rem !default; +$collapsible-height: 5rem !default; $collapsible-header-color: #fff !default; $collapsible-border-color: #ddd !default; diff --git a/FGABreja/static/stylesheets/materialize.css b/FGABreja/static/stylesheets/materialize.css index 3b1bd8b..6f4aead 100644 --- a/FGABreja/static/stylesheets/materialize.css +++ b/FGABreja/static/stylesheets/materialize.css @@ -9744,8 +9744,8 @@ a.waves-effect .waves-ripple { .collapsible-header { display: block; cursor: pointer; - min-height: 3rem; - line-height: 3rem; + min-height: 5rem; + line-height: 5rem; padding: 0 1rem; background-color: #fff; border-bottom: 1px solid #ddd; @@ -9754,7 +9754,7 @@ a.waves-effect .waves-ripple { .collapsible-header i { width: 2rem; font-size: 1.6rem; - line-height: 3rem; + line-height: 5rem; display: block; float: left; text-align: center; @@ -12670,3 +12670,24 @@ button.picker__today:focus, button.picker__clear:focus, button.picker__close:foc width: 100%; height: 25rem; } + +/* line 21, ../sass/components/_fgabreja.scss */ +.bold { + font-weight: bold; +} + +/* line 25, ../sass/components/_fgabreja.scss */ +.collapsible-body { + padding: 1rem 2rem 1rem; + background-color: whitesmoke; +} + +/* line 30, ../sass/components/_fgabreja.scss */ +.recipe-item { + margin: 1rem 0rem !important; +} + +/* line 34, ../sass/components/_fgabreja.scss */ +.process-info { + padding-top: 3rem; +}