{% load i18n reviewtags static %}
{% comment %}
 NOTE: Keep this file in sync with
       reviewboard/static/rb/js/reviews/views/commentIssueBarView.ts
{% endcomment %}

{% if comment.issue_opened %}
<div class="issue-indicator">
 <div class="rb-c-issue-bar"
      aria-labelledby="issue-bar-{{comment.pk}}_label"
      data-can-verify="{{can_verify|yesno:'true,false'}}"
      data-comment-id="{{comment.pk}}"
      data-comment-type="{{comment_type}}"
      data-interactive="{{interactive|yesno:'true,false'}}"
      data-issue-status="{{issue_status}}">
  <span class="rb-c-issue-bar__icon" aria-hidden="true"></span>
  <label class="rb-c-issue-bar__message"
         id="issue-bar-{{comment.pk}}_label">
{%  if issue_status == "open" %}
   {% trans "An issue was opened." %}
{%  elif issue_status == "dropped" %}
   {% trans "The issue has been dropped." %}
{%  elif issue_status == "resolved" %}
   {% trans "The issue has been resolved." %}
{%  elif issue_status == "verifying-dropped" %}
   {% trans "Waiting for verification before dropping..." %}
{%  elif issue_status == "verifying-resolved" %}
   {% trans "Waiting for verification before resolving..." %}
{%  endif %}
  </label>
  <span class="rb-c-issue-bar__actions">
{%  if interactive %}
{%   if issue_status == "open" %}
   <button class="ink-c-button" type="button" data-action="resolve">
    {% trans "Fixed" %}
   </button>
   <button class="ink-c-button" type="button" data-action="drop">
    {% trans "Drop" %}
   </button>
{%   elif issue_status == "dropped" or issue_status == "resolved" %}
   <button class="ink-c-button" type="button" data-action="reopen">
    {% trans "Re-open" %}
   </button>
{%   elif issue_status == "verifying-dropped" %}
   <button class="ink-c-button" type="button" data-action="reopen">
    {% trans "Re-open" %}
   </button>
{%    if can_verify %}
   <button class="ink-c-button" type="button" data-action="verify-dropped">
    {% trans "Verify Dropped" %}
   </button>
{%    endif %}
{%   elif issue_status == "verifying-resolved" %}
   <button class="ink-c-button" type="button" data-action="reopen">
    {% trans "Re-open" %}
   </button>
{%    if can_verify %}
   <button class="ink-c-button" type="button" data-action="verify-resolved">
    {% trans "Verify Fixed" %}
   </button>
{%    endif %}
{%   endif %}
{%  endif %}
  </span>
  <a class="rb-c-issue-bar__all-issues-link"
     href="#issue-summary">
   {% trans "Show all issues" %}
  </a>
 </div>
</div>
{% endif %}
