mirror of
https://github.com/daniviga/django-ram.git
synced 2025-08-04 13:17:50 +02:00
* Navbar refactoring * Fix coming soon SVG fonts * Overhaul templating and extend search to consists and books
61 lines
2.6 KiB
HTML
61 lines
2.6 KiB
HTML
<div class="col">
|
|
<div class="card shadow-sm">
|
|
{% if d.item.image.all %}
|
|
<a href="{{ d.item.get_absolute_url }}">
|
|
{% for r in d.item.image.all %}
|
|
{% if forloop.first %}<img src="{{ r.image.url }}" alt="Card image cap">{% endif %}
|
|
{% endfor %}
|
|
</a>
|
|
{% endif %}
|
|
<div class="card-body">
|
|
<p class="card-text" style="position: relative;">
|
|
<strong>{{ d.item }}</strong>
|
|
<a class="stretched-link" href="{{ d.item.get_absolute_url }}"></a>
|
|
</p>
|
|
{% if d.item.tags.all %}
|
|
<p class="card-text"><small>Tags:</small>
|
|
{% for t in d.item.tags.all %}<a href="{% url 'filtered' _filter="tag" search=t.slug %}" class="badge rounded-pill bg-primary">
|
|
{{ t.name }}</a>{# new line is required #}
|
|
{% endfor %}
|
|
</p>
|
|
{% endif %}
|
|
<table class="table table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th colspan="2" scope="row">Book</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="table-group-divider">
|
|
<tr>
|
|
<th class="w-33" scope="row">Authors</th>
|
|
<td>
|
|
<ul class="mb-0 list-unstyled">{% for a in d.item.authors.all %}<li>{{ a }}</li>{% endfor %}</ul>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th class="w-33" scope="row">Publisher</th>
|
|
<td>{{ d.item.publisher }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">Language</th>
|
|
<td>{{ d.item.get_language_display }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">Pages</th>
|
|
<td>{{ d.item.number_of_pages|default:"-" }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">Year</th>
|
|
<td>{{ d.item.publication_year|default:"-" }}</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<div class="d-grid gap-2 mb-1 d-md-block">
|
|
<a class="btn btn-sm btn-outline-primary" href="{{ d.item.get_absolute_url }}">Show all data</a>
|
|
{% if request.user.is_staff %}<a class="btn btn-sm btn-outline-danger" href="{% url 'admin:bookshelf_book_change' d.item.pk %}">Edit</a>{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|