<tpl:EntryIf operator="or" comments_active="1" pings_active="1">
  <div id={{tpl:lang reactions-id}} class=reactions-block>

  <tpl:EntryIf operator="and" has_comment="1" has_ping="1">
    <h3 class=reaction-title>{{tpl:EntryCommentCount one="reactions-reactions-title-count-one" more="reactions-reactions-title-count-multiple" count_all="1"}}</h3>
  </tpl:EntryIf>

  <tpl:EntryIf operator="and" has_comment="1" has_ping="0">
    <h3 class=reaction-title>{{tpl:EntryCommentCount one="reactions-comments-title-count-one" more="reactions-comments-title-count-multiple"}}</h3>
  </tpl:EntryIf>

  <tpl:EntryIf operator="and" has_comment="0" has_ping="1">
    <h3 class=reaction-title>{{tpl:EntryPingCount one="reactions-trackbacks-title-count-one" more="reactions-trackbacks-title-count-multiple"}}</h3>
  </tpl:EntryIf>
</tpl:EntryIf>

<tpl:EntryIf operator="or" show_comments="1" show_pings="1">
  <tpl:Comments with_pings="1">
    <tpl:CommentsHeader>
      <ul id=reactions-list>
    </tpl:CommentsHeader>

    <tpl:CommentIf is_ping="0">
      <li id={{tpl:lang reactions-comment-id}}-{{tpl:CommentID}} class="reaction comment {{tpl:CommentIfMe}} {{tpl:CommentIfOdd}} {{tpl:CommentIfFirst}}">
        <header class=comment-meta>
          <cite class=comment-author>{{tpl:CommentAuthorLink}}</cite><small class="comment-date text-secondary">, <a href="#{{tpl:lang reactions-comment-id}}-{{tpl:CommentID}}">{{tpl:CommentDate}} {{tpl:lang reactions-comment-datetime-separator}} {{tpl:CommentTime}}</a>{{tpl:lang reactions-comment-datetime-colon}}</small>
        </header>

        <div class="comment-content content-text">
          {{tpl:SysBehavior behavior="publicCommentBeforeContent"}}

          {{tpl:CommentContent}}

          {{tpl:SysBehavior behavior="publicCommentBeforeContent"}}
        </div>
    </tpl:CommentIf>

    <tpl:CommentIf is_ping="1">
      <li id={{tpl:lang reactions-trackback-id}}-{{tpl:PingID}} class="reaction ping {{tpl:PingIfOdd}} {{tpl:PingIfFirst}}">
        {{tpl:lang reactions-trackback-label}} <a class=ping-link href="{{tpl:PingAuthorURL}}" {{tpl:PingNoFollow}}>{{tpl:PingTitle}}</a>, <cite class=ping-author>{{tpl:PingBlogName}}</cite><small class="ping-date text-secondary">, <a href="#{{tpl:lang reactions-trackback-id}}-{{tpl:PingID}}">{{tpl:PingDate}}, {{tpl:PingTime}}</a></small>
      </li>
    </tpl:CommentIf>

    <tpl:CommentsFooter>
      </ul>
    </tpl:CommentsFooter>
  </tpl:Comments>
</tpl:EntryIf>

