{% load djblets_utils i18n staticfiles %}

{% if request.user.pk == review_request.submitter_id or perms.reviews.can_change_status and review_request.public %}
{%  if review_request.status == 'P' %}
 <li class="has-menu">
  <a class="menu-title" id="close-review-request-link" href="#">{% trans "Close" %} &#9662;</a>
  <ul class="menu" style="display: none;">
{%   if review_request.public %}
   <li><a id="link-review-request-close-submitted" href="#">{% trans "Submitted" %}</a></li>
{%   endif %}
   <li><a id="discard-review-request-link" href="#">{% trans "Discarded" %}</a></li>
{%   if perms.reviews.delete_reviewrequest %}
   <li><a id="delete-review-request-link" href="#">{% trans "Delete Permanently" %}</a></li>
{%   endif %}
  </ul>
 </li>
{%  endif %}
{% endif %}
{% if request.user.pk == review_request.submitter_id or perms.reviews.can_edit_reviewrequest %}
{%  if review_request.status == 'P' %}
 <li class="has-menu">
  <a class="menu-title" id="update-review-request-link" href="#">{% trans "Update" %} &#9662;</a>
  <ul class="menu" style="display: none;">
{%  if upload_diff_form %}
   <li><a id="upload-diff-link" href="#">{% if has_diffs %}{% trans "Update Diff" %}{% else %}{% trans "Upload Diff" %}{% endif %}</a></li>
{%  endif %}
   <li><a id="upload-file-link" href="#">{% trans "Add File" %}</a></li>
  </ul>
 </li>
{%  endif %}
{% endif %}
