diff --git a/bookwyrm/static/css/format.css b/bookwyrm/static/css/format.css index d78c294b..b0e9ec2b 100644 --- a/bookwyrm/static/css/format.css +++ b/bookwyrm/static/css/format.css @@ -54,6 +54,29 @@ input.toggle-control:checked ~ .toggle-content { content: '\e9d7'; } +/* stars in a review form */ +.form-rate-stars:hover .icon:before { + content: '\e9d9'; +} +.form-rate-stars input + .icon:before { + content: '\e9d9'; +} +.form-rate-stars input:checked + .icon:before { + content: '\e9d9'; +} +.form-rate-stars input:checked + * ~ .icon:before { + content: '\e9d7'; +} +.form-rate-stars:hover label.icon:before { + content: '\e9d9'; +} +.form-rate-stars label.icon:hover:before { + content: '\e9d9'; + } +.form-rate-stars label.icon:hover ~ label.icon:before{ + content: '\e9d7'; +} + /* --- BOOK COVERS --- */ .book-cover { diff --git a/bookwyrm/static/js/shared.js b/bookwyrm/static/js/shared.js index a1344957..41d2e703 100644 --- a/bookwyrm/static/js/shared.js +++ b/bookwyrm/static/js/shared.js @@ -47,9 +47,9 @@ function tabChange(e) { var tabs = target.parentElement.children; for (i = 0; i < tabs.length; i++) { if (tabs[i].getAttribute('data-id') == identifier) { - tabs[i].className += ' active'; + tabs[i].className += ' is-active'; } else { - tabs[i].className = tabs[i].className.replace('active', ''); + tabs[i].className = tabs[i].className.replace('is-active', ''); } } diff --git a/bookwyrm/templates/book.html b/bookwyrm/templates/book.html index 87a2f027..5ea05e42 100644 --- a/bookwyrm/templates/book.html +++ b/bookwyrm/templates/book.html @@ -1,22 +1,26 @@ {% extends 'layout.html' %} {% load fr_display %} {% block content %} -
-

- {% include 'snippets/book_titleby.html' with book=book %} - {% if request.user.is_authenticated %} - edit - - Edit Book - - - {% endif %} -

+
+
+

+ {% include 'snippets/book_titleby.html' with book=book %} +

-
+ {% if request.user.is_authenticated %} + + {% endif %} +
-
+
+
{% include 'snippets/book_cover.html' with book=book size=large %} {% include 'snippets/rate_action.html' with user=request.user book=book %} {% include 'snippets/shelve_button.html' %} @@ -25,69 +29,66 @@
{% csrf_token %} {{ cover_form.as_p }} - +
{% endif %} -
- {% for field in info_fields %} +
+ {% for field in info_fields %} {% if field.value %}
{{ field.name }}:
{{ field.value }}
{% endif %} - {% endfor %} + {% endfor %}
-

{{ active_tab }} rating: {% include 'snippets/stars.html' with rating=rating %}

+
+

{% include 'snippets/stars.html' with rating=rating %}

- {% include 'snippets/book_description.html' %} + {% include 'snippets/book_description.html' %} - {% if book.parent_work.edition_set.count > 1 %} -

{{ book.parent_work.edition_set.count }} editions

- {% endif %} + {% if book.parent_work.edition_set.count > 1 %} +

{{ book.parent_work.edition_set.count }} editions

+ {% endif %} +
{% if request.user.is_authenticated %} -
+
{% include 'snippets/create_status.html' with book=book hide_cover=True %}
-
+

Tags

{% csrf_token %} - - + +
-
+ {% endif %} + +
{% for tag in tags %} {% include 'snippets/tag.html' with book=book tag=tag user_tags=user_tags %} {% endfor %}
- {% endif %}
-{% if request.user.is_authenticated %} -
- {% include 'snippets/tabs.html' with tabs=feed_tabs active_tab=active_tab path=path %} -
-{% endif %} - {% if not reviews %} -
+

No reviews yet!

{% endif %} {% for review in reviews %} -
+
{% include 'snippets/status.html' with status=review hide_book=True depth=1 %}
{% endfor %} diff --git a/bookwyrm/templates/snippets/book_description.html b/bookwyrm/templates/snippets/book_description.html index a14cea6e..e686dac2 100644 --- a/bookwyrm/templates/snippets/book_description.html +++ b/bookwyrm/templates/snippets/book_description.html @@ -1,6 +1,6 @@ {% load fr_display %} {% if book.description %} -
{{ book.description | description }}
+
{{ book.description | description }}
{% elif book.parent_work.description %}
{{ book.parent_work.description | description }}
{% endif %} diff --git a/bookwyrm/templates/snippets/create_status.html b/bookwyrm/templates/snippets/create_status.html index 1bbad700..ca68a26a 100644 --- a/bookwyrm/templates/snippets/create_status.html +++ b/bookwyrm/templates/snippets/create_status.html @@ -1,43 +1,53 @@ {% load humanize %} {% load fr_display %} -
-
- Review -
-
- Comment -
-
- Quote -
+
+
-
+
{% if not hide_cover %} -
+
{% include 'snippets/book_cover.html' with book=book %}
{% endif %} -
+ + {% csrf_token %} - {% include 'snippets/rate_form.html' with book=book %} - {{ review_form.as_p }} - +
+ + {{ review_form.name }} +
+
+ + {% include 'snippets/rate_form.html' with book=book %} + {{ review_form.content }} +
+
- -
diff --git a/bookwyrm/templates/snippets/rate_form.html b/bookwyrm/templates/snippets/rate_form.html index a3ab3499..7725aabb 100644 --- a/bookwyrm/templates/snippets/rate_form.html +++ b/bookwyrm/templates/snippets/rate_form.html @@ -1,9 +1,9 @@ {% load fr_display %} Rating -
- +
+ {% for i in '12345'|make_list %} - +