{% load accounts avatars djblets_utils i18n reviewtags tz %}

{% definevar "reply_element_id" strip %}
 {% if draft %}draft{% endif %}comment_{{context_id}}-{{id}}
{% enddefinevar %}

<li{% attr "class" %}{% if draft %}draft{% elif reply_is_new %}new-reply{% endif %}{% endattr %}{% if comment_id %} data-comment-id="{{comment_id}}"{% endif %} id="{{anchor_name}}">
 <a class="comment-anchor" name="{{anchor_name}}"></a>
 <div class="floating-anchor"><a href="#{{anchor_name}}" class="fa fa-link fa-flip-horizontal"></a></div>

 <label class="rb-c-discussion-header -has-avatar -is-compact"
        for="{{reply_element_id}}">
  <div class="rb-c-discussion-header__avatar">
   <div class="avatar-container">
{% if use_avatars %}
    {% avatar reply_user 32 %}
{% endif %}
   </div>
  </div>
{%   if reply_is_new %}
  <div class="rb-c-discussion-header__status">
   <div class="rb-icon rb-icon-new-updates"
        title="{% trans "New reply" %}"></div>
  </div>
{%   endif %}
  <div class="rb-c-discussion-header__title">
{%   include "ui/components/user.html" with user=reply_user show_badges=True %}
  </div>
  <div class="rb-c-discussion-header__timestamp">
   <a class="timestamp" href="#{{anchor_name}}">
{%    localtime on %}
{%     blocktrans with timestamp|date:"c" as timestamp_raw %}
    <time class="timesince" datetime="{{timestamp_raw}}">{{timestamp}}</time>
{%     endblocktrans %}
{%    endlocaltime %}
   </a>
  </div>
 </label>

 <div class="reply-comment">
  <pre id="{{reply_element_id}}"
       data-raw-value="{% normalize_text_for_edit text rich_text %}"
       class="comment-text reviewtext {% rich_text_classname rich_text %}">{{text|render_markdown:rich_text}}</pre>
 </div>
</li>
