parent
13b512b569
commit
870d0b9697
15 changed files with 205 additions and 37 deletions
|
@ -6,18 +6,23 @@
|
|||
<div class="book-preview">
|
||||
{% include 'snippets/book.html' with book=book size=large rating=rating description=True %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="reviews">
|
||||
<h2>Reviews</h2>
|
||||
{% if not reviews %}
|
||||
<p>No reviews yet!</p>
|
||||
{% endif %}
|
||||
<div id="tag-cloud">
|
||||
{% for tag in tags %}
|
||||
{% include 'snippets/tag.html' with tag=tag user=request.user %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<form class="tag-form" name="tag" action="/tag/" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="book" value="{{ book.openlibrary_key }}"></input>
|
||||
{{ tag_form.as_p }}
|
||||
<button type="submit">Add tag</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="reviews">
|
||||
<h2>Reviews</h2>
|
||||
{% if not reviews %}
|
||||
<p>No reviews yet!</p>
|
||||
{% endif %}
|
||||
<form class="review-form" name="review" action="/review/" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="book" value="{{ book.openlibrary_key }}"></input>
|
||||
|
|
20
fedireads/templates/snippets/tag.html
Normal file
20
fedireads/templates/snippets/tag.html
Normal file
|
@ -0,0 +1,20 @@
|
|||
<div class="tag">
|
||||
{{ tag.name }}
|
||||
{% if tag.name in user_tags %}
|
||||
<form class="tag-form" name="tag" action="/untag/" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="book" value="{{ book.openlibrary_key }}"></input>
|
||||
<input type="hidden" name="name" value="{{ tag.name }}"></input>
|
||||
<button type="submit">x</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<form class="tag-form" name="tag" action="/tag/" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="book" value="{{ book.openlibrary_key }}"></input>
|
||||
<input type="hidden" name="name" value="{{ tag.name }}"></input>
|
||||
<button type="submit">+</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue