{% extends "shared/base.html" %}


{% block title %}
  <title>Publisher Detail</title>
{% endblock %}

{% block content %}
  <div class="container">
  <div class="row">
    <div class="col">
      <h1 class="display-5">Publisher Detail</h1>
    </div>
  </div>

  <div class="row">
      <table class="table table-striped table-hover">
        <tbody>
          <tr>
            <th scope="row">Publisher Name</th>
            <td colspan="2">{{publisher.name}}</td>
          </tr>
          {% if publisher.parent_publisher_id %}
            <tr>
              <th scope="row">Parent Company</th>
              <td colspan="2"><a href="/comic/publishers/{{publisher.parent_publisher_id}}">{{publisher.parent_publisher.name}}</a></td>
            </tr>
          {% endif %}
          {% if publisher.imprints|length > 0 %}
            <tr>
              <th scope="row">Imprints</th>
              <td colspan="2">
                <ul>
                  {% for imprint in publisher.imprints %}
                      <li><a href="/comic/publishers/{{imprint.id}}">{{imprint.name}}</a></li>
                  {% endfor %}
                </ul>
              </td>
            </tr>
          {% endif %}
          <tr>
            <th scope="row">Comics</th>
            <td colspan="2">
              <ul>
                {% for comic in publisher.comics %}
                    <li><a href="/comic/comics/{{comic.id}}">{{comic.title}}</a></li>
                {% endfor %}
              </ul>
            </td>
          </tr>
          <tr>
            <th scope="row">Data Created</th>
            <td colspan="2">{{publisher.created_date}}</td>
          </tr>
          <tr>
            <th scope="row">Data Modified</th>
            <td colspan="2">{{publisher.last_modified_date}}</td>
          </tr>
        </tbody>
    </table>
  </div>
  <div class="row">
    <div>
      <a href="/comic/publishers" class="btn btn-outline-primary btn-sm active" role="button" aria-pressed="true">Back to list</a>
      <a href="/comic/publisher/edit/{{publisher.id}}" class="btn btn-outline-primary btn-sm active" role="button" aria-pressed="true">Edit</a>
      <a href="/comic/publisher/delete/{{publisher.id}}" class="btn btn-outline-danger btn-sm active" role="button" aria-pressed="true">Delete</a>
    </div>
  </div>
</div>
{% endblock %}
