Files
chixana/templates/index/index.html.twig
T
2020-02-14 18:57:47 +03:00

120 lines
4.3 KiB
Twig

{% extends 'main.html.twig' %}
{% block content %}
<div class="pure-u-1-2">
<h1>Сегодня {{ 'now'|date('d.m.Y') }}</h1>
{% if is_granted('ROLE_USER') %}
<a class="pure-button my-button"
href="{{ path('chix_app_chix_add') }}"
onclick="return confirm('Прямой сейчас будет зафиксирован чих!!')"
>
<i class="fas fa-pills fa-lg"></i>
Зафиксировать себя!
</a>
{% else %}
<p>Залогиньтесь чтобы отравиться на экспертизу!</p>
{% endif %}
<table class="pure-table">
<thead>
<tr>
<th>#</th>
<th>Чел</th>
<th>Когда</th>
<th></th>
<th>Санитары</th>
</tr>
</thead>
<tbody>
{% for key, chix in chixi %}
{% if key is odd %}
<tr class="pure-table-odd">
{% else %}
<tr>
{% endif %}
<td><a href="{{ path('chix_app_chix_view', {chixId: chix.id}) }}">{{ key + 1 }}</a></td>
<td>
<div style="align-items: center; display: flex;">
<img src="{{ chix.user.avatar }}" width="25px" height="25px" style="padding: 4px"/>
<div>{{ chix.user.name }}</div>
</div>
{% if is_granted('ROLE_USER') %}
{% if not (chix.user.isEqual(app.user) or chix.hasApproveFromUser(app.user)) %}
<a class="pure-button my-btn-small" href="{{ path('chix_app_chix_approve', {'chixId': chix.id}) }}" >
<i class="fas fa-check-circle fa-lg"></i>
Будь здоров!
</a>
{% endif %}
{% endif %}
</td>
<td>{{ chix.createdAt|date('H:i:s') }}</td>
<td>
<i class="fas fa-lg {{ chix.isVerified ? 'fa-check-circle color-green' : 'fa-times-circle color-red' }}"></i>
</td>
<td>
{% for approve in chix.approves %}
{#<div style="align-items: center; display: flex;">#}
<span data-message="{{ approve.user.name }}">
<img src="{{ approve.user.avatar }}" width="25px" height="25px" style="padding: 4px"/>
{#<div>{{ approve.user.name }}</div>#}
</span>
{#</div>#}
{% endfor %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% if is_granted('ROLE_USER') %}
<h1>Последние лекари.</h1>
<table class="pure-table">
<thead>
<tr>
<th>#</th>
<th>Чел</th>
<th>Дата</th>
</tr>
</thead>
<tbody>
{% for key, approve in approves %}
{% if key is odd %}
<tr class="pure-table-odd">
{% else %}
<tr>
{% endif %}
<td>{{ key + 1 }}</td>
<td>
<div style="align-items: center; display: flex;">
<img src="{{ approve.user.avatar }}" width="25px" height="25px" style="padding: 4px"/>
<div>{{ approve.user.name }}</div>
</div>
</td>
<td>{{ approve.getCreatedAt|date('Y-m-d H:i:s') }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
</div>
<div class="pure-u-1-2">
<div style="padding: 0 20px 0 20px;">
<h1>Борда чихов</h1>
{% for board in weekBoard|reverse %}
{{ include('index/board.html.twig') }}
{% endfor %}
</div>
<p>Если вы чихнули, то, пожалуйста, зафиксируте время и факт произошедшего.</p>
<p>Будьте внимательны! Если чихнул Ваш коллега, то не забудьте напомнить ему о акте фиксации.</p>
<p>Помните! Нам важен каждый чих!</p>
</div>
{% endblock %}