karmas.html 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. {% extends "cranefly/layout.html" %}
  2. {% load i18n %}
  3. {% load url from future %}
  4. {% import "cranefly/macros.html" as macros with context %}
  5. {% block title %}{{ macros.page_title(title=(_("Post #%(post)s Votes") % {'post': post.pk}),parent=thread.name) }}{% endblock %}
  6. {% block breadcrumb %}{{ super() }} <span class="divider"><i class="icon-chevron-right"></i></span></li>
  7. {% for parent in parents %}
  8. <li><a href="{{ parent.type|url(forum=parent.pk, slug=parent.slug) }}">{{ parent.name }}</a> <span class="divider"><i class="icon-chevron-right"></i></span></li>
  9. {% endfor %}
  10. <li><a href="{% url 'thread' thread=thread.pk, slug=thread.slug %}">{{ thread.name }}</a> <span class="divider"><i class="icon-chevron-right"></i></span></li>
  11. <li class="active">{% trans post=post.pk %}Post #{{ post }} Votes{% endtrans %}
  12. {%- endblock %}
  13. {% block container %}
  14. <div class="page-header header-primary">
  15. <div class="container">
  16. {{ messages_list(messages) }}
  17. <ul class="breadcrumb">
  18. {{ self.breadcrumb() }}</li>
  19. </ul>
  20. <h1>{% trans post=post.pk %}Post #{{ post }} Votes{% endtrans %} <small>{{ thread.name }}</small></h1>
  21. <ul class="unstyled header-stats">
  22. <li><i class="icon-time"></i> <a href="{% url 'thread_find' thread=thread.pk, slug=thread.slug, post=post.pk %}">{{ post.date|reltimesince }}</a></li>
  23. <li><i class="icon-user"></i> {% if post.user %}<a href="{% url 'user' user=post.user.pk, username=post.user.username_slug %}">{{ post.user.username }}</a>{% else %}{{ post.user_name }}{% endif %}</li>
  24. <li><i class="icon-thumbs-up"></i> {{ post.upvotes }}</li>
  25. <li><i class="icon-thumbs-down"></i> {{ post.downvotes }}</li>
  26. </ul>
  27. </div>
  28. </div>
  29. <div class="container container-primary">
  30. <div class="post-votes-list">
  31. <div class="post-likes">
  32. <h2>{% trans count=upvotes|length, votes=upvotes|length|intcomma -%}
  33. One like
  34. {%- pluralize -%}
  35. {{ votes }} likes
  36. {%- endtrans %}</h2>
  37. {% if upvotes %}
  38. <table class="table table-striped">
  39. <tbody>
  40. {% for row in upvotes|batch(4, '') %}
  41. <tr>
  42. {% for vote in row %}
  43. <td class="span3">
  44. {% if vote %}
  45. {{ vote_details(vote, 'thumbs-up') }}
  46. {% else %}
  47. &nbsp;
  48. {% endif %}
  49. </td>
  50. {% endfor %}
  51. </tr>
  52. {% endfor %}
  53. </tbody>
  54. </table>
  55. {% else %}
  56. <p class="lead">{% trans %}Nobody liked this post.{% endtrans %}</p>
  57. {% endif %}
  58. </div>
  59. <hr>
  60. <div class="post-hates">
  61. <h2>{% trans count=downvotes|length, votes=downvotes|length|intcomma -%}
  62. One hate
  63. {%- pluralize -%}
  64. {{ votes }} hates
  65. {%- endtrans %}</h2>
  66. {% if downvotes %}
  67. <table class="table table-striped">
  68. <tbody>
  69. {% for row in downvotes|batch(4, '') %}
  70. <tr>
  71. {% for vote in row %}
  72. <td class="span3">
  73. {% if vote %}
  74. {{ vote_details(vote, 'thumbs-down') }}
  75. {% else %}
  76. &nbsp;
  77. {% endif %}
  78. </td>
  79. {% endfor %}
  80. </tr>
  81. {% endfor %}
  82. </tbody>
  83. </table>
  84. {% else %}
  85. <p class="lead">{% trans %}Nobody hated this post.{% endtrans %}</p>
  86. {% endif %}
  87. </div>
  88. </div>
  89. </div>
  90. {% endblock %}
  91. {% macro vote_details(vote, icon) %}
  92. {% if vote.user_id %}<a href="{% url 'user' user=vote.user_id, username=vote.user_slug %}" class="vote-user"><span class="vote-icon"><i class="icon-{{ icon }}"></i></span> {{ vote.user_name }}</a>{% else %}<span class="vote-user"><span class="vote-icon"><i class="icon-{{ icon }}"></i></span> {{ vote.user_name }}</span>{% endif %}
  93. <p class="vote-date {% if acl.users.can_see_users_trails() %} tooltip-top{% endif %}"{% if acl.users.can_see_users_trails() %} title="{{ vote.agent }}"{% endif %}>{{ vote.date|reldate }}{% if acl.users.can_see_users_trails() %}, {{ vote.ip }}{% endif %}</p>
  94. {% endmacro %}