follows.html 2.4 KB

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