assigning tickets, new ui
[redakcja.git] / apps / wiki / templates / wiki / book_detail.html
index ee645f1..347b7a3 100755 (executable)
 
 {% block leftcolumn %}
 
-    <h1>{{ object.title }}</h1>
+<a href="{% url wiki_book_edit book.slug %}">{% trans "edit" %}</a>
+    <h1>{{ book.title }}</h1>
 
-    <table>
-    {% for chunk in object.chunk_set.all %}
-        <tr><td>{{ chunk.number }}</td><td>{{ chunk.slug }}</td></tr>
+<table>
+    {% for c in chunks %}
+        <tr class="chunk-{{ c.grade }}">
+        <td><a target="_blank" href="{{ c.chunk.get_absolute_url }}">{{ c.chunk.comment }}</a></td>
+        <td>{% for fix in c.fix %}
+
+                {% ifequal fix "wl" %}<span class="fix"
+                    title="{% trans "add basic document structure" %}"
+                    >&lt;/&gt;</span>{% endifequal %}
+
+                {% ifequal fix "bad-master" %}<span class="fix"
+                    title='{% trans "change master tag to" %} "{{ first_master }}"'
+                    >master</span>{% endifequal %}
+
+                {% ifequal fix "trim-begin" %}<span class="fix"
+                    title="{% trans "add begin trimming tag" %}"
+                    >&#x2701;</span>{% endifequal %}
+
+                {% ifequal fix "trim-end" %}<span class="fix"
+                    title="{% trans "add end trimming tag" %}"
+                    >&#x2703;</span>{% endifequal %}
+
+            {% endfor %}
+
+            {% ifequal c.grade "plain" %}
+                <span class="fix-info">{% trans "unstructured text" %}</span>
+            {% endifequal %}
+
+            {% ifequal c.grade "xml" %}
+                <span class="fix-info">{% trans "unknown XML" %}</span>
+            {% endifequal %}
+
+            {% ifequal c.grade "wl-broken" %}
+                <span class="fix-info">{% trans "broken document" %}</span>
+            {% endifequal %}
+
+        </td>
+        <td><a href="{% url wiki_chunk_edit book.slug c.chunk.slug%}">[{% trans "edit" %}]</a></td>
+        <td>{% if c.chunk.publishable %}P{% endif %}</td>
+        <td>{% if c.chunk.user.is_authenticated %}
+                <a href="{% url wiki_user c.chunk.user.username %}">{{ c.chunk.user }}</a>
+            {% endif %}</td>
+        <td><a href="{% url wiki_chunk_add book.slug c.chunk.slug %}">[+]</a></td>
+        </tr>
     {% endfor %}
-    </table>
+    {% if need_fixing %}
+        <tr><td></td><td>
+            <form method="POST" action="">
+                {% if choose_master %}
+                    {{ form.master }}
+                {% endif %}
+                <button type="submit">{% trans "Apply fixes" %}</button>
+            </form>
+        </td></tr>
+    {% endif %}
+</table>
+
+<p><a href="{% url wiki_book_append book.slug %}">{% trans "Append to other book" %}</a></p>
+
+<p>{% trans "Last published" %}: {{ book.last_published }}</p>
+
+{% if book.publishable %}
+    <p>
+    <a href="{% url wiki_book_xml book.slug %}">{% trans "Full XML" %}</a><br/>
+    <a target="_blank" href="{% url wiki_book_html book.slug %}">{% trans "HTML version" %}</a><br/>
+    <a href="{% url wiki_book_txt book.slug %}">{% trans "TXT version" %}</a><br/>
+    {% comment %}
+    <a href="{% url wiki_book_epub book.slug %}">{% trans "EPUB version" %}</a><br/>
+    <a href="{% url wiki_book_pdf book.slug %}">{% trans "PDF version" %}</a><br/>
+    {% endcomment %}
+    </p>
+
+    <!--
+    Angel photos:
+    Angels in Ely Cathedral (http://www.flickr.com/photos/21804434@N02/4483220595/) /
+    mira66 (http://www.flickr.com/photos/21804434@N02/) /
+    CC BY 2.0 (http://creativecommons.org/licenses/by/2.0/)
+    -->
+    <form method="POST" action="{% url wiki_publish book.slug %}">{% csrf_token %}
+        <img src="{{ STATIC_URL }}img/angel-left.png" style="vertical-align: middle" />
+        <button id="publish-button" type="submit">
+            <span>{% trans "Publish" %}</span></button>
+        <img src="{{ STATIC_URL }}img/angel-right.png" style="vertical-align: middle" />
+        </form></form></p>
+{% else %}
+    {% trans "This book cannot be published yet" %}
+{% endif %}
 
 {% endblock leftcolumn %}
 
 {% block rightcolumn %}
+
+
 {% endblock rightcolumn %}