80 lines
3.4 KiB
Twig
80 lines
3.4 KiB
Twig
{% extends 'base.html.twig' %}
|
|
|
|
{%- block title -%}
|
|
{{- 'reputation_points'|trans }} - {{ user.username|username(false) }} - {{ parent() -}}
|
|
{%- endblock -%}
|
|
|
|
{% block mainClass %}page-user page-user-reputation{% endblock %}
|
|
|
|
{% block header_nav %}
|
|
{% endblock %}
|
|
|
|
{% block sidebar_top %}
|
|
{% endblock %}
|
|
|
|
{% block body %}
|
|
{%- set TYPE_ENTRY = constant('App\\Repository\\ReputationRepository::TYPE_ENTRY') -%}
|
|
{%- set TYPE_ENTRY_COMMENT = constant('App\\Repository\\ReputationRepository::TYPE_ENTRY_COMMENT') -%}
|
|
{%- set TYPE_POST = constant('App\\Repository\\ReputationRepository::TYPE_POST') -%}
|
|
{%- set TYPE_POST_COMMENT = constant('App\\Repository\\ReputationRepository::TYPE_POST_COMMENT') -%}
|
|
|
|
<header>
|
|
<h1 hidden>{{ 'reputation'|trans }}</h1>
|
|
<h2 hidden>{{ user.username|username }}</h2>
|
|
</header>
|
|
{% include('user/_options.html.twig') %}
|
|
<div class="pills">
|
|
<menu>
|
|
<li>
|
|
<a href="{{ path('user_reputation', {username: user.username, reputationType: TYPE_ENTRY}) }}"
|
|
class="{{ html_classes({'active': is_route_name('user_reputation') and route_has_param('reputationType', TYPE_ENTRY)}) }}">
|
|
{{ 'threads'|trans }}
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="{{ path('user_reputation', {username: user.username, reputationType: TYPE_ENTRY_COMMENT}) }}"
|
|
class="{{ html_classes({'active': is_route_name('user_reputation') and route_has_param('reputationType', TYPE_ENTRY_COMMENT)}) }}">
|
|
{{ 'comments'|trans }}
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="{{ path('user_reputation', {username: user.username, reputationType: TYPE_POST}) }}"
|
|
class="{{ html_classes({'active': is_route_name('user_reputation') and route_has_param('reputationType', TYPE_POST)}) }}">
|
|
{{ 'posts'|trans }}
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="{{ path('user_reputation', {username: user.username, reputationType: TYPE_POST_COMMENT}) }}"
|
|
class="{{ html_classes({'active': is_route_name('user_reputation') and route_has_param('reputationType', TYPE_POST_COMMENT)}) }}">
|
|
{{ 'replies'|trans }}
|
|
</a>
|
|
</li>
|
|
</menu>
|
|
</div>
|
|
<div id="content" class="reputation">
|
|
{% if results|length %}
|
|
<div class="section section--small">
|
|
<table>
|
|
<tbody>
|
|
{% for subject in results %}
|
|
<tr>
|
|
<td style="text-align: center;"
|
|
class="{{ html_classes({'success': subject.points >= 0, 'danger': subject.points < 0}) }}">{{ subject.points }}</td>
|
|
<td>{{ subject.day >= date('-2 days') ? subject.day|ago : subject.day|date('Y-m-d') }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% endif %}
|
|
{% if(results.haveToPaginate is defined and results.haveToPaginate) %}
|
|
{{ pagerfanta(results, null, {'pageParameter':'[p]'}) }}
|
|
{% endif %}
|
|
{% if not results|length %}
|
|
<aside class="section section--muted">
|
|
<p>{{ 'empty'|trans }}</p>
|
|
</aside>
|
|
{% endif %}
|
|
</div>
|
|
{% endblock %}
|