{% extends "base.html" %}

{% block bodyclass %}question{% endblock %}

{% block title %}{{ question["Title"] | safe }}{% endblock %}
{% block keywords %}{% for tag in question["Tags"] %}{{ tag }} {% endfor %}{% endblock %} 

{% block body %}
  <div class="row">
    <h2 class="title">{{ question["Title"] | safe }}</h2>
  </div>
  <div class="row">
    <div class="col-md-7">
      <div id="question">
        {% set post = question %}
        {% include "post.mixin.html" %} 
      </div>
      {% if question["answers"] %}
        <h2>Answers</h2>
        <div id="answers">
          {% for post in question["answers"] %}
            <div id="a{{ post["Id"] }}">
              {% include "post.mixin.html" %} 
            </div>
          {% endfor %}
        </div>
      {% else %}
        <h2>No answers</h2>
      {% endif %}
    </div>
    <div class="row col-md-3">
      <div class="metadata">
        <p>asked: <span class="date" title="{{ question["CreationDate"] }}">{{ question["CreationDate"] }}</span></p>
        <p>viewed: {{ question["ViewCount"] | intspace }} times</p>
        <p>active: <span class="date" title="{{ question["LastActivityDate"] }}">{{ question["LastActivityDate"] }}</span></p>
      </div>
      {% if question["duplicate"] %}
        <div id="related" class="metadata">
          <h3>Duplicate</h3>
          <ul>
            {% for dupe in question["duplicate"] %}
                <li><a href="{{ rooturl }}/question/{{ dupe["PostId"] }}.html" >{{ dupe["PostName"] }}</a></li>
            {% endfor %}
            </ul>
        </div>
      {% endif %}
      {% if question["relateds"] %}
        <div id="related" class="metadata" >
          <h3>Related</h3>
          <ul>
            {% for related in question["relateds"] %}
                <li><a href="{{ rooturl }}/question/{{ related["PostId"] }}.html" >{{ related["PostName"] }}</a></li>
            {% endfor %}
           </ul>
        </div>
    {% endif %}
    </div>
  </div>
  <script src="{{ rooturl }}/static/main.js"></script>
  <div id="footer">This question is issued from <a href="{{ site_url }}/questions/{{ question["Id"] }}">{{ site_url }}</a>. The text is available under the <a href="https://creativecommons.org/licenses/by-sa/3.0/"> Creative Commons Attribution/Share Alike </a>.</div>
{% endblock %}