<tpl:EntryIf comments_active="1">
  <tpl:Block name="comment-alerts">
    <tpl:SysIfCommentPublished>
      <p class=comment-message id={{tpl:lang reactions-comment-id}}>
        {{tpl:lang reactions-comment-alert-published}}
      </p>
    </tpl:SysIfCommentPublished>

    <tpl:SysIfCommentPending>
      <p class=comment-message id={{tpl:lang reactions-comment-id}}>
        {{tpl:lang reactions-comment-alert-review}}
      </p>
    </tpl:SysIfCommentPending>

    <tpl:SysIfFormError>
      <p class=comment-message id={{tpl:lang reactions-comment-id}}>
        {{tpl:SysFormError}}
      </p>
    </tpl:SysIfFormError>
  </tpl:Block>

  <tpl:Block name="comment-form">
    <form action={{tpl:EntryURL}}#{{tpl:lang reactions-comment-id}} id=comment-form method=post>
      <tpl:Block name="comment-form-preview">
        <tpl:IfCommentPreview>
          <div id={{tpl:lang reactions-comment-id}} class=comment-preview>
            <h3>{{tpl:lang reactions-comment-previewing}}</h3>

            <div class="comment-content content-text">
              {{tpl:CommentPreviewContent}}
            </div>

            <input type=submit class=submit value="{{tpl:lang reactions-comment-send-button}}">
          </div>
        </tpl:IfCommentPreview>
      </tpl:Block>

      <tpl:Block name="comment-form-add">
        <tpl:odysseyCommentFormWrapper>
          <h3 class=reaction-title>{{tpl:lang reactions-comment-form-title}}</h3>

          {{tpl:SysBehavior behavior="publicCommentFormBeforeContent"}}

          <div class=form-entry>
            <label for=c_name>{{tpl:lang reactions-comment-form-name-label}}</label>
            <br>
            <input id=c_name name=c_name maxlength=255 value="{{tpl:CommentPreviewName encode_html="1"}}" required>
          </div>

          <div class=form-entry>
            <label for=c_mail>{{tpl:lang reactions-comment-form-email-label}}</label>
            <br>
            <input id=c_mail name=c_mail type=email maxlength=255 value="{{tpl:CommentPreviewEmail encode_html="1"}}" required>
          </div>

          <div class=form-entry>
            <label for=c_site>{{tpl:lang reactions-comment-form-website-label}}</label>
            <br>
            <input id=c_site name=c_site maxlength=255 placeholder=https://… value="{{tpl:CommentPreviewSite encode_html="1"}}">
          </div>

          <div class=form-entry>
            <label for=c_content>{{tpl:lang reactions-comment-form-comment-label}}</label>
            <br>
            <textarea id=c_content name=c_content required rows=8>{{tpl:CommentPreviewContent raw="1" encode_html="1"}}</textarea>{{tpl:odysseyMarkdownSupportInfo}}
          </div>

          {{tpl:SysBehavior behavior="publicCommentFormAfterContent"}}

          <div class=form-entry>
            <input type=submit name=preview value="{{tpl:lang reactions-comment-form-preview-button}}">

            <tpl:IfCommentPreviewOptional>
              <input type=submit value="{{tpl:lang reactions-comment-form-submit-button}}">
            </tpl:IfCommentPreviewOptional>
          </div>

          {{tpl:odysseyEmailAuthor}}

          <tpl:odysseyTrackbackLink>
            <tpl:EntryIf pings_active="1">
              <h3>{{tpl:lang reactions-trackbacks-add-title}}</h3>

              <p class=text-secondary id=trackback-link-container>
                <span id=trackback-url>{{tpl:EntryPingLink}}</span>{{tpl:odysseyScriptTrackbackURLCopied}}
              </p>
            </tpl:EntryIf>
          </tpl:odysseyTrackbackLink>
        </tpl:odysseyCommentFormWrapper>
      </tpl:Block>
    </form>
  </tpl:Block>
</tpl:EntryIf>

<tpl:odysseyReactionFeedLink>
  <tpl:EntryIf operator="or" comments_active="1" pings_active="1" has_comment="1" has_ping="1">
    <p class=text-secondary id=comment-feed-link>
      <small><a href="{{tpl:BlogFeedURL type="atom"}}/comments/{{tpl:EntryID}}" rel=nofollow>{{tpl:lang reactions-subscribe-link-reactions}}</a></small>
    </p>
  </tpl:EntryIf>
</tpl:odysseyReactionFeedLink>

<tpl:EntryIf operator="or" comments_active="1" pings_active="1">
  </div>
</tpl:EntryIf>
