Renamed models like how Django does it, fixed commens on book template

This commit is contained in:
MassiveAtoms
2020-07-09 01:00:51 -03:00
parent 99a74b75a9
commit 62b9dfd94f
17 changed files with 113 additions and 223 deletions

View File

@ -2,7 +2,7 @@
{% block content %}
{% load static %}
<h1>{{authors}}</h1>
<h1>{{author}}</h1>
<table id="books">
<tr>

View File

@ -3,15 +3,15 @@
{% block content %}
{% load static %}
<h1>Author List</h1>
{% if authors_list %}
{% if author_list %}
<ul>
{% for author in authors_list %}
{% for author in author_list %}
<li>
<a href="{{ author.get_absolute_url }}">{{ author.name }}</a>
</li>
{% endfor %}
</ul>
{% else %}
<p>There are no authors in the library.</p>
<p>There are no author in the library.</p>
{% endif %}
{% endblock %}

View File

@ -2,19 +2,19 @@
{% block content %}
{% load static %}
<h1>{{books.title}} by
{% if books.authors %}
{% for author in books.authors.all %}
<h1>{{book.title}} by
{% if book.authors %}
{% for author in book.authors.all %}
<a href="{{author.get_absolute_url}}">{{author.name}}</a>
{%endfor%}
{% else %}
{{books.author_sort}}
{{book.author_sort}}
{%endif%}
Published by
{% if books.publishers %}
{% for pub in books.publishers.all %}
{% if book.publishers %}
{% for pub in book.publishers.all %}
<a href="{{pub.get_absolute_url}}">{{pub.name}}</a>
{%endfor%}
{% else %}
@ -23,16 +23,16 @@
{%endif%}
Tags:
{% if books.tags %}
{% for tag in books.tags.all %}
{% if book.tags %}
{% for tag in book.tags.all %}
<a href="{{tag.get_absolute_url}}">{{tag.name}}</a>,
{%endfor%}
{% else %}
{%endif%}
Rating:
{% if books.ratings %}
{% for rating in books.ratings.all %}
{% if book.ratings %}
{% for rating in book.ratings.all %}
<a href="{{rating.get_absolute_url}}">{{rating}}</a>
{%endfor%}
{% else %}
@ -40,8 +40,11 @@
<a href="{{book.publisher.get_absolute_url}}">{{book.publisher}}</a>
</h1>
{{comment}}
<a href="{% static "" %}{{download}}"><img src="{% static "" %}{{imgpath}}" alt="" srcset=""></a>
<a href="{% static "" %}{{download}}"><img src="{% static "" %}{{imgpath}}" alt="download" srcset=""></a>
{% autoescape off %}
{{comment}}
{% endautoescape %}
{% endblock %}

View File

@ -13,7 +13,7 @@
<th onclick="sortTable(3)">Tags</th>
<th onclick="sortTable(4)">Added</th>
</tr>
{% for book in books_list %}
{% for book in book_list %}
<tr>
<td><a href="{{ book.get_absolute_url }}">{{ book.title }}</a></td>
<td>{{book.author_sort}}</td>

View File

@ -2,9 +2,9 @@
{% block content %}
{% load static %}
<h1>{{publishers}} </h1>
<h1>{{publisher}} </h1>
{% if publishers.released %}
{% if publisher.released %}
<table id="books">
<tr>
<!--When a header is clicked, run the sortTable function, with a parameter, 0 for sorting by names, 1 for sorting by country:-->
@ -14,7 +14,7 @@
<th onclick="sortTable(3)">Tags</th>
<th onclick="sortTable(4)">Added</th>
</tr>
{% for book in publishers.released.all %}
{% for book in publisher.released.all %}
<tr>
<td><a href="{{ book.get_absolute_url }}">{{ book.title }}</a></td>
<td>{{book.author_sort}}</td>

View File

@ -3,15 +3,15 @@
{% block content %}
{% load static %}
<h1>Publishers List</h1>
{% if publishers_list %}
{% if publisher_list %}
<ul>
{% for publisher in publishers_list %}
{% for publisher in publisher_list %}
<li>
<a href="{{ publisher.get_absolute_url }}">{{ publisher.name }}</a>
</li>
{% endfor %}
</ul>
{% else %}
<p>There are no publishers in the library.</p>
<p>There are no publisher in the library.</p>
{% endif %}
{% endblock %}

View File

@ -3,7 +3,7 @@
{% block content %}
{% load static %}
<h1>{{ratings}}</h1>
<h1>{{rating}}</h1>
{% if books %}
<table id="books">
<tr>
@ -18,7 +18,7 @@
<tr>
<td><a href="{{ book.get_absolute_url }}">{{ book.title }}</a></td>
<td>{{book.author_sort}}</td>
<td> {% for rating in book.ratings.all %}
<td> {% for rating in book.rating.all %}
{{rating}}
{% endfor %}
</td>

View File

@ -3,15 +3,15 @@
{% block content %}
{% load static %}
<h1>Ratings List</h1>
{% if ratings_list %}
{% if rating_list %}
<ul>
{% for rating in ratings_list %}
{% for rating in rating_list %}
<li>
<a href="{{ rating.get_absolute_url }}">{{ rating.rating }}</a>
</li>
{% endfor %}
</ul>
{% else %}
<p>There are no ratings in the library.</p>
<p>There are no rating in the library.</p>
{% endif %}
{% endblock %}

View File

@ -3,7 +3,7 @@
{% block content %}
{% load static %}
<h1>{{tags}}</h1>
<h1>{{tag}}</h1>
{% if books %}
<table id="books">
<tr>
@ -23,7 +23,7 @@
{% endfor %}
</td>
<td>
{% for tag in book.tags.all %}
{% for tag in book.tag.all %}
{{tag}},
{% endfor %}
</td>

View File

@ -3,15 +3,15 @@
{% block content %}
{% load static %}
<h1>Tags List</h1>
{% if tags_list %}
{% if tag_list %}
<ul>
{% for tag in tags_list %}
{% for tag in tag_list %}
<li>
<a href="{{ tag.get_absolute_url }}">{{ tag.name }}</a>
</li>
{% endfor %}
</ul>
{% else %}
<p>There are no tags in the library.</p>
<p>There are no tag in the library.</p>
{% endif %}
{% endblock %}