This commit is contained in:
Alexey Skobkin 2015-06-02 05:24:38 +03:00
parent a9f53f3b25
commit 3742f4b06c
2 changed files with 66 additions and 53 deletions

View file

@ -38,6 +38,10 @@ body > .container {
margin-top: 30px; margin-top: 30px;
} }
.user-subscriptions-log {
margin-top: 30px;
}
h4.panel-title a { h4.panel-title a {
text-decoration: none; text-decoration: none;
} }

View file

@ -9,68 +9,77 @@
</h1> </h1>
<div class="user-subscribers"> <div class="user-subscribers">
<div class="panel-group" id="accordion-subscribers"> {% if subscribers|length > 0 %}
<div class="panel panel-default"> <div class="panel-group" id="accordion-subscribers">
<div class="panel-heading"id="headingOne"> <div class="panel panel-default">
<h4 class="panel-title"> <div class="panel-heading"id="headingOne">
<a data-toggle="collapse" data-parent="#accordion-subscribers" aria-expanded="true" href="#collapse-subscribers"> <h4 class="panel-title">
<span class="glyphicon glyphicon-collapse-down"></span> {{ 'Subscribers'|trans }} <a data-toggle="collapse" data-parent="#accordion-subscribers" aria-expanded="true" href="#collapse-subscribers">
</a> <span class="glyphicon glyphicon-collapse-down"></span> {{ 'Subscribers'|trans }}
</h4> </a>
</div> </h4>
<div id="collapse-subscribers" class="panel-collapse collapse in"> </div>
<div class="panel-body"> <div id="collapse-subscribers" class="panel-collapse collapse in">
<ul class="users mosaic"> <div class="panel-body">
{% for user in subscribers %} <ul class="users mosaic">
<li><a href="{{ url('user_show', {login: user.login}) }}">@{{ user.login }}</a></li> {% for user in subscribers %}
{% endfor %} <li><a href="{{ url('user_show', {login: user.login}) }}">@{{ user.login }}</a></li>
</ul> {% endfor %}
</ul>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> {% else %}
<div class="alert alert-warning" role="alert">{{ 'No subscribers data found'|trans }}</div>
{% endif %}
</div> </div>
<div class="user-subscribers"> <div class="user-subscriptions-log">
<div class="panel-group" id="accordion-log"> {% if log|length > 0 %}
<div class="panel panel-default"> <div class="panel-group" id="accordion-log">
<div class="panel-heading" id="headingOne"> <div class="panel panel-default">
<h4 class="panel-title"> <div class="panel-heading" id="headingOne">
<a data-toggle="collapse" data-parent="#accordion-log" aria-expanded="true" href="#collapse-log"> <h4 class="panel-title">
<span class="glyphicon glyphicon-collapse-down"></span> {{ 'Subscriptions log'|trans }} <a data-toggle="collapse" data-parent="#accordion-log" aria-expanded="true" href="#collapse-log">
</a> <span class="glyphicon glyphicon-collapse-down"></span> {{ 'Subscriptions log'|trans }}
</h4> </a>
</div> </h4>
<div id="collapse-log" class="panel-collapse collapse in"> </div>
<div class="panel-body"> <div id="collapse-log" class="panel-collapse collapse in">
<table class="table table-striped"> <div class="panel-body">
<thead> <table class="table table-striped">
<tr> <thead>
<td>{{ 'User'|trans }}</td>
<td>{{ 'Action'|trans }}</td>
<td>{{ 'Date'|trans }}</td>
</tr>
</thead>
<tbody>
{% for event in log %}
<tr> <tr>
<td> <td>{{ 'User'|trans }}</td>
<a href="{{ url('user_show', {login: event.subscriber.login}) }}">@{{ event.subscriber.login }}</a> <td>{{ 'Action'|trans }}</td>
</td> <td>{{ 'Date'|trans }}</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('H:i:s d F Y') }}
</td>
</tr> </tr>
{% endfor %} </thead>
</tbody> <tbody>
</table> {% for event in log %}
<tr>
<td>
<a href="{{ url('user_show', {login: event.subscriber.login}) }}">@{{ event.subscriber.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('H:i:s d F Y') }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> {% else %}
<div class="alert alert-warning" role="alert">{{ 'No log data found'|trans }}</div>
{% endif %}
</div> </div>
{% endblock %} {% endblock %}