follows.html 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. {% extends "sora/profiles/profile.html" %}
  2. {% load i18n %}
  3. {% load humanize %}
  4. {% load url from future %}
  5. {% import "_forms.html" as form_theme with context %}
  6. {% import "sora/macros.html" as macros with context %}
  7. {% block title %}{{ macros.page_title(_('Follows'), profile.username) }}{% endblock %}
  8. {% block tab %}
  9. <h2>{% trans username=profile.username %}Who {{ username }} Follows{% endtrans %} <small>{% if items_total -%}
  10. {% trans count=items_total, total=items_total|intcomma, username=profile.username -%}
  11. {{ username }} follows one member
  12. {%- pluralize -%}
  13. {{ username }} follows {{ total }} members
  14. {%- endtrans %}
  15. {%- else -%}
  16. {% trans username=profile.username %}{{ username }} follows nobody{% endtrans %}
  17. {%- endif %}</small></h2>
  18. {% if items_total %}
  19. <div class="list-nav">
  20. {{ pager() }}
  21. </div>
  22. <table class="table table-striped table-users">
  23. <thead>
  24. <tr>
  25. <th colspan="4">{% trans count=items_total, total=items_total|intcomma, username=profile.username -%}
  26. {{ username }} follows one member
  27. {%- pluralize -%}
  28. {{ username }} follows {{ total }} members
  29. {%- endtrans %}</th>
  30. </tr>
  31. </thead>
  32. <tbody>
  33. {% for row in items|batch(4, '') %}
  34. <tr>
  35. {% for user in row %}
  36. <td class="span3">
  37. {% if user %}
  38. <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>
  39. {% else %}
  40. &nbsp;
  41. {% endif %}
  42. </td>
  43. {% endfor %}
  44. </tr>
  45. {% endfor %}
  46. </tbody>
  47. </table>
  48. <div class="list-nav">
  49. {{ pager() }}
  50. </div>
  51. {% else %}
  52. <p class="lead">{% trans username=profile.username %}{{ username }} follows nobody{% endtrans %}</p>
  53. {% endif %}
  54. {% endblock %}
  55. {% macro pager() -%}
  56. <ul class="pager pull-left">
  57. {%- if pagination['prev'] > 0 %}<li><a href="{%- if pagination['prev'] > 1 %}{% url 'user_follows' user=profile.id, username=profile.username_slug, page=pagination['prev'] %}{% else %}{% url 'user_follows' user=profile.id, username=profile.username_slug %}{% endif %}" class="tooltip-top" title="{% trans %}Previous Page{% endtrans %}"><i class="icon-chevron-left"></i></a></li>{% endif -%}
  58. {%- if pagination['next'] > 0 %}<li><a href="{% url 'user_follows' user=profile.id, username=profile.username_slug, page=pagination['next'] %}" class="tooltip-top" title="{% trans %}Next Page{% endtrans %}"><i class="icon-chevron-right"></i></a></li>{% endif -%}
  59. <li class="count">
  60. {%- trans current_page=pagination['page'], pages=pagination['total'] -%}
  61. Page {{ current_page }} of {{ pages }}
  62. {%- endtrans -%}
  63. </li>
  64. </ul>
  65. {%- endmacro %}