Template source: comment/comment.html

{% load i18n %}{% load staticfiles %}{% load user_in_group %}{% load get_setting %}{% load captureas %}

{% if comments or listing.is_active %}
{% if listing.is_active %}

<header class="top clearfix">
  <h3 class="light no-uppercase">{% trans 'Post a Comment' %}</h3>
</header>

{% if request.user.is_anonymous %}
<h4 class="light-grey appendleft-15 appendtop-20 appendbottom-20">{% trans 'Please <a href="javascript:;" class="sign-in">login</a> or <a href="javascript:;" class="join trigger-modal" data-class="popup-signup-form" data-title="Join Now" data-href="/account/register/" modal_id="8qj1gzj2">join</a> to comment.' %}</h4>
{% elif not request.user.get_profile.email_validated %}
<h4 class="appendleft-15 appendtop-20">{% trans 'Your account is inactive. Please activate your account to comment.' %}</h4>
{% else %}
  <div class="post-comment row-fluid appendtop-20 appendbottom-20 border-box padding-10">
    <div class="span1">
    {% if user.get_role_image %}
      <img src="{{ user.get_role_image }}" class="circle-icon hidden-phone" alt="{{ user.username }}"/>
    {% elif user.get_profile.picture %}
      <img src="{{ user.get_profile.picture.medium_url }}" class="circle-icon hidden-phone" alt="{{ user.username }}"/>
    {% else %}
      <img src="{% static "images/icons/iconNoAvatar.png" %}" alt="{{ user.username }}"  class="circle-icon hidden-phone" />
    {% endif %}
    </div>
    <div class="span11">
      <form id="post-a-comment-form" class="full" action="{% url 'browse.views.listing.comment.by_id' listing.id %}">
        {% csrf_token %}
        <textarea name="body" placeholder='{% trans "Post a Comment" %}'></textarea>
        <div class="comment-button text-right">
          <div class="errorlist pull-left appendtop-5">
            <span id="comment-error"></span>
          </div>
          <a class="btn btn-green btn-loader bold" id='post-comment-submit'>{% trans 'Post' %}</a>
        </div>
      </form>
    </div>
  </div>
{% endif %}
<hr class="dark-hr"></hr>
{% else %}

<header class="top clearfix appendbottom-10">
  <h3 class="light no-uppercase">{% trans 'Comments' %}</h3>
</header>

{% endif %}

{% for comment in comments %}
{% if comment.visible or perms.account.toggle_commentvisibility %}
    <div class="row-fluid border-box comment border-box appendpaddingright-10 appendpaddingleft-10{% if not comment.visible %} comment-hidden{% endif %}">
      <div class="span1">
        <a href="{% url 'account.views.publicprofile.show' comment.user_sender.urlpath %}">
            {% if comment.user_sender.get_profile.user.get_role_image %}
                <img src="{{ comment.user_sender.get_profile.user.get_role_image }}" class="circle-icon hidden-phone" alt="{{ user.username }}"/>
            {% elif comment.user_sender.get_profile.picture %}
                <img src="{{ comment.user_sender.get_profile.picture.medium_url }}" class="circle-icon hidden-phone" alt="{{ comment.user_sender.username }}"/>
            {% else %}
                <img src="{% static "images/icons/iconNoAvatar.png" %}" alt="{{ comment.user_sender.username }}"  class="circle-icon" />
            {% endif %}
        </a>
      </div>
      <div class="span11">
        <h5 class="clearfix metal-grey">
          <strong class="comment-poster input-level-block pull-left"><a href="{% url 'account.views.publicprofile.show' comment.user_sender.urlpath %}">{{ comment.user_sender.username }}</a></strong>
          {% get_setting "MODERATOR_GROUP" as mod_group %}{% get_setting "SALES_GROUP" as sales_group %}
          {% if comment.user_sender|in_group:mod_group or comment.user_sender|in_group:sales_group %}
            <span class="label label-default">{% trans 'Staff' %}</span>
          {% endif %}
          <span class="comment-post-time input-level-block pull-right"><small>{% blocktrans with posted_at=comment.created_at|timesince %}{{ posted_at }} ago{% endblocktrans %}</small></span>
        </h5>
        <p class="comment-body">{{ comment.body }}</p>
        {% if perms.account.toggle_commentvisibility %}
            <div class="text-right">
            <button class="btn btn-green btn-admin toggle-comment-submit appendbottom-10"data-show="{% trans 'Show' %}" data-hide="{% trans 'Hide' %}"
            data-message-id="{{ comment.pk }}" action="{% url 'messaging.views.restricted.commands.toggle_comment_visibility' %}"
            {% if comment.visible %}data-change-visibility='hide'>{% trans 'Hide' %}{% else %}data-change-visibility='show'>{% trans 'Show' %}{% endif %}</button>
            </div>
        {% endif %}
      </div>
    </div>
{% endif %}
{% endfor %}
{% captureas pagination_url %}{% url 'browse.views.listing.comment.ajax_for_listing' listing.id %}{% endcaptureas %}
{% include "search/pagination.html" with page=comments url=pagination_url %}
{% endif %}