This commit is contained in:
MassiveAtoms
2020-07-15 12:20:35 -03:00
parent d57f677bd3
commit 14f14a2f33
10 changed files with 101 additions and 8 deletions

View File

@ -59,12 +59,19 @@
<ul class="left">
<li><a href="{% url 'books' %}">Books</a></li>
<li><a class="dropdown-trigger" href="#!" data-target="dropdown-authors">Authors<i
<li><a class="dropdown-trigger" href={% url 'authors' %} data-target="dropdown-authors">Authors<i
class="material-icons right">arrow_drop_down</i></a></li>
<li><a class="dropdown-trigger" href="#!" data-target="dropdown-ratings">Ratings<i
<li><a class="dropdown-trigger" href={% url "ratings" %} data-target="dropdown-ratings">Ratings<i
class="material-icons right">arrow_drop_down</i></a></li>
<li><a class="dropdown-trigger" href="#!" data-target="dropdown-tags">Tags<i
<li><a class="dropdown-trigger" href={% url "tags" %} data-target="dropdown-tags">Tags<i
class="material-icons right">arrow_drop_down</i></a></li>
<li><a class="dropdown-trigger" href={% url "series" %} data-target="dropdown-series">Series<i
class="material-icons right">arrow_drop_down</i></a></li>
<li><a class="dropdown-trigger" href={% url "publishers" %} data-target="dropdown-pubishers">Publishers<i
class="material-icons right">arrow_drop_down</i></a></li>
<li><a href="{% url 'search' %}">Advanced search</a></li>
<li>
<!-- stefan, this div. can we have this int the navbar? -->
@ -94,6 +101,17 @@
{% endfor %}
</ul>
<ul id="dropdown-series" class="dropdown-content">
{% for tag in unique_series %}
<li><a href="{{tag.get_absolute_url}}">{{tag}} ({{tag.num_books}})</a></li>
{% endfor %}
</ul>
<ul id="dropdown-pubishers" class="dropdown-content">
{% for pub in unique_publishers %}
<li><a href="{{pub.get_absolute_url}}">{{pub}} ({{pub.num_books}})</a></li>
{% endfor %}
</ul>
{% else %}
<li><a href="{% url 'sign-up'%}?next={{request.path}}">Sign up</a></li>
<li><a href="{% url 'login'%}?next={{request.path}}">Login</a></li>

View File

@ -16,6 +16,7 @@
<th class="rating" onclick="sortTable(2)">Rating</th>
<th class="tags" onclick="sortTable(3)">Tags</th>
<th class="added" onclick="sortTable(4)">Added</th>
<th class="added" onclick="sortTable(5)">Published</th>
</tr>
{% for book in book_list %}
<tr>
@ -30,7 +31,8 @@
{{tag}},
{% endfor %}
</td>
<td>{{book.timestamp}}</td>
<td>{{book.timestamp | timesince}} ago</td> <!-- YES, very good sorting here.... // DEBUG fix js so it can sort this -->
<td>{{book.pubdate.year}}</td>
</tr>
{% endfor %}
</table>

View File

@ -0,0 +1,38 @@
{% extends "base.html" %}
{% block content %}
<h1>{{Series}} </h1>
<table id="books" class="highlight centered">
<tr>
<!--When a header is clicked, run the sortTable function, with a parameter, 0 for sorting by names, 1 for sorting by country:-->
<th class="title" onclick="sortTable(0)">Title</th>
<th class="author" onclick="sortTable(1)">Author</th>
<th class="rating" onclick="sortTable(2)">Rating</th>
<th class="tags" onclick="sortTable(3)">Tags</th>
<th class="added" onclick="sortTable(4)">Added</th>
</tr>
{% for book in books %}
<tr>
<td><a href="{{ book.get_absolute_url }}">{{ book.title }}</a></td>
<td>{{book.author_sort}}</td>
<td> {% for rating in book.rating.all %}
{{rating}}
{% endfor %}
</td>
<td>
{% for tag in book.tags.all %}
{{tag}},
{% endfor %}
</td>
<td>{{book.timestamp}}</td>
</tr>
{% endfor %}
</table>
{% endblock %}

View File

@ -0,0 +1,17 @@
{% extends "base.html" %}
{% block content %}
<h1>Author List</h1>
{% if series_list %}
<ul>
{% for series in series_list %}
<li>
<a href="{{ series.get_absolute_url }}">{{ series.name }}</a>
</li>
{% endfor %}
</ul>
{% else %}
<p>There are no series in the library.</p>
{% endif %}
{% endblock %}