message-thread.html 2.58 KB
{% extends "base.html" %}
{% load i18n %}
{% load append_to_get %}
{% block main-content %}
<div class="row">

  <h2>{{ first_msg.subject_clean }}</h2>
  <hr />

  <div class="col-lg-3 pull-right">
    <h4><strong>{% trans "Order by" %}:</strong></h4>
    <ul class="none">
      <li><span class="glyphicon glyphicon-chevron-right">
        <a href="{% append_to_get order='voted' %}">{% trans "Votes" %}</a>
      </span></li>
      <li><span class="glyphicon glyphicon-chevron-right">
        <a href="{% append_to_get order='date' %}">{% trans "Date" %}</a>
      </span></li>
    </ul>

    <div>&nbsp;</div>

    <h4><strong>{% trans "Statistics:" %}</strong></h4>

    <ul class="none">
      <li class="quiet"><span class="glyphicon glyphicon-chevron-right">
        {% trans "started at" %}
      </span></li>
        <h5>{{ first_msg.received_time|timesince }} {% trans "ago" %}</h5>
      <li class="quiet"><span class="glyphicon glyphicon-chevron-right">
        {% trans "viewed" %}
      </span></li>
        <h5>{{ pagehits }} {% trans "times" %}</h5>
      <li class="quiet"><span class="glyphicon glyphicon-chevron-right">
        {% trans "answered" %}
      </span></li>
        <h5>{{ emails|length }} {% trans "times" %}</h5>
      <li class="quiet"><span class="glyphicon glyphicon-chevron-right">
        {% trans "voted" %}
      </span></li>
        <h5>{{ total_votes }} {% trans "times" %}</h5>
    </ul>
  </div>

  <ul class="none">
  {% for email in emails %}
    <li>
      <div class="col-lg-2 text-center">
        <a href="{{ email.from_address.get_profile_link }}">
          <img width="80px" height="80px"
               src="http://www.gravatar.com/avatar/{{ email.from_address.md5 }}?s=80&d=identicon" />
          <div>&nbsp;</div>
          {% trans "Anonymous" as anonymous %}
          <span>{% firstof email.from_address.get_full_name anonymous %}</span>
        </a>

        <p>{{ email.received_time|date:"SHORT_DATETIME_FORMAT" }}</p>

        <div class="plus">
          <span>{{ email.votes_count }}</span>
          <img title="{% trans 'Vote' %}" class="pull-right" src="{{ STATIC_URL }}img/plus.png">
        </div>

        <p class="{% if not user in email.vote_list %}hide{% endif %}">
          <a href="#">{% trans "Remove votes" %}</a>
        </p>
      </div>

        <div class="col-lg-7">
          <pre>{{ email.body }}</pre>
        </div>
      {% if not forloop.last %}
      <div>&nbsp;</div>
      {% endif %}
    </li>
  {% endfor %}
  </ul>

  <script type="text/javascript" charset="utf-8">
    pagehit("{{ request.path_info }}");
  </script>

</div>
{% endblock %}