point-tools/src/Skobkin/Bundle/PointToolsBundle/Resources/views/Events/last.html.twig

56 lines
2.9 KiB
Twig
Raw Normal View History

2015-06-23 11:20:21 +00:00
{% extends "::base.html.twig" %}
{% block content %}
{# TODO classes #}
<div class="last-subscriptions-log">
{% if last_events|length > 0 %}
<div class="panel-group" id="accordion-log">
<div class="panel panel-default">
<div class="panel-heading" id="heading-subscriptions-log">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion-log" aria-expanded="true" href="#collapse-log">
<span class="glyphicon glyphicon-collapse-down"></span> {{ 'Last events'|trans }}
</a>
</h4>
</div>
<div id="collapse-log" class="panel-collapse collapse in" aria-labelledby="heading-subscriptions-log">
<div class="panel-body">
<table class="table table-striped">
<thead>
<tr>
<td>{{ 'Subscriber'|trans }}</td>
<td>{{ 'Author'|trans }}</td>
<td>{{ 'Action'|trans }}</td>
<td>{{ 'Date'|trans }}</td>
</tr>
</thead>
<tbody>
{% for event in last_events %}
<tr>
<td>
<a href="{{ url('user_show', {login: event.subscriber.login}) }}">@{{ event.subscriber.login }}</a>
</td>
<td>
<a href="{{ url('user_show', {login: event.author.login}) }}">@{{ event.author.login }}</a>
</td>
<td>
<span class="glyphicon {% if event.action == 'subscribe' %}glyphicon-plus{% elseif event.action == 'unsubscribe' %}glyphicon-minus{% endif %}"></span>
</td>
<td>
{# Use DateTime helper: https://sonata-project.org/bundles/intl/master/doc/reference/datetime.html #}
{{ event.date|date('d F Y H:i:s') }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
{% else %}
<div class="alert alert-warning" role="alert">{{ 'No log data found'|trans }}</div>
{% endif %}
</div>
{% endblock %}