Files
LifeStats/templates/web/user_detail.html
2018-12-27 14:44:21 +04:00

105 lines
2.5 KiB
HTML

{% extends 'web/base.html' %}
{% block main %}
<div id='breadcrumbs'>
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="{% url 'users' %}">
Главная
</a>
</li>
</ol>
</div>
<h1>{{ user }}</h1>
<div class="row">
<div class="col-sm">
<img src="{% url 'user_charts_pie' user.id %}"/>
</div>
</div>
<div class="row">
<div class="col-sm">
<h2>Записи</h2>
<a class="btn btn-primary" href="{% url 'activity_log_create' user.id %}">
Создать новую запись
</a>
{% if activity_logs %}
<table class="table">
<thead>
<tr>
<th>
Активность
</th>
<th>
Когда начал
</th>
<th>
Когда закончил
</th>
<th>
</th>
<th>
</th>
</tr>
</thead>
<tbody>
{% for activity_log in activity_logs %}
<tr>
<td>
{{ activity_log.activity }}
</td>
<td>
{{ activity_log.start_time }}
</td>
<td>
{{ activity_log.end_time }}
</td>
<td>
<form method="get" action="{% url 'activity_log_update' user.id activity_log.id %}">{% csrf_token %}
<input class="btn btn-outline-primary" type="submit" value="изменить">
</form>
</td>
<td>
<form method="post" action="{% url 'activity_log_delete' user.id activity_log.id %}">{% csrf_token %}
<input class="btn btn-outline-primary" type="submit" value="удалить">
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<li>Ничего не залогано :(</li>
{% endif %}
</div>
<div class="col-sm">
<h2>Активности</h2>
<ul>
{% for activities_and_pct in activities_and_pcts %}
<li>
<a href="{% url 'user_charts_activity' user.id activities_and_pct.0.id %}">
{{ activities_and_pct.0 }} — {{ activities_and_pct.1|stringformat:".2f%%" }}
</a>
</li>
{% endfor %}
</ul>
</div>
</div>
{% endblock %}