Cleanup
[wolnelektury.git] / src / reporting / templates / reporting / main.html
old mode 100755 (executable)
new mode 100644 (file)
index 46d49c9..5d121ce
@@ -1,48 +1,97 @@
-{% extends "base.html" %}
-{% load i18n %}
+{% extends "base_simple.html" %}
+{% load i18n l10n %}
 {% load reporting_stats catalogue_tags %}
 
+{% block settings %}
+  {% load title %}
+  {% trans "Reports" as title %}
+  {% title title %}
+{% endblock %}
+
 {% block titleextra %}{% trans "Reports" %}{% endblock %}
 
 {% block bodyid %}reports-stats{% endblock %}
 
 
 {% block body %}
-    <h1>Statystyka</h1>
-
-    <div class="normal-text">
+  <h1>Statystyka</h1>
 
+  <div class="normal-text">
     <h3>Audiobooki</h3>
 
     <table class="stats">
-        <tr><th>Utwory</th></tr>
-        <tr><td>Utwory:</td><td>{% count_books %}</td></tr>
-        <tr><td>Niezależne książki:</td><td>{% count_books_root %}</td></tr>
-        <tr><td>Utwory nadrzędne:</td><td>{% count_books_parent %}</td></tr>
-        <tr><td>Wszystkie utwory:</td><td>{% count_books_all %}</td></tr>
-
-        <tr><th>Media</th><th>Liczba</th><th>Rozmiar</th><th>Do wymiany</th></tr>
-        {% for mt in media_types %}
-            <tr><td>{{ mt.type }}:</td>
-                <td>{{ mt.count }}</td>
-                <td>{{ mt.size|filesizeformat }}</td>
-                <td>{{ mt.deprecated }}
-                    {% for m in mt.deprecated_files %}
-                        <br/><a href="{{ m.book.get_absolute_url }}">{% book_title m.book %}: {{ m }}</a>
-                    {% endfor %}
-                </td>
-            </tr>
-        {% endfor %}
+      <tr><th>Utwory</th></tr>
+      <tr><td>Utwory:</td><td>{% count_books %}</td></tr>
+      <tr><td>Niezależne książki:</td><td>{% count_books_root %}</td></tr>
+      <tr><td>Utwory nadrzędne:</td><td>{% count_books_parent %}</td></tr>
+      <tr><td>Wszystkie utwory:</td><td>{% count_books_all %}</td></tr>
+
+      <tr><th>Media</th><th>Liczba</th><th>Rozmiar</th><th>Do wymiany</th></tr>
+      {% for mt in media_types %}
+        <tr>
+          <td>{{ mt.type }}:</td>
+          <td>{{ mt.count }}</td>
+          <td>{{ mt.size|filesizeformat }}</td>
+          <td>
+            {{ mt.deprecated }}
+            {% for m in mt.deprecated_files %}
+              <br/><a href="{{ m.book.get_absolute_url }}">{% book_title m.book %}: {{ m }}</a>
+            {% endfor %}
+          </td>
+        </tr>
+      {% endfor %}
     </table>
 
     <h3>Licencje</h3>
     <ul>
-    {% for license, license_description in licenses %}
+      {% for license, license_description in licenses %}
         <li>{{ license }} ({{ license_description }})</li>
-    {% endfor %}
+      {% endfor %}
     </ul>
 
+    {% localize off %}
+    <h3>Aktualność plików</h3>
+    <table border="1">
+      <tr>
+        {% for e in etags %}
+          <td>
+            <div
+                style="width: 80px; overflow: hidden; text-overflow: ellipsis; padding: 2px;"
+                title="{{ e.field }}"
+            >
+              {{ e.field }}
+            </div>
+          </td>
+        {% endfor %}
+      </tr>
+      <tr>
+        {% for e in etags %}
+          <td>
+            <div style="width: 80px; overflow: hidden; text-overflow: ellipsis; padding: 2px;">
+              {{ e.etag }}
+            </div>
+          </td>
+        {% endfor %}
+      </tr>
+      <tr>
+        {% for e in etags %}
+          <td style="vertical-align: top">
+            {% for et in e.tags %}
+              <div
+                  style="position: relative; width:80px; overflow:hidden; text-overflow: ellipsis; padding: 2px;"
+                  title="{{ et.perc }}%"
+              >
+                <span style="z-index: 0; background: {% if et.tag == e.etag %}#92BD39{% elif et.tag == '' %}#FF4C54{% else %}#FFA500{% endif %}; position: absolute;left:0; top:0; bottom: 0; width: {{ et.perc }}%;"></span>
+                <span style="position: relative; z-index: 1">
+                  {{ et.count }} {{ et.tag }}
+                </span>
+              </div>
+            {% endfor %}
+          </td>
+        {% endfor %}
+      </tr>
+    </table>
+    {% endlocalize %}
 
-    </div>
-
+  </div>
 {% endblock %}