Audience and thema editing.
[redakcja.git] / src / documents / templates / documents / book_detail.html
index 268fb57..caa3de5 100644 (file)
@@ -94,9 +94,9 @@
         Pobierz okładkę:
         <div class="input-group">
           <select class="form-control" name='cover_class'>
-            <option value="default">tradycyjna</option>
-           <option value="m">nowa</option>
+           <option value="default">nowa</option>
            <option value="m-label">nowa + label</option>
+            <option value="legacy">dawna</option>
           </select><br>
           <input class="form-control" name="width" type="number" required value="600" size="3" placeholder="szer.">
           <input class="form-control" name="height" type="number" size="3" placeholder="wys.">
 
         {% if perms.depot.add_legimibookpublish %}
           <hr>
-          <form method="post" action="{% url 'depot_legimi_publish' book.pk %}">
-            {% csrf_token %}
-            <button class="btn btn-primary" type="submit">Opublikuj na Legimi<br><small>w kategorii: {{ doc.book_info.legimi|default_if_none:doc.book_info.epoch }}</small></button>
-            {% with llp=book.last_legimi_publish %}
-              {% if llp %}
-                {{ llp.created_at }} &rarr;
-                {{ llp.started_at }} &rarr;
-                {{ llp.finished_at }}
-                ({{ llp.get_status_display }})
-                <!-- {{ llp.id }} -->
-              {% endif %}
-            {% endwith %}
-          </form>
+          {% with thema_main=doc.book_info.thema_main thema=doc.book_info.thema %}
+            {% if thema_main or thema %}
+              <form method="post" action="{% url 'depot_legimi_publish' book.pk %}">
+                {% csrf_token %}
+                <button class="btn btn-primary" type="submit">
+                  Opublikuj na Legimi<br><small>w kategorii:
+                  {% if thema_main %}
+                    <tt>{{ thema_main }}</tt>
+                  {% endif %}
+                  {% for t in thema %}
+                    {% if forloop.first and thema_main %}oraz: {% endif %}
+                    <tt>{{ t }}</tt>
+                    {% if not forloop.last %}, {% endif %}
+                  {% endfor %}
+                  {% if not thema_main %}
+                    <span class="badge badge-secondary" title="Nie ustalono głównej kategorii Thema">&nbsp;*&nbsp;</small>
+                  {% endif %}
+                  </small></button>
+                {% with llp=book.last_legimi_publish %}
+                  {% if llp %}
+                    {{ llp.created_at }} &rarr;
+                    {{ llp.started_at }} &rarr;
+                    {{ llp.finished_at }}
+                    ({{ llp.get_status_display }})
+                    <!-- {{ llp.id }} -->
+                  {% endif %}
+                {% endwith %}
+              </form>
+            {% else %}
+              <div class="alert alert-warning">Nie można opublikować na Legimi, ponieważ nie ustalono kategorii Thema.</div>
+            {% endif %}
+          {% endwith %}
         {% endif %}
 
     {% else %}
             <th>{% trans "characters (with footnotes)" %}</th>
             <th>{% trans "words" %}</th>
             <th>{% trans "words (with footnotes)" %}</th>
+            <th>{% trans "wiersze (+ inne znaki)" %}</th>
+            <th>{% trans "wiersze (+ inne znaki, z przypisami)" %}</th>
           </tr>
         </thead>
         <tbody>