PHRAS-913 - fix counter display in users lists

This commit is contained in:
Florian BLOUET
2016-01-20 11:46:38 +01:00
parent e884bcff93
commit 37c674b5eb
3 changed files with 5 additions and 6 deletions

View File

@@ -86,8 +86,8 @@
</table> </table>
</div> </div>
<div class="PNB" style="top:auto;height:20px;text-align:right;line-height:20px;"> <div class="PNB" style="top:auto;height:20px;text-align:right;line-height:20px;">
{% set length = '<span class="counter current">' ~ list.getEntries().count() ~ '</span>' %} {% set length = list.getEntries().count() %}
{% trans with {'%length%' : length} %}%length% peoples{% endtrans %} <span class="counter current">{% trans with {'%length%' : length} %}%length% peoples{% endtrans %}</span>
{% if query.get_page() > 1 %} {% if query.get_page() > 1 %}
<a class="prev" value="{{ query.get_page() - 1 }}" href="#">< {{ 'Previous' | trans }}</a> <a class="prev" value="{{ query.get_page() - 1 }}" href="#">< {{ 'Previous' | trans }}</a>
{% endif %} {% endif %}

View File

@@ -37,8 +37,8 @@
<div class="PNB10"> <div class="PNB10">
<div class="PNB" style="height:25px; bottom:auto;"> <div class="PNB" style="height:25px; bottom:auto;">
<p> <p>
{% set length = '<span class="counter current">' ~ list.getEntries().count() ~ '</span>' %} {% set length = ist.getEntries().count() %}
{% trans with {'%length%' : length} %}%length% peoples{% endtrans %} <span class="counter current">{% trans with {'%length%' : length} %}%length% peoples{% endtrans %}</span>
{% if list.getOwner(app.getAuthenticatedUser()).getRole() >= constant('Alchemy\\Phrasea\\Model\\Entities\\UsrListOwner::ROLE_EDITOR') %} {% if list.getOwner(app.getAuthenticatedUser()).getRole() >= constant('Alchemy\\Phrasea\\Model\\Entities\\UsrListOwner::ROLE_EDITOR') %}
<button class="EditToggle btn btn-inverse">{{ 'Edit' | trans }}</button> <button class="EditToggle btn btn-inverse">{{ 'Edit' | trans }}</button>
{% endif %} {% endif %}

View File

@@ -11,7 +11,6 @@
</span> </span>
<ul class="lists"> <ul class="lists">
{% for list in lists %} {% for list in lists %}
{% set length = '<span class="counter">' ~ list.getEntries().count() ~ '</span>' %}
<li class="list" style="padding:2px;"> <li class="list" style="padding:2px;">
<a href="{{ path('prod_push_list_edit', { 'list_id' : list.getId() }) }}" class="list_link"> <a href="{{ path('prod_push_list_edit', { 'list_id' : list.getId() }) }}" class="list_link">
{% if list.getOwner(app.getAuthenticatedUser()).getRole() >= constant('Alchemy\\Phrasea\\Model\\Entities\\UsrListOwner::ROLE_EDITOR') %} {% if list.getOwner(app.getAuthenticatedUser()).getRole() >= constant('Alchemy\\Phrasea\\Model\\Entities\\UsrListOwner::ROLE_EDITOR') %}
@@ -20,7 +19,7 @@
<img src="/assets/common/images/icons/SHARE16.png" /> <img src="/assets/common/images/icons/SHARE16.png" />
{% endif %} {% endif %}
{{ list.getName() }} {{ list.getName() }}
({{ length }}) <span class="counter">({{ list.getEntries().count() }})</span>
</a> </a>
</li> </li>
{% endfor %} {% endfor %}