{% extends "base.html" %}

{% block title %}Dashboard{% endblock %}

{% block sub_title %}{% endblock %}

{% block content %}

    <div class="row">

        {% for device_name, series_list in device_readings.items() %}

            <div class="col-sm-4 col-xs-6">

                <div class="small-box bg-{{ loop.cycle('aqua', 'green', 'yellow', 'red', 'blue') }}">

                    <div class="inner">

                        <h3>
                            {{ device_name }}
                        </h3>

                        {% for series in series_list %}

                            <p>
                                {{ series.name }}, {{ series.value }}<br/>
                                <time datetime="{{ series.created_at }}">
                                        {{ series.created_at }}
                                </time>
                            </p>

                        {% endfor %}

                    </div>

                    <a href="{{ url_for('.dashboard', device_name=device_name ) }}" class="small-box-footer">
                        More info <i class="fa fa-arrow-circle-right"></i>
                    </a>

                </div>

            </div>


        {% endfor %}

    </div>

{% endblock %}
