{% extends "base.html" %}
{% load static %}

{% block "content" %}
  <h1>{{ game.title }}</h1>

  <div id="game_infos">
    {% if game.image %}
    <img src="{{ game.image.url }}" alt="{{ game.title }}"/>
    {% endif %}

    <div id="details">
      <p><i class="fa fa-fw fa-bookmark"></i> <a href="{{ game.category.get_absolute_url }}">{{ game.category }}</a></p>
      <hr/>
      <p><i class="fa fa-fw fa-users" aria-hidden="true"></i> {{ game.get_player_range }}</p>
      <p><i class="fa fa-fw fa-clock-o" aria-hidden="true"></i> {{ game.duration|default:"(Durée de jeu inconnue)" }}
      <hr/>
      <p><i class="fa fa-fw fa-tags" aria-hidden="true"></i> 
        {% for tag in game.tags.all %}
          <a href="{{ tag.get_absolute_url }}">{{ tag }}</a>{% if not forloop.last %},{% endif %}
        {% empty %}
          (Aucun tag)
        {% endfor %}
      </p>
      <hr/>
      <p><i class="fa fa-fw fa-wrench" aria-hidden="true"></i> {{ game.game_designer|default:"(Game designer inconnu·e)" }}</li>
      <p><i class="fa fa-fw fa-paint-brush" aria-hidden="true"></i> {{ game.illustrator|default:"(Illustrateur·trice inconnu·e)" }}</li>
      <p><i class="fa fa-fw fa-cogs" aria-hidden="true"></i> {{ game.editor|default:"(Éditeur inconnu)" }}</p>
    </div>
  </div>

  <h2 id="description">Description</h2>
  {{ object.description|linebreaks }}

  {% if game.missing_elements %}
  <h2>Pièces manquantes</h2>
  <p class="warning">{{ game.missing_elements|linebreaksbr }}</p>
  {% endif %}

  <h2>Commentaires et propositions de variantes</h2>
  {% url "inventory:add_game_comment" game.slug as add_comment_url %}
  {% include "comments.html" with comments=game.comments.all %}
{% endblock %}
