{% extends "base.html" %}
{% block title %}<title>{{book.title}}</title>{% endblock %}
{% block content %}
{% load static %}

<div class="col s12 m7">
  <div class="card z-depth-0 horizontal">
    <div class="card-image">
      <a style="padding-top:15%" href=" /download/{{download}}"><img src=" /download/{{imgpath}}"
          alt="download" srcset=""></a>
    </div>
    <div class="card-stacked">
      <div class="card-content">
        <h1> {{book.title}}</h1>
        <h4> by
          {% if book.authors %}
          {% for author in book.authors.all %}
          <a href="{{author.get_absolute_url}}">{{author.name}}</a>
          {%endfor%}
          {% else %}
          {{book.author_sort}}
          {%endif%}
          <br>
          Published by
          {% if book.publishers %}
          {% for pub in book.publishers.all %}
          <a href="{{pub.get_absolute_url}}">{{pub.name}}</a>
          {%endfor%}
          {% else %}
          Unknown
          {%endif%}
          <br>
          Tags:
          {% if book.tags %}
          {% for tag in book.tags.all %}
          <a href="{{tag.get_absolute_url}}">{{tag.name}}</a>,
          {%endfor%}
          {% else %}
          {%endif%}
          <br>
          Rating:
          {% if book.ratings %}
          {% for rating in book.ratings.all %}
          <a href="{{rating.get_absolute_url}}">{{rating}}</a>
          {%endfor%}
          {% else %}
          {%endif%}
          <br>
          <a href="{{book.publisher.get_absolute_url}}">{{book.publisher}}</a>
        </h4>
      </div>
    </div>
  </div>
</div>

<div class="container">
  {% autoescape off %}
  {{comment}}
  {% endautoescape %}
</div>

{% endblock %}