diff options
| -rw-r--r-- | app/Resources/views/base.html.twig | 14 | ||||
| -rw-r--r-- | app/Resources/views/default/AllDataPage.html.twig | 49 | ||||
| -rw-r--r-- | app/Resources/views/default/index.html.twig | 43 | 
3 files changed, 63 insertions, 43 deletions
| diff --git a/app/Resources/views/base.html.twig b/app/Resources/views/base.html.twig index bafd28d..3f93ff8 100644 --- a/app/Resources/views/base.html.twig +++ b/app/Resources/views/base.html.twig @@ -5,9 +5,23 @@          <title>{% block title %}Welcome!{% endblock %}</title>          {% block stylesheets %}{% endblock %}          <link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" /> +        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.6.1/css/bulma.min.css"/>      </head>      <body> +    <nav class="navbar" role="navigation" aria-label="main navigation" style="margin: 0 0 3em 0"> +        <div class="navbar-brand"> +            <a class="navbar-item" href="/"> +                <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> +        </div> +    </nav> +    <div class="container">          {% block body %}{% endblock %} +    </div>          {% block javascripts %}{% endblock %}      </body>  </html> diff --git a/app/Resources/views/default/AllDataPage.html.twig b/app/Resources/views/default/AllDataPage.html.twig index 429e13e..4607049 100644 --- a/app/Resources/views/default/AllDataPage.html.twig +++ b/app/Resources/views/default/AllDataPage.html.twig @@ -1,30 +1,29 @@ -<!DOCTYPE html> -<html lang="en"> -<head> -    <meta charset="UTF-8"> -    <title>All Pollution Data | Pollutometer</title> -    <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.bundle.min.js"></script> -</head> -<body> -<table border="1"> -    <tr> -        <th>TimeStamp</th> -        <th>Co</th> -        <th>No</th> -        <th>So</th> -    </tr> -    <tr> -        {% for table in data %} -        <td>{{ table.TimeStamp }}</td> -        <td>{{ table.Co }}</td> -        <td>{{ table.No }}</td> -        <td>{{ table.So }}</td> -    </tr> +{% extends 'base.html.twig' %} + +{% block body %} +<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>  <canvas id="ctx"></canvas> -</body> +{% 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 -{% endblock %} -</html>
\ No newline at end of file +{% endblock %}
\ No newline at end of file diff --git a/app/Resources/views/default/index.html.twig b/app/Resources/views/default/index.html.twig index 705044b..176f519 100644 --- a/app/Resources/views/default/index.html.twig +++ b/app/Resources/views/default/index.html.twig @@ -1,26 +1,33 @@  {% extends 'base.html.twig' %}  {% block body %} -    <div id="wrapper"> -        <table border="1"> -            <tr> -                <th>TimeStamp</th> -                <th>Co</th> -                <th>No</th> -                <th>So</th> -            </tr> -            <tr id="latest"> -                <td>{{ TimeStamp }}</td> -                <td>{{ Co }}</td> -                <td>{{ No }}</td> -                <td>{{ So }}</td> -            </tr> -        </table> +    <div class="columns"> +        <div class="column"> +            <table class="table"> +                <thead class="thead"> +                <tr class="tr"> +                    <th class="td">TimeStamp</th> +                    <th class="td">Co</th> +                    <th class="td">No</th> +                    <th class="td">So</th> +                </tr> +                </thead> +                <tbody class="tbody"> +                <tr id="latest" class="tr"> +                    <td class="td">{{ TimeStamp }}</td> +                    <td class="td">{{ Co }}</td> +                    <td class="td">{{ No }}</td> +                    <td class="td">{{ So }}</td> +                </tr> +                </tbody> +            </table> +            <p id="aq">The current air quality index is <strong>{{ Aqi }}</strong></p> +        </div> +        <div class="column"> +            <img src="https://www.ourair.org/wp-content/uploads/AQItable.gif"> +        </div>      </div> -    <a href="/AllDataReadings">All Data Page</a> -    <p id="aq">The current air quality index is <strong>{{ Aqi }}</strong></p> -    <img src="https://www.ourair.org/wp-content/uploads/AQItable.gif">  {% endblock %}  {% block javascripts %}      <script src="{{ asset('js/realtime.js') }}"></script> |