Ajout d'une extension

This commit is contained in:
Gauvain Boiché
2020-04-04 18:27:27 +02:00
parent c3ed8cc1c1
commit 3a964fe237
387 changed files with 58921 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
{% set width = block('width', block.TEMPLATE) is defined ? block('width', block.TEMPLATE) : 's12' %}
<div class="aps-col {{ width }}" id="aps_{{ block.ID }}" data-aps-id="{{ block.ID }}">
<div class="aps-panel">
<div class="aps-panel-header">
<h3>{{ block.TITLE }}</h3>
{% if S_USER_LOGGED_IN and not S_IS_BOT %}
{% if not block.S_REQUIRED %}
<a class="aps-panel-action aps-panel-delete" href="{{ block.U_DELETE }}" data-ajax="aps_remove">
<i class="icon fa-times fa-fw"></i>
</a>
{% endif %}
<span class="aps-panel-action aps-panel-move aps-js"><i class="icon fa-ellipsis-h fa-fw"></i></span>
{% endif %}
</div>
<div class="aps-panel-content">
{% if block('content', block.TEMPLATE) is defined %}
{{ block('content', block.TEMPLATE) }}
{% else %}
<p class="error">{{ lang('APS_POINTS_BLOCK_NO_CONTENT') }}</p>
{% endif %}
</div>
{% if block('footer', block.TEMPLATE) is defined %}
<div class="aps-panel-footer">
{{ block('footer', block.TEMPLATE) }}
</div>
{% endif %}
</div>
</div>

View File

