<tal:comment condition="nothing">
  <!-- ploneintranet.prototype/_includes/comment.html -->
</tal:comment>
<div class="comment${python: ' user-inactive' if not is_user_enabled else ''}"
     id="comment-${context/id}"
     tal:define="
       dummy view/portal/@@http-cache-headers;
       proto nocall: here/@@proto;
       is_slow proto/is_slow;
       userid here/userid;
       is_user_enabled view/is_user_enabled;
     "
     i18n:domain="ploneintranet"
>
  <div class="comment-header">
    <a class="${python: 'pat-inject pat-switch' if is_user_enabled else None} meta"
       href="${python: '{}/author/{}#app-space'.format(view.portal_url, userid) if is_user_enabled else None}"
       data-pat-inject="${python: 'history: record' if is_user_enabled else None}"
       data-pat-switch="${python: '#app-space state-off state-on' if is_user_enabled else None}"
    >
      <img tal:replace="structure python:proto.get_avatar_tag(userid)" />
      <h4 class="name"
          title="${view/fullname_title}"
      >${view/fullname}</h4>
      <time class="date pat-display-time"
            datetime="${context/date/ISO}"
            data-pat-display-time="from-now: true; locale: ${view/portal/plone_portal_state/language}"
      >${context/date/ISO}</time>
    </a>
    <tal:comment condition="nothing">
      <!-- post-menu.html == comment-menu.html -->
    </tal:comment>
    <a class="iconified icon-ellipsis pat-tooltip inactive"
       href="${view/traverse}/post-menu.html#content"
       data-pat-tooltip="source: ajax"
       tal:condition="view/actions"
    >Options</a>
  </div>
  <section class="comment-content">
    <p>
      <span tal:replace="structure view/decorated_text">
           The text of the comment
      </span>
      <a class="edited-toggle"
         id="edited-toggle-${context/thread_id}-comment-${context/id}"
         tal:condition="context/original_text"
      >
        (<span tal:omit-tag=""
              i18n:translate=""
        >Edited</span>
        <time class="pat-display-time"
              datetime="${context/edited/ISO}"
              data-pat-display-time="from-now: true; locale: ${view/portal/plone_portal_state/language}"
        >${context/edited/ISO}</time>)</a>

    </p>
    <section class="original-text pat-collapsible closed"
             data-pat-collapsible="trigger: #edited-toggle-${context/thread_id}-comment-${context/id}"
             tal:condition="context/original_text"
    >
      <p>
        <strong i18n:translate="">Original text:</strong>
           ${context/original_text}
      </p>
    </section>

  </section>

  <section class="preview">
    <figure tal:repeat="attachment view/attachments">
      <a class="pat-gallery"
         href="${attachment/link|attachment}"
      >
        <img alt="${attachment/title}"
             src="${attachment/img_src|attachment}"
             title="${attachment/title}"
             tal:condition="not:is_slow"
        />
        <tal:title condition="is_slow">${attachment/title}</tal:title>
      </a>
    </figure>
  </section>

  <div class="comment-footer">
    <a class="button reply pat-inject"
       id="microblog-${context/id}-reply-button"
       href="${view/portal/absolute_url}/++microblog++${context/id}/@@update-social.html#microblog-${context/id}"
       tal:condition="view/commentable"
       i18n:translate=""
    >Reply</a>
  </div>
  <div class="comment-reply-box"
       id="microblog-${context/id}"
  ></div>

  <div class="reply-trail"
       id="reply-trail-${context/thread_id}-comment-${context/id}-reply"
       tal:define="
         sub_comment_views python:view.sub_comment_views(context);
       "
  >
    <tal:loop repeat="comment python:sub_comment_views"
              content="structure comment"
    />
  </div>

  <div id="new-comment-${here/id}"></div>

</div>
