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


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

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

  <div class="row">
      <table class="table table-striped table-hover">
        <tbody>
          <tr>
            <th scope="row">Artist Name</th>
            <td colspan="2">{{artist.name}}</td>
          </tr>
          <tr>
            <th scope="row">Link</th>
            <td colspan="2">{{artist.weblink}}</td>
          </tr>
          <tr>
            <th scope="row">Works</th>
            <td colspan="2">
                {% for work in artist.get_comics() %}
                    <p>
                        <a href="/comic/worktypes/{{work.id}}">{{work.name}}</a>
                        <ul>
                          {% for comic in artist.get_comics()[work] %}
                            <li><a href="/comic/comics/{{comic.id}}">{{comic.title}}</a></li>
                          {% endfor %}
                        </ul>
                    </p>
                {% endfor %}
            </td>
          </tr>
          <tr>
            <th scope="row">Data Created</th>
            <td colspan="2">{{artist.created_date}}</td>
          </tr>
          <tr>
            <th scope="row">Data Modified</th>
            <td colspan="2">{{artist.last_modified_date}}</td>
          </tr>
          <tr>
            <th scope="row">Data Version</th>
            <td colspan="2">{{artist.version}}</td>
          </tr>
        </tbody>
    </table>
  </div>
  <div class="row">
    <div>
      <a href="/comic/artists" class="btn btn-outline-primary btn-sm active" role="button" aria-pressed="true">Back to list</a>
      <a href="/comic/artist/edit/{{artist.id}}" class="btn btn-outline-primary btn-sm active" role="button" aria-pressed="true">Edit</a>
      <a href="/comic/artist/delete/{{artist.id}}" class="btn btn-outline-danger btn-sm active" role="button" aria-pressed="true">Delete</a>
    </div>
  </div>
</div>
{% endblock %}

