list.html 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. {% extends "sora/layout.html" %}
  2. {% load i18n %}
  3. {% load url from future %}
  4. {% import "_forms.html" as form_theme with context %}
  5. {% import "sora/macros.html" as macros with context %}
  6. {% block title %}{% if in_search -%}
  7. {{ macros.page_title(title=_('Search Users'), parent=_('Users List')) }}
  8. {% elif active_rank %}
  9. {{ macros.page_title(title=_(active_rank.name), parent=_('Users List')) }}
  10. {%- else -%}
  11. {{ macros.page_title(title=_('Users List')) }}
  12. {%- endif %}{% endblock %}
  13. {% block content %}
  14. <div class="page-header header-tabbed">
  15. <h1>{% trans %}Users List{% endtrans %} <small>{% trans %}Browse notable user groups or find specific user{% endtrans %}</small></h1>
  16. <ul class="nav nav-tabs">{% for rank in ranks %}
  17. <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 %}
  18. <li class="tab-search{% if not ranks %} tab-search-no-tabs{% endif %} pull-right">
  19. <form action="{% url 'users' %}" class="form-inline" method="post">
  20. <input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}">
  21. {{ form_theme.field_widget(search_form.username, width=2, attrs={'placeholder': _('Find user...')}) }}
  22. <button type="submit" class="btn btn-primary"><i class="icon-search icon-white"></i></button>
  23. </form>
  24. </li>
  25. </ul>
  26. </div>
  27. <h2>{% if in_search %}{% trans %}Search Users{% endtrans %}{% elif active_rank %}{{ _(active_rank.name) }}{% endif %}</h2>
  28. {% if message %}{{ macros.draw_message(message, 'alert-form') }}{% endif %}
  29. {% if in_search and not message and users|length > 0 %}
  30. <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>
  31. {% elif active_rank and active_rank.description %}
  32. {{ active_rank.description|markdown|safe }}
  33. {% endif %}
  34. {% if users|length > 0 %}
  35. <table class="table table-striped table-users">
  36. <thead>
  37. <tr>
  38. <th{% if users|length > 1 %} colspan="2"{% endif %}>{% if in_search %}{% trans %}Found Users{% endtrans %}{% else %}{% trans %}Users in this group{% endtrans %}{% endif %}</th>
  39. </tr>
  40. </thead>
  41. <tbody>
  42. <tr>{% for user in users %}
  43. <td{% if users|length > 1 %} {% if loop.last and loop.index is odd %}colspan="2"{% else %}class="span6"{% endif %}{% endif %}>
  44. <a href="{% url 'user' username=user.username_slug, user=user.pk %}"><img src="{{ user.get_avatar('medium') }}" class="avatar" alt="{% trans %}Member's Avatar{% endtrans %}" title="{% trans %}Member's Avatar{% endtrans %}"> <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>
  45. </td>{% if not loop.last and loop.index is even %}
  46. </tr>
  47. <tr>{% endif %}
  48. {% endfor %}</tr>
  49. </tbody>
  50. </table>
  51. {% elif not message %}
  52. <p class="lead">
  53. {%- if in_search -%}
  54. {% trans %}We couldn't find any members with specified name.{% endtrans %}
  55. {%- else -%}
  56. {% trans %}Looks like there is nobody there.{% endtrans %}
  57. {%- endif -%}
  58. </p>
  59. {% endif %}
  60. {% endblock %}