@@ -0,0 +1,104 @@
{% block width %}s12{% endblock %}
{% block content %}
{% if aps_actions %}
<div class="aps-collection">
{% for action in aps_actions %}
<div class="aps-collection-item aps-avatar">
{{ APS_ACTIONS_AVATARS[action.USER_ID] is not empty ? APS_ACTIONS_AVATARS[action.USER_ID] : (S_APS_DAE_ENABLED ? '' : APS_ACTIONS_NO_AVATAR) }}
<div class="aps-row">
<div class="aps-col s12 m{{ action.S_AUTH_BUILD ? 4 : 6 }} l2 aps-no-mar-bot">
{{ action.USER }}
</div>
<div class="aps-col {{ action.S_AUTH_BUILD ? 's9 m6 l2' : 's12 m6 l3' }} aps-no-mar-bot aps-no-padding">
<strong>{{ lang(action.ACTION) }}</strong>
{% if not action.S_SELF %}
<br>{{ lang('POST_BY_AUTHOR') }}
{% if action.S_MOD and not action.S_AUTH_MOD %}
{{ lang('MODERATOR') }}
{% else %}
{{ action.REPORTEE }}
{% endif %}
{% endif %}
</div>
{% if action.S_AUTH_BUILD %}
<div class="aps-col s1 m1 l1 aps-no-mar-bot">
{% if action.S_AUTH_BUILD_OTHER %}
<div class="aps-button-blue aps-inline aps-js" data-aps-augmentation="true">
<i class="icon fa-list fa-fw"></i>
</div>
<div class="hidden">
<dl class="details">
{% for key, value in action.ACTIONS %}
<dt>{{ aps_display(value, false) }}</dt>
<dd>{{ lang(key, aps_name()) }}</dd>
{% endfor %}
</dl>
</div>
{% endif %}
</div>
{% endif %}
<div class="aps-row aps-col s12 l3 aps-no-mar-bot">
<div class="aps-col s4 aps-no-mar-bot aps-no-padding">
{{ aps_display(action.POINTS_OLD, false) }}
</div>
<div class="aps-col s4 aps-no-mar-bot aps-no-padding {{ action.POINTS_SUM < 0 ? 'aps-negative' : 'aps-positive' }}">
{{ aps_display(action.POINTS_SUM, false) }}
</div>
<div class="aps-col s4 aps-no-mar-bot aps-no-padding">
{{ aps_display(action.POINTS_NEW, false) }}
</div>
</div>
<div class="aps-col s6 l2 aps-no-mar-bot aps-hide-s">
{{ user.format_date(action.TIME) }}
</div>
<div class="aps-col s6 l2 aps-no-mar-bot aps-ellipsis aps-hide-s">
{% if action.FORUM_NAME or action.TOPIC_TITLE or action.POST_SUBJECT %}
<ul class="fa-ul aps-no-mar">
{% if action.FORUM_NAME %}
<li><a href="{{ action.U_FORUM }}" title="{{ action.FORUM_NAME }}">{{ action.FORUM_NAME }}</a></li>
{% endif %}
{% if action.TOPIC_TITLE %}
<li><a href="{{ action.U_TOPIC }}" title="{{ action.TOPIC_TITLE }}">{{ action.TOPIC_TITLE }}</a></li>
{% endif %}
{% if action.POST_SUBJECT %}
<li><a href="{{ action.U_POST }}" title="{{ action.POST_SUBJECT }}">{{ action.POST_SUBJECT }}</a></li>
{% endif %}
</ul>
{% else %}
<div class="aps-center">{{ lang('NA') }}</div>
{% endif %}
</div>
</div>
</div>
{% endfor %}
</div>
{% else %}
<div class="error">{{ lang('APS_POINTS_ACTIONS_NONE', aps_name()) }}</div>
{% endif %}
{% endblock %}
{% block footer %}
{# Pagination #}
<div class="pagination top-pagination">
{{ TOTAL_LOGS }}
{% if pagination %}
{% include 'pagination.html' %}
{% else %}
&bull; {{ PAGE_NUMBER }}
{% endif %}
</div>
{# Search and sort #}
<form class="aps-form" method="post" action="{{ U_APS_ACTION_LOGS }}" data-ajax="aps_replace">
{# Sort options #}
{% include '@phpbbstudio_aps/aps_display_sort.html' %}
{# Search options #}
{% include '@phpbbstudio_aps/aps_display_search.html' %}
{# Search keywords #}
<input id="keywords" name="keywords" type="search" size="20" placeholder="{{ lang('APS_POINTS_ACTION_SEARCH', aps_name()) }}" />
<input id="submit" name="submit" type="submit" value="{{ lang('SEARCH') }}">
</form>
{% endblock %}

View File

@@ -0,0 +1,79 @@
{% block width %}s12{% endblock %}
{% block content %}
{% if aps_adjustments %}
<div class="aps-collection">
{% for action in aps_adjustments %}
<div class="aps-collection-item aps-avatar">
{{ APS_ADJUSTMENTS_AVATARS[action.USER_ID] is not empty ? APS_ADJUSTMENTS_AVATARS[action.USER_ID] : (S_APS_DAE_ENABLED ? '' : APS_ADJUSTMENTS_NO_AVATAR) }}
<div class="aps-row">
<div class="aps-col s12 m{{ action.S_AUTH_BUILD ? 4 : 6 }} l2 aps-no-mar-bot">
{{ action.USER }}
</div>
<div class="aps-col {{ action.S_AUTH_BUILD ? 's9 m6 l2' : 's12 m6 l3' }} aps-no-mar-bot">
<strong>{{ lang(action.ACTION) }}</strong>
</div>
{% if action.S_AUTH_BUILD %}
<div class="aps-col s1 m1 l1 aps-no-mar-bot">
{% if action.S_AUTH_BUILD_OTHER %}
<div class="aps-button-blue aps-inline aps-js" data-aps-augmentation="true">
<i class="icon fa-list fa-fw"></i>
</div>
<div class="hidden">
<dl class="details">
{% for key, value in action.ACTIONS %}
<dt>{{ aps_display(value, false) }}</dt>
<dd>{{ lang(key, aps_name()) }}</dd>
{% endfor %}
</dl>
</div>
{% endif %}
</div>
{% endif %}
<div class="aps-row aps-col s12 l3 aps-no-mar-bot">
<div class="aps-col s4 aps-no-mar-bot">
{{ aps_display(action.POINTS_OLD, false) }}
</div>
<div class="aps-col s4 aps-no-mar-bot">
{{ aps_display(action.POINTS_SUM, false) }}
</div>
<div class="aps-col s4 aps-no-mar-bot">
{{ aps_display(action.POINTS_NEW, false) }}
</div>
</div>
<div class="aps-col s6 l2 aps-no-mar-bot aps-hide-s">
{{ user.format_date(action.TIME) }}
{% if not action.S_SELF %}
{{ lang('POST_BY_AUTHOR') }}
{% if action.S_MOD and not action.S_AUTH_MOD %}
{{ lang('MODERATOR') }}
{% else %}
{{ action.REPORTEE }}
{% endif %}
{% endif %}
</div>
<div class="aps-col s6 l2 aps-no-mar-bot aps-ellipsis aps-hide-s">
{% if action.FORUM_NAME or action.TOPIC_TITLE or action.POST_SUBJECT %}
<ul class="fa-ul aps-no-mar">
{% if action.FORUM_NAME %}
<li><a href="{{ action.U_FORUM }}" title="{{ action.FORUM_NAME }}">{{ action.FORUM_NAME }}</a></li>
{% endif %}
{% if action.TOPIC_TITLE %}
<li><a href="{{ action.U_TOPIC }}" title="{{ action.TOPIC_TITLE }}">{{ action.TOPIC_TITLE }}</a></li>
{% endif %}
{% if action.POST_SUBJECT %}
<li><a href="{{ action.U_POST }}" title="{{ action.POST_SUBJECT }}">{{ action.POST_SUBJECT }}</a></li>
{% endif %}
</ul>
{% else %}
<div class="aps-center">{{ lang('NA') }}</div>
{% endif %}
</div>
</div>
</div>
{% endfor %}
</div>
{% else %}
<div class="error">{{ lang('APS_POINTS_ACTIONS_NONE', aps_name()) }}</div>
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,18 @@
{% block width %}s12 m6 aps-js{% endblock %}
{% block content %}
<canvas data-aps-chart="pie"
data-aps-time="{{ aps_config('aps_display_graph_time') }}"
data-aps-empty="{{ lang('APS_POINTS_DATA_EMPTY', aps_name()) }}"
aria-label="{{ lang('APS_POINTS_PER_FORUM', aps_name()) }}"
role="img">
<p>{{ lang('APS_POINTS_PER_FORUM', aps_name()) }}</p>
</canvas>
<div class="hidden">
{% for forum in aps_forums %}
<div data-aps-labels="{{ forum.NAME|e }}"
data-aps-value="{{ aps_format(forum.POINTS) }}">
</div>
{% endfor %}
</div>
{% endblock %}

View File

@@ -0,0 +1,16 @@
{% block width %}s12 m6 aps-js{% endblock %}
{% block content %}
<canvas data-aps-chart="polarArea"
data-aps-time="{{ aps_config('aps_display_graph_time') }}"
data-aps-empty="{{ lang('APS_POINTS_DATA_EMPTY', aps_name()) }}"
aria-label="{{ lang('APS_POINTS_PER_GROUP', aps_name()) }}"
role="img">
<p>{{ lang('APS_POINTS_PER_GROUP', aps_name()) }}</p>
</canvas>
<div class="hidden">
{% for group in aps_groups %}
<div data-aps-labels="{{ group.NAME|e }}" data-aps-colour="#{{ group.COLOUR }}" data-aps-value="{{ aps_format(group.POINTS) }}"></div>
{% endfor %}
</div>
{% endblock %}

View File

@@ -0,0 +1,22 @@
{% block width %}s12 m6 aps-js{% endblock %}
{% block content %}
<canvas data-aps-chart="line"
data-aps-time="{{ aps_config('aps_display_graph_time') }}"
data-aps-empty="{{ lang('APS_POINTS_DATA_EMPTY', aps_name()) }}"
aria-label="{{ lang('APS_POINTS_GROWTH', aps_name()) }}"
role="img">
<p>{{ lang('APS_POINTS_GROWTH', aps_name()) }}</p>
</canvas>
<div class="hidden">
{% for growth in aps_period %}
<div data-aps-labels="{{ growth.DATE|e }}"
data-aps-label="{{ aps_name()|e }}"
data-aps-colour="transparent"
data-aps-colour-border="#12a3eb"
data-aps-colour-point="#0076b1"
data-aps-value="{{ aps_format(growth.TOTAL) }}">
</div>
{% endfor %}
</div>
{% endblock %}

View File

@@ -0,0 +1,13 @@
{% block width %}s12 m6{% endblock %}
{% block content %}
<div class="aps-row">
<div class="aps-col s6 aps-center">
{{ APS_RANDOM_USER_AVATAR ? APS_RANDOM_USER_AVATAR : (S_APS_DAE_ENABLED ? '' : APS_RANDOM_NO_AVATAR) }}
</div>
<div class="aps-col s6">
{{ APS_RANDOM_USER_FULL }}<br />
{{ aps_display(APS_RANDOM_USER_POINTS) }}
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,29 @@
{% block width %}s12 m6{% endblock %}
{% block content %}
<div class="aps-row">
<div class="aps-col s6 aps-center">
{{ APS_SEARCH_USER_AVATAR ? APS_SEARCH_USER_AVATAR : (S_APS_DAE_ENABLED ? '' : APS_NO_AVATAR) }}
</div>
<div class="aps-col s6">
{{ APS_SEARCH_USER_FULL }}<br />
{{ aps_display(APS_SEARCH_USER_POINTS) }}<br />
{% set podium = APS_SEARCH_USER_RANK in 1..3 ? APS_SEARCH_USER_RANK : 0 %}
<span title="{{ lang('RANK') }}"><i class="icon fa-trophy fa-fw aps-podium-{{ podium }}" aria-hidden="true"></i> {{ APS_SEARCH_USER_RANK }}</span>
{% if S_APS_USER_ADJUST and U_APS_SEARCH_USER_ADJUST %}
<br />
<a class="aps-secondary-content" href="{{ U_APS_SEARCH_USER_ADJUST }}" title="{{ lang('APS_ADJUST_USER_POINTS', aps_name()) }}">
<i class="icon fa-pencil fa-fw"></i>
</a>
{% endif %}
</div>
</div>
{% endblock %}
{% block footer %}
<form class="aps-form" method="post" action="{{ U_APS_ACTION_SEARCH }}" data-ajax="aps_replace">
<label for="aps_user_search">{{ lang('FIND_USERNAME') ~ lang('COLON') }}</label>
<input id="aps_user_search" name="aps_user_search" type="text" value="{{ APS_SEARCH_USERNAME }}" />
<input name="submit" type="submit" value="{{ lang('SEARCH') }}" />
</form>
{% endblock %}

View File

@@ -0,0 +1,18 @@
{% block width %}s12 m6{% endblock %}
{% block content %}
{% set min = aps_config('aps_points_min') %}
{% set max = aps_config('aps_points_max') %}
{% set def = aps_config('default_lang') %}
{% set name = aps_config('aps_points_name_' ~ def) %}
{% set name = user.lang_name != def and name != aps_name() ? name : '' %}
<dl class="details">
<dt>{{ lang('APS_POINTS_NAME') ~ lang('COLON') }}</dt><dd>{{ aps_name() }}{% if name %} <em>({{ name }})</em>{% endif %}</dd>
<dt>{{ lang('APS_POINTS_FORMAT', aps_name()) ~ lang('COLON') }}</dt><dd>{{ aps_display(12345.00) }}</dd>
<dt>{{ lang('APS_POINTS_MIN', aps_name()) ~ lang('COLON') }}</dt><dd>{{ min ? min : lang('NA') }}</dd>
<dt>{{ lang('APS_POINTS_MAX', aps_name()) ~ lang('COLON') }}</dt><dd>{{ max ? max : lang('NA') }}</dd>
<dt>{{ lang('APS_POINTS_ACTIONS_PAGE') ~ lang('COLON') }}</dt><dd>{{ aps_config('aps_actions_per_page') }}</dd>
{% EVENT phpbbstudio_aps_display_settings_append %}
</dl>
{% endblock %}

View File

@@ -0,0 +1,36 @@
{% block width %}s12 m6{% endblock %}
{% block content %}
<div class="aps-collection">
{% set last_place = 0 %}
{% set last_points = 0 %}
{% for user in top_users %}
{% set same_points = last_points == user.POINTS %}
{% set last_place = same_points ? last_place : loop.index %}
{% set last_points = same_points ? last_points : user.POINTS %}
<div class="aps-collection-item aps-avatar">
{{ user.AVATAR ? user.AVATAR : (S_APS_DAE_ENABLED ? '' : APS_NO_AVATAR) }}
<span class="title">{{ user.NAME }}</span>
<p>{{ aps_display(user.POINTS) }}</p>
{% if S_APS_USER_ADJUST %}
<a class="aps-secondary-content" href="{{ user.U_ADJUST }}" title="{{ lang('APS_ADJUST_USER_POINTS', aps_name()) }}">
<i class="icon fa-pencil fa-fw"></i>
</a>
{% elseif last_place < 4 %}
<i class="aps-secondary-content icon fa-trophy fa-fw aps-podium-{{ last_place }}" aria-hidden="true"></i>
{% else %}
<span class="aps-secondary-content fa-fw">{{ last_place }}</span>
{% endif %}
</div>
{% endfor %}
</div>
{% endblock %}
{% block footer %}
<form class="aps-form" method="post" action="{{ U_APS_ACTION_TOP }}" data-ajax="aps_replace">
<label for="aps_user_top_count">{{ lang('USERS') ~ lang('COLON') }}</label>
<input id="aps_user_top_count" name="aps_user_top_count" type="number" min="{{ aps_config('aps_display_top_count') }}" max="50" value="{{ APS_TOP_USERS_COUNT }}"{% if not aps_config('aps_display_top_change') %} disabled{% endif %} />
{% if aps_config('aps_display_top_change') %}<input name="submit" type="submit" value="{{ lang('GO') }}" />{% endif %}
</form>
{% endblock %}

View File

@@ -0,0 +1,28 @@
{% block width %}s12 m6 aps-js{% endblock %}
{% block content %}
<canvas data-aps-chart="bar"
data-aps-time="{{ aps_config('aps_display_graph_time') }}"
data-aps-empty="{{ lang('APS_POINTS_DATA_EMPTY', aps_name()) }}"
aria-label="{{ lang('APS_POINTS_TRADE_OFF', aps_name()) }}"
role="img">
<p>{{ lang('APS_POINTS_TRADE_OFF', aps_name()) }}</p>
</canvas>
<div class="hidden">
{% for trade in aps_period %}
<div data-aps-labels="{{ trade.DATE|e }}"
data-aps-label="{{ lang('APS_POINTS_LOST', aps_name())|e }}"
data-aps-colour="#d31141"
data-aps-value="{{ aps_format(trade.NEGATIVE) }}">
</div>
{% endfor %}
</div>
<div class="hidden">
{% for trade in aps_period %}
<div data-aps-label="{{ lang('APS_POINTS_GAINED', aps_name())|e }}"
data-aps-colour="#28a745"
data-aps-value="{{ aps_format(trade.POSITIVE) }}">
</div>
{% endfor %}
</div>
{% endblock %}