point-tools/templates/Web/User/show.html.twig
2023-08-17 01:40:29 +03:00

130 lines
6 KiB
Twig

{% extends 'Web/base.html.twig' %}
{% block header_title %}{{ user.login }} @ Point Tools{% endblock %}
{% block content %}
<h1 id="user-login">
{# TODO: Add class with image size #}
<img src="{{ user.login|point_avatar_large }}">
<a href="{{ user.login|point_user_blog_url }}" target="_blank">{{ user.login }}</a>
{% if not user.public %}<span title="{{ 'Non-public'|trans }}" class="glyphicon glyphicon-lock"></span>{% endif %}
{% if user.whitelistOnly %}<span title="{{ 'Whitelist-only'|trans }}" class="glyphicon glyphicon-list"></span>{% endif %}
</h1>
{% if user.removed %}
<div class="alert alert-danger" role="alert">
<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
{{ 'User was removed from Point.im. It could be caused by Terms of Service violation.'|trans }}
</div>
{% endif %}
<div class="user-subscribers">
{% if subscribers|length > 0 %}
<div class="panel-group" id="accordion-subscribers">
<div class="panel panel-default">
<div class="panel-heading" id="heading-subscribers">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion-subscribers" aria-expanded="false" href="#collapse-subscribers">
<span class="glyphicon glyphicon-collapse-down"></span> {{ 'Subscribers'|trans }} ({{ subscribers|length }})
</a>
</h4>
</div>
<div id="collapse-subscribers" class="panel-collapse collapse" aria-labelledby="heading-subscribers">
<div class="panel-body">
<ul class="users mosaic">
{% for user in subscribers %}
<li><a href="{{ path('user_show', {login: user.login}) }}">@{{ user.login }}</a></li>
{% endfor %}
</ul>
</div>
</div>
</div>
</div>
{% else %}
<div class="alert alert-warning" role="alert">{{ 'No subscribers data found'|trans }}</div>
{% endif %}
</div>
<div class="user-rename-log">
{% if rename_log|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> {{ 'Rename log'|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>{{ 'Date'|trans }}</td>
<td>{{ 'Old login'|trans }}</td>
</tr>
</thead>
<tbody>
{% for event in rename_log %}
<tr>
<td>
{# @todo Use DateTime helper: https://sonata-project.org/bundles/intl/master/doc/reference/datetime.html #}
{{ event.date|date('d F Y H:i:s') }}
</td>
<td>
{{ event.oldLogin }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
{% else %}
<div class="alert alert-warning" role="alert">{{ 'No rename log data found'|trans }}</div>
{% endif %}
</div>
<div class="user-subscriptions-log">
<h3>{{ 'Subscriptions log'|trans }}</h3>
{% if subscriptions_log|length > 0 %}
<table class="table table-striped">
<thead>
<tr>
<td>{{ 'User'|trans }}</td>
<td>{{ 'Action'|trans }}</td>
<td>{{ 'Date'|trans }}</td>
</tr>
</thead>
<tbody>
{% for event in subscriptions_log %}
<tr>
<td>
<a href="{{ path('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>
{# @todo 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>
{% else %}
<div class="alert alert-warning" role="alert">{{ 'No subscribers log data found'|trans }}</div>
{% endif %}
</div>
<div class="navigation">
{{ knp_pagination_render(subscriptions_log) }}
</div>
{% endblock %}