followers.html 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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(42) }}" alt=""></a>
  33. <p class="user-details">
  34. <a href="{% url 'user' username=user.username_slug, user=user.pk %}">{{ user.username }}</a>
  35. <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>
  36. </p>
  37. {% else %}
  38. &nbsp;
  39. {% endif %}
  40. </td>
  41. {% endfor %}
  42. </tr>
  43. {% endfor %}
  44. </tbody>
  45. </table>
  46. {{ pager() }}
  47. </div>
  48. {% endif %}
  49. {% endblock %}
  50. {% macro pager() -%}
  51. {% if pagination['total'] > 1 %}
  52. <div class="pagination">
  53. <ul>
  54. <li class="count">{{ macros.pager_label(pagination) }}</li>
  55. {%- 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 -%}
  56. {%- 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 -%}
  57. </ul>
  58. </div>
  59. {% endif %}
  60. {%- endmacro %}