mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-23 01:51:08 +00:00
Book page back to usable
This commit is contained in:
parent
7e73bae07d
commit
e1c598b7cf
2 changed files with 34 additions and 46 deletions
|
@ -1,34 +1,10 @@
|
||||||
{% extends 'layout.html' %}
|
{% extends 'layout.html' %}
|
||||||
{% load fr_display %}
|
{% load fr_display %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div id="sidebar">
|
<div class="content-container">
|
||||||
<div>
|
|
||||||
<h2><q>{{ book.title }}</q> and You</h2>
|
|
||||||
<p>{% if shelf %}On shelf <q>{{ shelf.name }}</q>{% endif %}</p>
|
|
||||||
{% include 'snippets/shelve_button.html' with book=book pulldown=True %}
|
|
||||||
|
|
||||||
<div id="tag-cloud">
|
|
||||||
{% for tag in user_tags %}
|
|
||||||
{% include 'snippets/tag.html' with tag=tag user=request.user user_tags=user_tag_names %}
|
|
||||||
{% 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>
|
|
||||||
|
|
||||||
{% for review in user_reviews %}
|
|
||||||
{% include 'snippets/status.html' with status=review hide_book=True depth=1 %}
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="content">
|
|
||||||
<div>
|
|
||||||
<h2><q>{{ book.title }}</q> by
|
<h2><q>{{ book.title }}</q> by
|
||||||
{% include 'snippets/authors.html' with book=book %}</h2>
|
{% include 'snippets/authors.html' with book=book %}</h2>
|
||||||
|
<div>
|
||||||
{% if book.parent_work %}<p>Edition of <a href="/book/{{ book.parent_work.openlibrary_key }}">{{ book.parent_work.title }}</a></p>{% endif %}
|
{% if book.parent_work %}<p>Edition of <a href="/book/{{ book.parent_work.openlibrary_key }}">{{ book.parent_work.title }}</a></p>{% endif %}
|
||||||
<div class="book-preview">
|
<div class="book-preview">
|
||||||
|
|
||||||
|
@ -47,24 +23,32 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{% include 'snippets/tabs.html' with tabs=feed_tabs active_tab=active_tab path=path %}
|
<div class="content-container">
|
||||||
<div class="reviews">
|
<h2>Leave a review</h2>
|
||||||
<h2>Reviews</h2>
|
|
||||||
{% if not reviews %}
|
|
||||||
<p>No reviews yet!</p>
|
|
||||||
{% endif %}
|
|
||||||
<form class="review-form" name="review" action="/review/" method="post">
|
<form class="review-form" name="review" action="/review/" method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<input type="hidden" name="book" value="{{ book.openlibrary_key }}"></input>
|
<input type="hidden" name="book" value="{{ book.openlibrary_key }}"></input>
|
||||||
{{ review_form.as_p }}
|
{{ review_form.as_p }}
|
||||||
<button type="submit">Post review</button>
|
<button type="submit">Post review</button>
|
||||||
</form>
|
</form>
|
||||||
<p>Average rating: {{ rating | stars }}</p>
|
|
||||||
{% for review in reviews %}
|
|
||||||
{% include 'snippets/status.html' with status=review hide_book=True depth=1 %}
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="content-container tabs">
|
||||||
|
{% include 'snippets/tabs.html' with tabs=feed_tabs active_tab=active_tab path=path %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% if not reviews %}
|
||||||
|
<div class="content-container">
|
||||||
|
<p>No reviews yet!</p>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% for review in reviews %}
|
||||||
|
<div class="content-container">
|
||||||
|
{% include 'snippets/status.html' with status=review hide_book=True depth=1 %}
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
|
@ -331,7 +331,11 @@ def book_page(request, book_identifier, tab='friends'):
|
||||||
'user_tag_names': user_tags.values_list('identifier', flat=True),
|
'user_tag_names': user_tags.values_list('identifier', flat=True),
|
||||||
'review_form': review_form,
|
'review_form': review_form,
|
||||||
'tag_form': tag_form,
|
'tag_form': tag_form,
|
||||||
'feed_tabs': ['friends', 'local', 'federated'],
|
'feed_tabs': [
|
||||||
|
{'id': 'friends', 'display': 'Friends'},
|
||||||
|
{'id': 'local', 'display': 'Local'},
|
||||||
|
{'id': 'federated', 'display': 'Federated'}
|
||||||
|
],
|
||||||
'active_tab': tab,
|
'active_tab': tab,
|
||||||
'path': '/book/%s' % book_identifier,
|
'path': '/book/%s' % book_identifier,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue