|
@@ -64,11 +64,8 @@
|
|
{% for user in row %}
|
|
{% for user in row %}
|
|
<td class="span3 user-cell{% if user and user.get_style() %} user-cell-{{ user.get_style() }}{% endif %}">
|
|
<td class="span3 user-cell{% if user and user.get_style() %} user-cell-{{ user.get_style() }}{% endif %}">
|
|
{% if user %}
|
|
{% if user %}
|
|
- <a href="{% url 'user' username=user.username_slug, user=user.pk %}" class="user-avatar"><img src="{{ user.get_avatar(42) }}" alt=""></a>
|
|
|
|
- <p class="user-details">
|
|
|
|
- <a href="{% url 'user' username=user.username_slug, user=user.pk %}">{{ user.username }}</a>
|
|
|
|
- {% if user.title or (in_search and user.get_title()) %}<span class="user-info">{% if in_search and user.get_title() %}{{ _(user.get_title()) }}{% else %}{{ _(user.title) }}{% endif %}</span>{% endif %}
|
|
|
|
- </p>
|
|
|
|
|
|
+ <a href="{% url 'user' username=user.username_slug, user=user.pk %}" class="user-avatar"><img src="{{ user.get_avatar(36) }}" alt=""></a>
|
|
|
|
+ <a href="{% url 'user' username=user.username_slug, user=user.pk %}" class="user-name">{{ user.username }}</a>
|
|
{% else %}
|
|
{% else %}
|
|
|
|
|
|
{% endif %}
|
|
{% endif %}
|
|
@@ -78,6 +75,7 @@
|
|
{% endfor %}
|
|
{% endfor %}
|
|
</tbody>
|
|
</tbody>
|
|
</table>
|
|
</table>
|
|
|
|
+ {{ pager() }}
|
|
{% elif not message %}
|
|
{% elif not message %}
|
|
<p class="lead">
|
|
<p class="lead">
|
|
{%- if in_search -%}
|
|
{%- if in_search -%}
|
|
@@ -92,59 +90,24 @@
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
{% endblock %}
|
|
|
|
|
|
-{% block content %}
|
|
|
|
-<div class="page-header header-tabbed">
|
|
|
|
- <h1>{% trans %}Users List{% endtrans %} <small>{% trans %}Browse notable user groups or find specific user{% endtrans %}</small></h1>
|
|
|
|
- <ul class="nav nav-tabs">{% for rank in ranks %}
|
|
|
|
- <li{% if active_rank.id == rank.id %} class="active"{% endif %}><a href="{% if loop.first %}{% url 'users' %}{% else %}{% url 'users' rank_slug=rank.name_slug %}{% endif %}">{{ _(rank.name) }}</a></li>{% endfor %}
|
|
|
|
- {% if acl.users.can_search_users() and not user.is_crawler() %}
|
|
|
|
- <li class="tab-search{% if not ranks %} tab-search-no-tabs{% endif %} pull-right">
|
|
|
|
- <form action="{% url 'users' %}" class="form-inline" method="post">
|
|
|
|
- <input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}">
|
|
|
|
- {{ form_theme.field_widget(search_form.username, width=2, attrs={'placeholder': _('Find user...')}) }}
|
|
|
|
- <button type="submit" class="btn btn-primary"><i class="icon-search icon-white"></i></button>
|
|
|
|
- </form>
|
|
|
|
- </li>
|
|
|
|
- {% endif %}
|
|
|
|
|
|
+{% macro pager() -%}
|
|
|
|
+{% if pagination['total'] > 1 %}
|
|
|
|
+{% if default_rank %}
|
|
|
|
+<div class="pagination">
|
|
|
|
+ <ul>
|
|
|
|
+ <li class="count">{{ macros.pager_label(pagination) }}</li>
|
|
|
|
+ {%- if pagination['prev'] > 0 %}<li><a href="{%- if pagination['prev'] > 1 %}{% url 'users' page=pagination['prev'] %}{% else %}{% url 'users' %}{% endif %}" class="tooltip-top" title="{% trans %}Previous Page{% endtrans %}"><i class="icon-chevron-left"></i></a></li>{% endif -%}
|
|
|
|
+ {%- if pagination['next'] > 0 %}<li><a href="{% url 'users' page=pagination['next'] %}" class="tooltip-top" title="{% trans %}Next Page{% endtrans %}"><i class="icon-chevron-right"></i></a></li>{% endif -%}
|
|
|
|
+ </ul>
|
|
|
|
+</div>
|
|
|
|
+{% else %}
|
|
|
|
+<div class="pagination">
|
|
|
|
+ <ul>
|
|
|
|
+ <li class="count">{{ macros.pager_label(pagination) }}</li>
|
|
|
|
+ {%- if pagination['prev'] > 0 %}<li><a href="{%- if pagination['prev'] > 1 %}{% url 'users' rank_slug=active_rank.rank_slug, page=pagination['prev'] %}{% else %}{% url 'users' rank_slug=active_rank.rank_slug %}{% endif %}" class="tooltip-top" title="{% trans %}Previous Page{% endtrans %}"><i class="icon-chevron-left"></i></a></li>{% endif -%}
|
|
|
|
+ {%- if pagination['next'] > 0 %}<li><a href="{% url 'users' rank_slug=active_rank.rank_slug, page=pagination['next'] %}" class="tooltip-top" title="{% trans %}Next Page{% endtrans %}"><i class="icon-chevron-right"></i></a></li>{% endif -%}
|
|
</ul>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
-<h2>{% if in_search %}{% trans %}Search Users{% endtrans %}{% elif active_rank %}{{ _(active_rank.name) }}{% endif %}</h2>
|
|
|
|
-{% if message %}{{ macros.draw_message(message, 'alert-form') }}{% endif %}
|
|
|
|
-
|
|
|
|
-{% if in_search and not message and users|length > 0 %}
|
|
|
|
-<p>{% trans %}We couldn't find a member with name you entered, so we present you with some other members with names similiar to one you searched for in hopes that one of them will turn out to be member you are looking for.{% endtrans %}</p>
|
|
|
|
-{% elif active_rank and active_rank.description %}
|
|
|
|
-{{ active_rank.description|markdown|safe }}
|
|
|
|
{% endif %}
|
|
{% endif %}
|
|
-
|
|
|
|
-{% if users|length > 0 %}
|
|
|
|
-<table class="table table-striped table-users">
|
|
|
|
- <thead>
|
|
|
|
- <tr>
|
|
|
|
- <th colspan="2">{% if in_search %}{% trans %}Found Users{% endtrans %}{% else %}{% trans %}Users in this group{% endtrans %}{% endif %}</th>
|
|
|
|
- </tr>
|
|
|
|
- </thead>
|
|
|
|
- <tbody>
|
|
|
|
- <tr>{% for user in users %}
|
|
|
|
- <td class="span6{% if user.get_style() %} {{ user.get_style() }}{% endif %}">
|
|
|
|
- <a href="{% url 'user' username=user.username_slug, user=user.pk %}"><img src="{{ user.get_avatar(42) }}" class="avatar" alt=""> <strong>{{ user.username }}</strong>{% if user.title or (in_search and user.get_title()) %} <span class="muted">{% if in_search%}{{ _(user.get_title()) }}{% else %}{{ _(user.title) }}{% endif %}</span>{% endif %}</a>
|
|
|
|
- </td>{% if loop.last and loop.index is odd %}
|
|
|
|
- <td class="span6">
|
|
|
|
-
|
|
|
|
- </td>
|
|
|
|
- {% endif %}{% if not loop.last and loop.index is even %}
|
|
|
|
- </tr>
|
|
|
|
- <tr>{% endif %}
|
|
|
|
- {% endfor %}</tr>
|
|
|
|
- </tbody>
|
|
|
|
-</table>
|
|
|
|
-{% elif not message %}
|
|
|
|
-<p class="lead">
|
|
|
|
- {%- if in_search -%}
|
|
|
|
- {% trans %}We couldn't find any members with specified name.{% endtrans %}
|
|
|
|
- {%- else -%}
|
|
|
|
- {% trans %}Looks like there is nobody there.{% endtrans %}
|
|
|
|
- {%- endif -%}
|
|
|
|
-</p>
|
|
|
|
{% endif %}
|
|
{% endif %}
|
|
-{% endblock %}
|
|
|
|
|
|
+{%- endmacro %}
|