Add summary and activity screens, remove private datasets from counts
[ckanext-dga-stats.git] / ckanext / dga_stats / templates / ckanext / stats / index.html
blob:a/ckanext/dga_stats/templates/ckanext/stats/index.html -> blob:b/ckanext/dga_stats/templates/ckanext/stats/index.html
--- a/ckanext/dga_stats/templates/ckanext/stats/index.html
+++ b/ckanext/dga_stats/templates/ckanext/stats/index.html
@@ -6,6 +6,55 @@
 
 {% block primary_content %}
   <article class="module">
+    <section id="summary" class="module-content tab-content">
+      <h2>{{ _('Summary') }}</h2>
+      {% if c.summary_stats %}
+        <table class="table table-chunky table-bordered table-striped">
+          <thead>
+            <tr>
+              <th>{{ _('Measure') }}</th>
+              <th class="metric">{{ _('Value') }}</th>
+            </tr>
+          </thead>
+          <tbody>
+            {% for measure,value in c.summary_stats %}
+              <tr>
+                <td>{{measure}}</td>
+                <td class="metric">{{ value }}</td>
+              </tr>
+            {% endfor %}
+          </tbody>
+        </table>
+      {% else %}
+        <p class="empty">{{ _('No groups') }}</p>
+      {% endif %}
+    </section>
+    <section id="activity-counts" class="module-content tab-content">
+      <h2>{{ _('Site Activity Log') }}</h2>
+      {% if c.activity_counts %}
+        <table class="table table-chunky table-bordered table-striped">
+          <thead>
+            <tr>
+              <th>{{ _('Month') }}</th>
+              <th>{{ _('Activity Type') }}</th>
+              <th class="metric">{{ _('Count') }}</th>
+            </tr>
+          </thead>
+          <tbody>
+            {% for month, type, count in c.activity_counts %}
+              <tr>
+                <td>{{ month }}</td>
+                <td>{{ type }}</td>
+                <td class="metric">{{ count }}</td>
+              </tr>
+            {% endfor %}
+          </tbody>
+        </table>
+      {% else %}
+        <p class="empty">{{ _('No groups') }}</p>
+      {% endif %}
+    </section>
+
     <section id="stats-total-datasets" class="module-content tab-content active">
       <h2>{{ _('Total number of Datasets') }}</h2>
 
@@ -104,6 +153,29 @@
       {% endif %}
     </section>
 
+    <section id="stats-largest-groups" class="module-content tab-content">
+      <h2>{{ _('Largest Groups') }}</h2>
+      {% if c.largest_groups %}
+        <table class="table table-chunky table-bordered table-striped">
+          <thead>
+            <tr>
+              <th>{{ _('Group') }}</th>
+              <th class="metric">{{ _('Number of datasets') }}</th>
+            </tr>
+          </thead>
+          <tbody>
+            {% for group, num_packages in c.largest_groups %}
+              <tr>
+                <td>{{ h.link_to(group.title or group.name, h.url_for(controller='group', action='read', id=group.name)) }}</td>
+                <td class="metric">{{ num_packages }}</td>
+              </tr>
+            {% endfor %}
+          </tbody>
+        </table>
+      {% else %}
+        <p class="empty">{{ _('No groups') }}</p>
+      {% endif %}
+    </section>
     <section id="stats-largest-groups" class="module-content tab-content">
       <h2>{{ _('Largest Groups') }}</h2>
       {% if c.largest_groups %}
@@ -175,6 +247,8 @@
     <h2 class="module-heading"><i class="icon-bar-chart icon-medium"></i> {{ _('Statistics Menu') }}</h2>
     <nav data-module="stats-nav">
       <ul class="unstyled nav nav-simple">
+        <li class="nav-item"><a href="#summary" data-toggle="tab">{{ _('Summary') }}</a></li>
+        <li class="nav-item"><a href="#activity-counts" data-toggle="tab">{{ _('Site Activity Log') }}</a></li>
         <li class="nav-item active"><a href="#stats-total-datasets" data-toggle="tab">{{ _('Total Number of Datasets') }}</a></li>
         <li class="nav-item"><a href="#stats-dataset-revisions" data-toggle="tab">{{ _('Dataset Revisions per Week') }}</a></li>
         <li class="nav-item"><a href="#stats-top-rated" data-toggle="tab">{{ _('Top Rated Datasets') }}</a></li>
@@ -195,6 +269,6 @@
 See: http://stackoverflow.com/questions/10208062/using-flot-with-bootstrap-ie8-incompatibility
 #}
 {% resource "vendor/block_html5_shim" %}
-{% resource "ckanext_stats/stats" %}
-{% endblock %}
-
+{% resource "ckanext_dga_stats/stats" %}
+{% endblock %}
+