message.html 3.02 KB
{% load gravatar superarchives tz i18n %}
<li>
  {% spaceless %}
  <div class="email-message" id="msg-{% firstof email.id 'reply' %}">
    <div class="panel panel-default">
      <div class="panel-heading clearfix">
        <div class="col-lg-6 col-md-6 col-sm-6">
          {% if userprofile.get_absolute_url %}
          <a href="{{ userprofile.get_absolute_url }}">
          {% endif %}
          {% gravatar emailaddress 34 %}
          <strong class="user-fullname">{{ fullname }}</strong>
          {% if userprofile.get_absolute_url %}
          </a>
          {% endif %}
          <div class="hidden-xs hidden-sm div-message-link" title="{% trans 'Link to this message' %}">
            <button class="btn btn-default message-link" data-toggle="popover" data-content="<input type='text' value='{{ request.get_host }}{{ request.path }}#msg-{{ email.id }}' class='form-control' />" data-title="{% trans 'Link to this message' %}" data-html="true" data-container="body">
              <span class="glyphicon glyphicon-link"></span>
            </button>
          </div>
        </div>

        {% if not reply %}
        <div class="col-lg-6 col-md-6 col-sm-6">
          <div class="pull-right text-right">
            <span class="date">
              {{ email.received_time|localtime|date:'DATETIME_FORMAT' }}
            </span>

            <div class="btn-group">
              <button class="btn btn-default vote-count disabled">
                {{ email.votes_count }}
              </button>
              {% if user in email.vote_list %}
              <button class="btn btn-success vote" data-loading-text="...">
              {% else %}
              <button class="btn btn-default vote" data-loading-text="...">
              {% endif %}
                <span class="glyphicon glyphicon-thumbs-up"></span>
              </button>
            </div>

            {% if user.is_active %}
            <button class="btn btn-default reply" title="{% trans 'Reply' %}">
              <span class="glyphicon glyphicon-share"></span>
            </button>
            {% endif %}
          </div>
        </div>
        {% endif %}

      </div>
      <div class="panel-collapse in">
        <div class="panel-body">
          {% if not reply %}
            {% display_message email %}
          {% else %}
            <form method="POST">
              {% csrf_token %}
              <p>
                <textarea name="emailbody" placeholder="{% trans 'Send a message' %}" rows="5" class="form-control"></textarea>
              </p>
              <div class="col-lg-9 col-md-8 col-sm-8 col-xs-7">
                <p class="quiet">{% trans "After sending a message it will take few minutes before it shows up in here. Why don't you grab a coffee?" %}</p>
              </div>
              <div class="col-lg-3 col-md-4 col-sm-4 col-xs-5 text-right">
                <button class="btn btn-success" type="submit">{% trans 'Send' %}</button>
              </div>
            </form>
          {% endif %}
        </div>
      </div>
    </div>
  </div>
{% endspaceless %}
</li>