followers.html 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. {% extends "cranefly/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 "cranefly/macros.html" as macros with context %}
  7. {% block title %}{{ macros.page_title(_('Followers'), profile.username) }}{% endblock %}
  8. {% block tab %}
  9. <h2>{% if items_total %}
  10. {%- trans count=items_total, total=items_total|intcomma, username=profile.username -%}
  11. {{ username }} is followed by one member
  12. {%- pluralize -%}
  13. {{ username }} is followed by {{ total }} members
  14. {%- endtrans -%}
  15. {%- else -%}
  16. {% trans username=profile.username %}{{ username }} has no followers{% endtrans %}
  17. {%- endif %}</h2>
  18. {% if items_total %}
  19. <div class="user-list user-followers">
  20. <table class="table table-striped">
  21. <thead>
  22. <tr>
  23. <th colspan="4">{% trans username=profile.username %}Users that are following {{ username }}{% endtrans %}</th>
  24. </tr>
  25. </thead>
  26. <tbody>
  27. {% for row in items|batch(4, '') %}
  28. <tr>
  29. {% for user in row %}
  30. <td class="span3 user-cell">
  31. {% if user %}
  32. <a href="{% url 'user' username=user.username_slug, user=user.pk %}" class="user-avatar"><img src="{{ user.get_avatar(36) }}" alt=""></a>
  33. <a href="{% url 'user' username=user.username_slug, user=user.pk %}" class="user-name">{{ user.username }}</a>
  34. {% else %}
  35. &nbsp;
  36. {% endif %}
  37. </td>
  38. {% endfor %}
  39. </tr>
  40. {% endfor %}
  41. </tbody>
  42. </table>
  43. {{ pager() }}
  44. </div>
  45. {% endif %}
  46. {% endblock %}
  47. {% macro pager() -%}
  48. {% if pagination['total'] > 1 %}
  49. <div class="pagination">
  50. <ul>
  51. <li class="count">{{ macros.pager_label(pagination) }}</li>
  52. {%- if pagination['prev'] > 0 %}<li><a href="{%- if pagination['prev'] > 1 %}{% url 'user_followers' user=profile.id, username=profile.username_slug, page=pagination['prev'] %}{% else %}{% url 'user_followers' 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 -%}
  53. {%- if pagination['next'] > 0 %}<li><a href="{% url 'user_followers' 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 -%}
  54. </ul>
  55. </div>
  56. {% endif %}
  57. {%- endmacro %}