Adds review box to main page layout
This commit is contained in:
@ -2,31 +2,55 @@
|
||||
{% load fr_display %}
|
||||
{% block content %}
|
||||
|
||||
<div>
|
||||
{% for activity in activities %}
|
||||
<div class="block">
|
||||
{% include 'snippets/status.html' with status=activity %}
|
||||
<div class="columns">
|
||||
<div class="column">
|
||||
<h2 class="title is-3">Recent Books</h2>
|
||||
<div class="tabs is-small is-toggle">
|
||||
<ul>
|
||||
{% for book in user_books|slice:3 %}
|
||||
<li class="{% if forloop.first %}is-active{% endif %}" data-id="tab-book-{{ book.id }}">
|
||||
<label for="book-{{ book.id }}" onclick="tabChange(event)"><a>{% include 'snippets/book_cover.html' with book=book size="medium" %}</a></label>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% for book in user_books|slice:3 %}
|
||||
<div>
|
||||
<input class="toggle-control" type="radio" name="recent-books" id="book-{{ book.id }}" {% if forloop.first %}checked{% endif %}>
|
||||
<div class="toggle-content hidden">
|
||||
{% include 'snippets/create_status.html' with book=book %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
<nav class="pagination" role="navigation" aria-label="pagination">
|
||||
{% if prev %}
|
||||
<p class="pagination-previous">
|
||||
<a href="{{ prev }}">
|
||||
<span class="icon icon-arrow-left"></span>
|
||||
Previous
|
||||
</a>
|
||||
</p>
|
||||
{% endif %}
|
||||
<div class="column is-two-thirds">
|
||||
<h2 class="title is-3">Updates</h2>
|
||||
{% for activity in activities %}
|
||||
<div class="block">
|
||||
{% include 'snippets/status.html' with status=activity %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
{% if next %}
|
||||
<p class="pagination-next">
|
||||
<a href="{{ next }}">
|
||||
Next
|
||||
<span class="icon icon-arrow-right"></span>
|
||||
</a>
|
||||
</p>
|
||||
{% endif %}
|
||||
</nav>
|
||||
<nav class="pagination" role="navigation" aria-label="pagination">
|
||||
{% if prev %}
|
||||
<p class="pagination-previous">
|
||||
<a href="{{ prev }}">
|
||||
<span class="icon icon-arrow-left"></span>
|
||||
Previous
|
||||
</a>
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
{% if next %}
|
||||
<p class="pagination-next">
|
||||
<a href="{{ next }}">
|
||||
Next
|
||||
<span class="icon icon-arrow-right"></span>
|
||||
</a>
|
||||
</p>
|
||||
{% endif %}
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@ -1,14 +1,15 @@
|
||||
{% load fr_display %}
|
||||
|
||||
<div class="level is-mobile">
|
||||
{% for shelf in shelves %}
|
||||
{% if shelf.books %}
|
||||
<div class="container">
|
||||
<div>
|
||||
<h2>{{ shelf.name }}
|
||||
{% if shelf.size > shelf.books|length %}
|
||||
<small>(<a href="/shelf/{{ user | username }}/{{ shelf.identifier }}">See all {{ shelf.size }}</a>)</small>
|
||||
{% endif %}
|
||||
</h2>
|
||||
<div>
|
||||
<div class="level is-mobile">
|
||||
{% for book in shelf.books %}
|
||||
<div>
|
||||
<label for="book-{{ book.id }}-radio">
|
||||
@ -21,3 +22,4 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
@ -1,71 +1,65 @@
|
||||
{% load humanize %}
|
||||
{% load fr_display %}
|
||||
|
||||
<div class="tabs is-boxed">
|
||||
<ul>
|
||||
<li class="is-active" data-id="tab-review-{{ book.id }}" data-category="tab-option-{{ book.id }}">
|
||||
<label for="review-{{ book.id }}" onclick="tabChange(event)"><a>Review</a></label>
|
||||
</li>
|
||||
<li data-id="tab-comment-{{ book.id }}" data-category="tab-option-{{ book.id }}">
|
||||
<label for="comment-{{ book.id}}" onclick="tabChange(event)"><a>Comment</a></label>
|
||||
</li>
|
||||
<li data-id="tab-quotation-{{ book.id }}" data-category="tab-option-{{ book.id }}">
|
||||
<label for="quote-{{ book.id }}" onclick="tabChange(event)"><a>Quote</a></label>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="columns">
|
||||
{% if not hide_cover %}
|
||||
<div class="column is-narrow">
|
||||
{% include 'snippets/book_cover.html' with book=book %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="column">
|
||||
<div class="tabs is-boxed">
|
||||
<ul>
|
||||
<li class="is-active" data-id="tab-review-{{ book.id }}" data-category="tab-option-{{ book.id }}">
|
||||
<label for="review-{{ book.id }}" onclick="tabChange(event)"><a>Review</a></label>
|
||||
</li>
|
||||
<li data-id="tab-comment-{{ book.id }}" data-category="tab-option-{{ book.id }}">
|
||||
<label for="comment-{{ book.id}}" onclick="tabChange(event)"><a>Comment</a></label>
|
||||
</li>
|
||||
<li data-id="tab-quotation-{{ book.id }}" data-category="tab-option-{{ book.id }}">
|
||||
<label for="quote-{{ book.id }}" onclick="tabChange(event)"><a>Quote</a></label>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<input class="toggle-control" type="radio" name="status-tabs" id="review-{{ book.id }}" checked>
|
||||
<input class="toggle-control" type="radio" name="status-tabs-{{ book.id }}" id="review-{{ book.id }}" checked>
|
||||
<form class="toggle-content hidden tab-option-{{ book.id }}" name="review" action="/review/" method="post" id="tab-review-{{ book.id }}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="book" value="{{ book.id }}">
|
||||
<input type="hidden" name="book-{{ book.id }}" value="{{ book.id }}">
|
||||
<div class="control">
|
||||
<label class="label" for="id_name">Title:</label>
|
||||
{{ review_form.name }}
|
||||
<input type="text" name="name" maxlength="255" class="input" required="" id="id_name" placeholder="My review of '{{ book.title }}'">
|
||||
</div>
|
||||
<div class="control">
|
||||
<label class="label" for="id_content">Review:</label>
|
||||
{% include 'snippets/rate_form.html' with book=book %}
|
||||
{{ review_form.content }}
|
||||
<textarea name="content" class="textarea" id="id_content"></textarea>
|
||||
</div>
|
||||
<button class="button is-primary" type="submit">post review</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<input class="toggle-control" type="radio" name="status-tabs" id="comment-{{ book.id }}">
|
||||
<input class="toggle-control" type="radio" name="status-tabs-{{ book.id }}" id="comment-{{ book.id }}">
|
||||
<form class="toggle-content hidden tab-option-{{ book.id }}" name="comment" action="/comment/" method="post" id="tab-comment-{{ book.id }}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="book" value="{{ book.id }}">
|
||||
<input type="hidden" name="book-{{ book.id }}" value="{{ book.id }}">
|
||||
<div class="control">
|
||||
<label class="label" for="id_content">Comment:</label>
|
||||
{{ comment_form.content }}
|
||||
<textarea name="content" class="textarea" id="id_content" placeholder="Some thoughts on '{{ book.title }}'"></textarea>
|
||||
</div>
|
||||
<button class="button is-primary" type="submit">post comment</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<input class="toggle-control" type="radio" name="status-tabs" id="quote-{{ book.id }}">
|
||||
<input class="toggle-control" type="radio" name="status-tabs-{{ book.id }}" id="quote-{{ book.id }}">
|
||||
<form class="toggle-content hidden tab-option-{{ book.id }}" name="quotation" action="/quotate/" method="post" id="tab-quotation-{{ book.id }}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="book" value="{{ book.id }}">
|
||||
<input type="hidden" name="book-{{ book.id }}" value="{{ book.id }}">
|
||||
<div class="control">
|
||||
<label class="label" for="id_quote">Quote:</label>
|
||||
{{ quotation_form.quote }}
|
||||
<textarea name="quote" class="textarea" required="" id="id_quote" placeholder="An except from '{{ book.title }}'"></textarea>
|
||||
</div>
|
||||
<div class="control">
|
||||
<label class="label" for="id_content">Comment:</label>
|
||||
{{ quotation_form.content }}
|
||||
<textarea name="content" class="textarea is-small" id="id_content"></textarea>
|
||||
</div>
|
||||
<button class="button is-primary" type="submit">post quote</button>
|
||||
</form>
|
||||
|
Reference in New Issue
Block a user