Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Now displaying full summaries in the listing * Added page for editing a section (closes #30) * Section ratings! Closes #20.
- Loading branch information
1 parent
40a06b2
commit 801beb9
Showing
15 changed files
with
252 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block breadcrumbs %} | ||
<a class="section" href="{{ book.get_absolute_url }}">View book</a> | ||
<i class="right angle icon divider"></i> | ||
<a class="section" href="{{ section.get_absolute_url }}">View section</a> | ||
<i class="right angle icon divider"></i> | ||
<div class="active section">Edit section</div> | ||
{% endblock %} | ||
|
||
{% block content %} | ||
{% include 'book_header.html' with book=book only %} | ||
|
||
<div class="ui divider"></div> | ||
|
||
<div class="ui segment"> | ||
<form class="ui form" method="post"> | ||
{% csrf_token %} | ||
<div class="ui fields"> | ||
{% with error=section_form.title.errors %} | ||
<div class="five wide {% if error %}error{% endif %} field"> | ||
<label>Title{% if error %} (REQUIRED){% endif %}</label> | ||
{{ section_form.title }} | ||
</div> | ||
{% endwith %} | ||
<div class="five wide field"> | ||
<label>Subtitle</label> | ||
{{ section_form.subtitle }} | ||
</div> | ||
{% with error=section_form.page_number.errors %} | ||
<div class="one wide {% if error %}error{% endif %} field" | ||
{% if error %}title="{{ error|join:"/" }}"{% endif %}> | ||
<label>Page</label> | ||
{{ section_form.page_number }} | ||
</div> | ||
{% endwith %} | ||
{% with error=author_form.mode.errors %} | ||
<div class="two wide {% if error %}error{% endif %} field" | ||
{% if error %}title="{{ error|join:"/" }}"{% endif %}> | ||
<label>Author mode</label> | ||
{{ author_form.mode }} | ||
</div> | ||
{% endwith %} | ||
<div class="three wide field"> | ||
<label>Author</label> | ||
{{ author_form.author }} | ||
</div> | ||
</div> | ||
<div class="field"> | ||
<label>Summary</label> | ||
{{ section_form.summary }} | ||
</div> | ||
<div class="ui basic center aligned segment"> | ||
<input type="hidden" name="section-rating" | ||
id="section_rating" value="{{ section.rating }}" /> | ||
<div class="ui heart rating editable-rating" | ||
data-rating="{{ section.rating }}"> | ||
</div> | ||
<br /><br /> | ||
<button type="submit" name="submit" | ||
class="ui blue button"> | ||
Submit | ||
</button> | ||
</div> | ||
</form> | ||
</div> | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,46 @@ | ||
<div class="ui middle aligned divided list"> | ||
{% load markdown_filter %} | ||
|
||
|
||
<br /> | ||
<div class="ui vertically divided compact grid"> | ||
{% for section in sections %} | ||
<div class="item"> | ||
<div class="left floated content"> | ||
<div title="Summary" | ||
class="ui icon {% if not section.summary %}red{% endif %} label"> | ||
<i class="browser icon"></i> | ||
</div> | ||
</div> | ||
<div class="right floated content"> | ||
<div class="row"> | ||
<div class="one wide column"> | ||
<div class="ui large circular label">{{ section.get_page_display }}</div> | ||
</div> | ||
<div class="content"> | ||
<div class="header"> | ||
<a href="{{ section.get_absolute_url }}">{{ section.title }}</a> | ||
<a href="{% url 'admin:books_section_change' section.pk %}"> | ||
<i class="edit icon"></i> | ||
<div class="eleven wide column"> | ||
<h4 class="ui header"> | ||
<a href="{{ section.get_absolute_url }}"> | ||
{{ section.title|markdownify_title }} | ||
</a> | ||
</div> | ||
{{ section.subtitle }} | ||
{% if section.authors.count %} | ||
{% if not section.has_default_authors %} | ||
{% include 'author_list.html' with authors=section.authors %} | ||
{% endif %} | ||
{% else %} | ||
(missing author) | ||
<div class="ui heart rating display-rating" data-rating="{{ section.rating }}"> | ||
</div> | ||
<div class="sub header"> | ||
{{ section.subtitle|markdownify_title }} | ||
{% if section.authors.count %} | ||
{% if not section.has_default_authors %} | ||
{% include 'author_list.html' with authors=section.authors %} | ||
{% endif %} | ||
{% else %} | ||
(missing author) | ||
{% endif %} | ||
</div> | ||
</h4> | ||
{% if section.summary %} | ||
{{ section.summary|markdownify }} | ||
{% endif %} | ||
</div> | ||
<div class="three wide right aligned column"> | ||
{{ section.terms.count }} <i class="flag icon"></i> | ||
/ | ||
{{ section.notes.count }} <i class="sticky note icon"></i> | ||
</div> | ||
<div class="one wide right aligned column"> | ||
<a class="ui mini icon {% if not section.summary %}red{% endif %} button" | ||
href="{% url 'edit_section' section.pk %}"> | ||
<i class="edit icon"></i> | ||
</a> | ||
</div> | ||
</div> | ||
{% endfor %} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters