{% extends "layout.html" %}
{% block title %}Issue #{{ issue_data.number }}{% endblock %}
{% block body %}
  {% include "nav/nav.html" %}
  <main class="grid grid-show-gap" role="main"
        data-issue-number={{ issue_data.number }}
        data-statuses="{{ config['JSON_STATUSES'] }}"
        >
    <section id="issue" class="grid-row js-Issue is-hidden"
             data-issue-data="{{ json_data }}">
      <article class="grid-nested x2 issue-labels">
        <div class="grid-row">
          <section id="js-Issue-information" class="grid-cell">
            <section id="js-Issue-information">
              <div class="js-Issue-comment-body issue-details">
                {{ issue_data.body_html|safe }}
              </div>
            </section>
          </section>
          <section class="js-Issue-commentList issue-comment">
          </section>
          {% if session.user_id and session.avatar_url %}
            <section class="grid-cell issue-comment issue-new-comment x3 js-issue-comment-submit is-hidden">
              {% include "issue/issue-comment-submit.html" %}
            </section>
          {% endif %}
        </div>
        <section class="grid-row grid-nested x2">
          <div class="x2 grid-cell hint-text">
          {% if not session.user_id and not session.avatar_url %}
            <a class="x2" href="{{ url_for('login') }}">Please login to edit issues.</a>
          {% endif %}
            <p><a class="x2 js-github-url" href="{{ issue_data.html_url }}">
              View issue on Github
            </a></p>
            <span class="desktop-only">Shortcut: Press <b>l</b> on your keyboard to open the label editor.</span>
            <span class="desktop-only">Shortcut: Press <b>g</b> on your keyboard to be taken to the GitHub view of this page.</span>
          </div>
        </section>
      </article>
      <aside class="grid-cell x1 label-box">
        {% include "issue/issue-aside.html" %}
      </aside>
    </section>
  </main>
{% endblock %}
{% block extrascripts %}
<script type="module" src="{{ url_for('static', filename='dist/issue-page.js')|bust_cache }}"></script>
{%- if config.PRODUCTION or config.STAGING -%}
<script nomodule src="{{ url_for('static', filename='dist/issue-page.es5.js')|bust_cache }}"></script>
{%- endif %}
{% endblock %}
