aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authormarcinzelent <zelent.marcin@gmail.com>2017-12-07 12:38:55 +0100
committermarcinzelent <zelent.marcin@gmail.com>2017-12-07 12:38:55 +0100
commit322b79babf45b1bff0d219cfbf10524b975075fd (patch)
tree8c446d180439567f628ee55e635daa54503d3702 /app
parent8ca07955ad080f97713bdd6304cea6117be1bc52 (diff)
Split all data and data from last week, moved chart to the right side of the page.
Diffstat (limited to 'app')
-rw-r--r--app/Resources/views/base.html.twig7
-rw-r--r--app/Resources/views/default/AllData.html.twig (renamed from app/Resources/views/default/AllDataPage.html.twig)8
-rw-r--r--app/Resources/views/default/LastWeekData.html.twig35
3 files changed, 47 insertions, 3 deletions
diff --git a/app/Resources/views/base.html.twig b/app/Resources/views/base.html.twig
index 3f93ff8..b4cc11a 100644
--- a/app/Resources/views/base.html.twig
+++ b/app/Resources/views/base.html.twig
@@ -14,8 +14,11 @@
<img src="https://cdn3.iconfinder.com/data/icons/christmas-icon-set-pixel-perfect/64/christmas-color-12-512.png" alt="Pollutometer" width="50px" height="auto">
<span>Pollutometer</span>
</a>
- <a class="navbar-item" href="/AllDataReadings">
- <span>All Data Readings</span>
+ <a class="navbar-item" href="/{{ path('AllData') }}">
+ <span>All Data</span>
+ </a>
+ <a class="navbar-item" href="/{{ path('LastWeekData') }}">
+ <span>Last Week Data</span>
</a>
</div>
</nav>
diff --git a/app/Resources/views/default/AllDataPage.html.twig b/app/Resources/views/default/AllData.html.twig
index 4607049..7bc33af 100644
--- a/app/Resources/views/default/AllDataPage.html.twig
+++ b/app/Resources/views/default/AllData.html.twig
@@ -1,6 +1,8 @@
{% extends 'base.html.twig' %}
{% block body %}
+<div class="columns">
+ <div class="column is-narrow">
<table class="table">
<thead class="thead">
<tr class="tr">
@@ -21,9 +23,13 @@
</tbody>
{% endfor %}
</table>
+ </div>
+ <div class="column">
<canvas id="ctx"></canvas>
+ </div>
+</div>
{% endblock %}
{% block javascripts %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.bundle.min.js"></script>
- <script src="{{ asset('js/chartOfReadings.js') }}"></script
+ <script src="{{ asset('js/AllDataChart.js') }}"></script
{% endblock %} \ No newline at end of file
diff --git a/app/Resources/views/default/LastWeekData.html.twig b/app/Resources/views/default/LastWeekData.html.twig
new file mode 100644
index 0000000..fdc6dd9
--- /dev/null
+++ b/app/Resources/views/default/LastWeekData.html.twig
@@ -0,0 +1,35 @@
+{% extends 'base.html.twig' %}
+
+{% block body %}
+<div class="columns">
+ <div class="column is-narrow">
+<table class="table">
+ <thead class="thead">
+ <tr class="tr">
+ <th>TimeStamp</th>
+ <th>Co</th>
+ <th>No</th>
+ <th>So</th>
+ </tr>
+ </thead>
+ <tbody class="tbody">
+ <tr class="tr">
+ {% for table in data %}
+ <td class="td">{{ table.TimeStamp }}</td>
+ <td class="td">{{ table.Co }}</td>
+ <td class="td">{{ table.No }}</td>
+ <td class="td">{{ table.So }}</td>
+ </tr>
+ </tbody>
+ {% endfor %}
+</table>
+ </div>
+ <div class="column">
+<canvas id="ctx"></canvas>
+ </div>
+</div>
+{% endblock %}
+{% block javascripts %}
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.bundle.min.js"></script>
+ <script src="{{ asset('js/LastWeekDataChart.js') }}"></script
+{% endblock %} \ No newline at end of file