123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- {% extends "cranefly/layout.html" %}
- {% import "cranefly/macros.html" as macros with context %}
- {% block title %}{{ macros.page_title(title=(_("Post #%(post)s Votes") % {'post': post.pk}),parent=thread.name) }}{% endblock %}
- {% block breadcrumb %}{{ super() }} <span class="divider"><i class="icon-chevron-right"></i></span></li>
- {{ macros.parents_list(parents) }}
- <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>
- <li class="active">{% trans post=post.pk %}Post #{{ post }} Votes{% endtrans %}
- {%- endblock %}
- {% block container %}
- <div class="page-header header-primary">
- <div class="container">
- {{ messages_list(messages) }}
- <ul class="breadcrumb">
- {{ self.breadcrumb() }}</li>
- </ul>
- <h1>{% trans post=post.pk %}Post #{{ post }} Votes{% endtrans %} <small>{{ thread.name|short_string(42) }}</small></h1>
- <ul class="unstyled header-stats">
- <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>
- <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>
- <li><i class="icon-thumbs-up"></i> {{ post.upvotes }}</li>
- <li><i class="icon-thumbs-down"></i> {{ post.downvotes }}</li>
- </ul>
- </div>
- </div>
- <div class="container container-primary">
- <div class="post-votes-list">
- <div class="post-likes">
- {% if upvotes %}
- <h2 class="text-success"><i class="icon-thumbs-up-alt"></i> {% trans count=upvotes|length, votes=upvotes|length|intcomma -%}
- One like
- {%- pluralize -%}
- {{ votes }} likes
- {%- endtrans %}</h2>
- <table class="table table-striped">
- <tbody>
- {% for row in upvotes|batch(4, '') %}
- <tr>
- {% for vote in row %}
- <td class="span3">
- {% if vote %}
- {{ vote_details(vote) }}
- {% else %}
-
- {% endif %}
- </td>
- {% endfor %}
- </tr>
- {% endfor %}
- </tbody>
- </table>
- {% else %}
- <p class="lead"><i class="icon-meh"></i> {% trans %}Nobody liked this post.{% endtrans %}</p>
- {% endif %}
- </div>
- <hr>
- <div class="post-dislikes">
- {% if downvotes %}
- <h2 class="text-error"><i class="icon-thumbs-down-alt"></i> {% trans count=downvotes|length, votes=downvotes|length|intcomma -%}
- One dislike
- {%- pluralize -%}
- {{ votes }} dislikes
- {%- endtrans %}</h2>
- <table class="table table-striped">
- <tbody>
- {% for row in downvotes|batch(4, '') %}
- <tr>
- {% for vote in row %}
- <td class="span3">
- {% if vote %}
- {{ vote_details(vote) }}
- {% else %}
-
- {% endif %}
- </td>
- {% endfor %}
- </tr>
- {% endfor %}
- </tbody>
- </table>
- {% else %}
- <p class="lead"><i class="icon-smile"></i> {% trans %}Nobody disliked this post.{% endtrans %}</p>
- {% endif %}
- </div>
- </div>
- </div>
- {% endblock %}
- {% block javascripts %}{{ super() }}
- <script type="text/javascript">
- $(function() {
- {% for vote in (upvotes|list + downvotes|list) %}
- $('.vote-{{ vote.id }}').popover({
- 'placement': 'top',
- 'trigger': 'hover',
- 'html': true,
- {% if acl.users.can_see_users_trails() %}
- 'title': '<strong>{{ vote.date|reldate }}</strong>',
- 'content': '{% trans ip=vote.ip %}From {{ ip }}{% endtrans %}'
- {% else %}
- 'content': '<strong>{{ vote.data|reldate }}</strong>'
- {% endif %}
- });
- {% endfor %}
- });
- </script>
- {% endblock %}
- {% macro vote_details(vote) %}
- {% if vote.user_id %}
- <a href="{{ url('user', user=vote.user_id, username=vote.user_slug) }}" class="vote-user vote-{{ vote.pk }}">{{ vote.user_name }}</a>
- {% else %}
- <span class="vote-user vote-{{ vote.pk }}">{{ vote.user_name }}</span>
- {% endif %}
- {% endmacro %}
|