Added metacategories into stat panels for annotations
authordurandn
Mon, 14 Nov 2016 16:15:26 +0100
changeset 241 06c88bfd5c8d
parent 240 e577ff0eaaca
child 242 430188380ba8
Added metacategories into stat panels for annotations
src/iconolab/templates/partials/annotation_stats_panel.html
--- a/src/iconolab/templates/partials/annotation_stats_panel.html	Mon Nov 14 16:15:05 2016 +0100
+++ b/src/iconolab/templates/partials/annotation_stats_panel.html	Mon Nov 14 16:15:26 2016 +0100
@@ -6,6 +6,16 @@
       <dd><span class="badge">{{ annotation.stats.views_count }}</span></dd>
       <dt>Commentaires :</dt>
       <dd><span class="badge">{{ annotation.stats.comments_count }}</span></dd>
+      {% with annotation.stats.metacategoriescountinfo_set.all as annotation_metacategories_infos %}
+        {% if annotation_metacategories_infos %}
+          <dt>.. Métacatégories :</dt>
+          <dd>
+            {% for metacategory_info in annotation_metacategories_infos %}
+              <span class="label label-info">{{metacategory_info.count}} {{metacategory_info.metacategory.label}}</span><br>
+            {% endfor %}
+          </dd>
+        {% endif %}
+      {% endwith %}
       <dt>Révisions soumises :</dt>
       <dd><span class="badge">{{ annotation.stats.submitted_revisions_count }}</span></dd>
       <dt>Révisions acceptées :</dt>
@@ -16,6 +26,7 @@
       <dd><span class="badge {% if annotation.stats.relevant_tags_count > 0 %}badge-warning{% endif %}">{{ annotation.stats.relevant_tags_count }}</span></dd>
       <dt>... dont précis:</dt>
       <dd><span class="badge {% if annotation.stats.accurate_tags_count > 0 %}badge-warning{% endif %}">{{ annotation.stats.accurate_tags_count }}</span></dd>
+      
     </dl>
   </div>
 </div>
\ No newline at end of file