Skip to content

Commit 9b5fd72

Browse files
committed
Adds default
1 parent 42b4c31 commit 9b5fd72

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

templates/books/elements/detail.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
{% if book.doi %}
1313
<th>DOI</th>{% endif %}
1414
{% if chapters %}
15-
<th>{{ book.category.chapter_name_plural|capfirst }}</th>{% endif %}
15+
<th>{% if book.category %}{{ book.category.chapter_name_plural|capfirst }}{% else %}Chapter{% endif %}</th>{% endif %}
1616
</tr>
1717
<tr>
1818
<td>{{ book.date_published }}</td>
@@ -31,9 +31,9 @@
3131

3232
{% if chapters %}
3333
<li class="accordion-item" data-accordion-item>
34-
<a href="#" class="accordion-title">{{ book.category.chapter_name_plural|capfirst }}</a>
34+
<a href="#" class="accordion-title">{% if book.category %}{{ book.category.chapter_name_plural|capfirst }}{% else %}Chapter{% endif %}</a>
3535
<div class="accordion-content" data-tab-content>
36-
<p>{{ book.full_title }} has the following {{ book.category.chapter_name_plural }}:
36+
<p>{{ book.full_title }} has the following {% if book.category %}{{ book.category.chapter_name_plural }}{% else %}Chapter{% endif %}:
3737
<ul>
3838
{% for chapter in chapters %}
3939
<li><a href="{% url 'book_view_chapter' book.pk chapter.pk %}">{% if chapter.number %}

0 commit comments

Comments
 (0)