fixes
[redakcja.git] / src / documents / templates / documents / book_detail.html
index d9b06c7..55da225 100644 (file)
 
        </div>
        <div class="col-md-4">
-         W katalogu:
-         {{ book.catalogue_book }}
+          {% with cbook=book.catalogue_book %}
+            {% if cbook %}
+             W katalogu:
+             <a href="{% url 'catalogue_book' cbook.slug %}">{{ cbook }}</a>
+            {% endif %}
+          {% endwith %}
        </div>
       </div>
     </div>
@@ -125,4 +129,34 @@ OkÅ‚adka w rozmiarze
 
 </div>
   </div>
+</div>
+</div>
+
+{% if doc %}
+  <div class="card mt-4">
+    <div class="card-header">
+      <h2>{% trans "Statistics" %}</h2>
+    </div>
+    <div class="card-body">
+      <table class="table">
+        <thead>
+          <tr>
+            <th>
+              {% trans "book" %}
+            </th>
+            <th>{% trans "characters" %}</th>
+            <th>{% trans "characters (with footnotes)" %}</th>
+            <th>{% trans "words" %}</th>
+            <th>{% trans "words (with footnotes)" %}</th>
+          </tr>
+        </thead>
+        <tbody>
+          {% with stats=book.wldocument.get_statistics %}
+            {% include 'documents/book_stats.html' with book=book stats=stats depth=0 %}
+          {% endwith %}
+        </tbody>
+      </table>
+    </div>
+  </div>
+{% endif %}
 {% endblock content %}