123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- {% extends "cranefly/layout.html" %}
- {% load i18n %}
- {% load url from future %}
- {% import "_forms.html" as form_theme with context %}
- {% import "cranefly/macros.html" as macros with context %}
- {% block title %}{% if in_search -%}
- {{ macros.page_title(title=_('Search Users'), parent=_('Users List')) }}
- {% elif active_rank %}
- {{ macros.page_title(title=_(active_rank.name), parent=_('Users List')) }}
- {%- else -%}
- {{ macros.page_title(title=_('Users List')) }}
- {%- endif %}{% endblock %}
- {% block container %}
- <div class="page-header header-primary">
- <div class="container">
- {{ messages_list(messages) }}
- <h1>{% trans %}Users List{% endtrans %} <small>{% trans %}Browse notable user groups or find specific user{% endtrans %}</small></h1>
- <ul class="nav nav-tabs header-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="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-icon"><i class="icon-search"></i></button>
- </form>
- </li>
- {% endif %}
- </ul>
- </div>
- </div>
- <div class="container container-primary">
- <div class="profiles-list">
- <h2>{% if in_search %}{% trans %}Search Users{% endtrans %}{% elif active_rank %}{{ _(active_rank.name) }}{% endif %}</h2>
- {% if message %}
- <div class="messages-list">
- {{ macros.draw_message(message, 'alert-form') }}
- </div>
- {% endif %}
- {% if in_search and not message and users|length > 0 %}
- <p class="lead">{% 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 %}
- <div class="markdown">{{ active_rank.description|markdown|safe }}</div>
- {% endif %}
- {% if users|length > 0 %}
- <table class="table table-striped">
- <thead>
- <tr>
- <th colspan="4">{% if in_search %}{% trans %}Found Users{% endtrans %}{% else %}{% trans %}Users in this group{% endtrans %}{% endif %}</th>
- </tr>
- </thead>
- <tbody>
- {% for row in users|batch(4, '') %}
- <tr>
- {% for user in row %}
- <td class="span3 user-cell{% if user and user.get_style() %} user-cell-{{ user.get_style() }}{% endif %}">
- {% 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>
- <span class="user-info">{% if user.title or (in_search and user.get_title()) %}<strong>{% if in_search %}{{ _(user.get_title()) }}{% else %}{{ _(user.title) }}{% endif %}</strong>, {% endif %}{% trans join=user.join_date|reldate %}Member since {{ join }}{% endtrans %}</span>
- </p>
- {% else %}
-
- {% endif %}
- </td>
- {% endfor %}
- </tr>
- {% endfor %}
- </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 this group has no members...{% endtrans %}
- {%- endif -%}
- </p>
- {% endif %}
- </div>
- </div>
- {% 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 %}
- </ul>
- </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 %}
- {% 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 %}
- {% endblock %}
|