follows.html 2.3 KB

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