{% extends 'base.html' %}

{% block title %}
        Profile
{% endblock %}

{% block content %}
<table class="table table-hover">
            <td>
                <h1>{{ user.username }}</h1>
                {% if user.about_me %}<p>{{ user.about_me }}</p>{% endif %}
                {% if user.last_seen %}<p>Last seen on: {{ user.last_seen }}</p>{% endif %}
                {% if user == current_user %}
                <p><a href="{{ url_for('edit_profile') }}">Edit your profile</a></p>

                {% endif %}
                <hr>
                <h1>My devices</h1>
                {% for device in devices %}
                    <p>{{ device. device_name }} : {{ device.device_EUI }}</p>
                    <p><a href="{{ url_for('service.device_data', device_eui=device.device_EUI) }}">Device data</a></p>
                {% endfor %}
            </td>
</table>
{% endblock %}