teh publish button again
[redakcja.git] / apps / catalogue / templates / catalogue / book_detail.html
1 {% extends "catalogue/base.html" %}
2 {% load comments i18n %}
3
4 {% block leftcolumn %}
5
6 <a href="{% url catalogue_book_edit book.slug %}">{% trans "edit" %}</a>
7     <h1>{{ book.title }}</h1>
8
9 <table>
10     {% for c in chunks %}
11         <tr class="chunk-{{ c.grade }}">
12         <td><a target="_blank" href="{{ c.chunk.get_absolute_url }}">{{ c.chunk.title }}</a></td>
13         <td>{% for fix in c.fix %}
14
15                 {% ifequal fix "wl" %}<span class="fix"
16                     title="{% trans "add basic document structure" %}"
17                     >&lt;/&gt;</span>{% endifequal %}
18
19                 {% ifequal fix "bad-master" %}<span class="fix"
20                     title='{% trans "change master tag to" %} "{{ first_master }}"'
21                     >master</span>{% endifequal %}
22
23                 {% ifequal fix "trim-begin" %}<span class="fix"
24                     title="{% trans "add begin trimming tag" %}"
25                     >&#x2701;</span>{% endifequal %}
26
27                 {% ifequal fix "trim-end" %}<span class="fix"
28                     title="{% trans "add end trimming tag" %}"
29                     >&#x2703;</span>{% endifequal %}
30
31             {% endfor %}
32
33             {% ifequal c.grade "plain" %}
34                 <span class="fix-info">{% trans "unstructured text" %}</span>
35             {% endifequal %}
36
37             {% ifequal c.grade "xml" %}
38                 <span class="fix-info">{% trans "unknown XML" %}</span>
39             {% endifequal %}
40
41             {% ifequal c.grade "wl-broken" %}
42                 <span class="fix-info">{% trans "broken document" %}</span>
43             {% endifequal %}
44
45         </td>
46         <td><a href="{% url catalogue_chunk_edit book.slug c.chunk.slug%}">[{% trans "edit" %}]</a></td>
47         <td>{% if c.chunk.publishable %}P{% endif %}</td>
48         <td>{% if c.chunk.user.is_authenticated %}
49                 <a href="{% url catalogue_user c.chunk.user.username %}">{{ c.chunk.user }}</a>
50             {% endif %}</td>
51         <td><a href="{% url catalogue_chunk_add book.slug c.chunk.slug %}">[+]</a></td>
52         </tr>
53     {% endfor %}
54     {% if need_fixing %}
55         <tr><td></td><td>
56             <form method="POST" action="">
57                 {% csrf_token %}
58                 {% if choose_master %}
59                     {{ form.master }}
60                 {% endif %}
61                 <button type="submit">{% trans "Apply fixes" %}</button>
62             </form>
63         </td></tr>
64     {% endif %}
65 </table>
66
67 <p><a href="{% url catalogue_book_append book.slug %}">{% trans "Append to other book" %}</a></p>
68
69 <p>{% trans "Last published" %}: {{ book.last_published }}</p>
70
71 {% if publishable %}
72     <p>
73     <a href="{% url catalogue_book_xml book.slug %}">{% trans "Full XML" %}</a><br/>
74     <a target="_blank" href="{% url catalogue_book_html book.slug %}">{% trans "HTML version" %}</a><br/>
75     <a href="{% url catalogue_book_txt book.slug %}">{% trans "TXT version" %}</a><br/>
76     {% comment %}
77     <a href="{% url catalogue_book_epub book.slug %}">{% trans "EPUB version" %}</a><br/>
78     <a href="{% url catalogue_book_pdf book.slug %}">{% trans "PDF version" %}</a><br/>
79     {% endcomment %}
80     </p>
81
82     {% if user.is_authenticated %}
83         <!--
84         Angel photos:
85         Angels in Ely Cathedral (http://www.flickr.com/photos/21804434@N02/4483220595/) /
86         mira66 (http://www.flickr.com/photos/21804434@N02/) /
87         CC BY 2.0 (http://creativecommons.org/licenses/by/2.0/)
88         -->
89         <form method="POST" action="{% url catalogue_publish book.slug %}">{% csrf_token %}
90             <img src="{{ STATIC_URL }}img/angel-left.png" style="vertical-align: middle" />
91             <button id="publish-button" type="submit">
92                 <span>{% trans "Publish" %}</span></button>
93             <img src="{{ STATIC_URL }}img/angel-right.png" style="vertical-align: middle" />
94             </form>
95     {% else %}
96         <a href="{% url login %}">{% trans "Log in to publish." %}</a>
97     {% endif %}
98 {% else %}
99     <p>{% trans "This book can't be published yet, because:" %}</p>
100     <ul><li>{{ publishable_error }}</li></ul>
101 {% endif %}
102
103 {% endblock leftcolumn %}
104
105 {% block rightcolumn %}
106 {% render_comment_list for book %}
107 {% with book.get_absolute_url as next %}
108     {% render_comment_form for book %}
109 {% endwith %}
110
111 {% endblock rightcolumn %}