put overview/suymmary at bottom of stats tabs list so is shown by default
--- a/ckanext/dga_stats/templates/ckanext/stats/index.html
+++ b/ckanext/dga_stats/templates/ckanext/stats/index.html
@@ -6,31 +6,8 @@
{% 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>
{% if h.check_access('sysadmin') %}
- <section id="activity-counts" class="module-content tab-content">
+ <section id="stats-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">
@@ -55,7 +32,7 @@
<p class="empty">{{ _('No groups') }}</p>
{% endif %}
</section>
- <section id="recent-datasets" class="module-content tab-content">
+ <section id="stats-recent-datasets" class="module-content tab-content">
<h2>{{ _('Recent Datasets') }}</h2>
{% if c.recent_datasets %}
<table class="table table-chunky table-bordered table-striped">
@@ -80,7 +57,7 @@
<p class="empty">{{ _('No groups') }}</p>
{% endif %}
</section>
- <section id="user-access-list" class="module-content tab-content">
+ <section id="stats-user-access-list" class="module-content tab-content">
<h2>{{ _('User Access List') }}</h2>
{% if c.user_access_list %}
<table class="table table-chunky table-bordered table-striped">
@@ -154,31 +131,6 @@
</table>
</section>
- <section id="stats-top-rated" class="module-content tab-content">
- <h2>{{ _('Top Rated Datasets') }}</h2>
- {% if c.top_rated_packages %}
- <table class="table table-chunky table-bordered table-striped">
- <thead>
- <tr>
- <th>Dataset</th>
- <th class="metric">{{ _('Average rating') }}</th>
- <th class="metric">{{ _('Number of ratings') }}</th>
- </tr>
- </thead>
- <tbody>
- {% for package, rating, num_ratings in c.top_rated_packages %}
- <tr>
- <th>{{ h.link_to(package.title or package.name, h.url_for(controller='package', action='read', id=package.name)) }}</th>
- <td class="metric">{{ rating }}</td>
- <td class="metric">{{ num_ratings }}</td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- {% else %}
- <p class="empty">{{ _('No ratings') }}</p>
- {% endif %}
- </section>
<section id="stats-most-edited" class="module-content tab-content">
<h2>{{ _('Most Edited Datasets') }}</h2>
@@ -227,46 +179,6 @@
<p class="empty">{{ _('No groups') }}</p>
{% endif %}
</section>
-{% if False %}
- <section id="stats-top-tags" class="module-content tab-content">
- <h2>{{ _('Top Tags') }}</h2>
- <table class="table table-chunky table-bordered table-striped">
- <thead>
- <tr>
- <th>{{ _('Tag Name') }}</th>
- <th class="metric">{{ _('Number of Datasets') }}</th>
- </tr>
- </thead>
- <tbody>
- {% for tag, num_packages in c.top_tags %}
- <tr>
- <td>{{ h.link_to(tag.name, h.url_for(controller='package', action='search', tags=tag.name)) }}</td>
- <td class="metric">{{ num_packages }}</td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </section>
- <section id="stats-most-owned" class="module-content tab-content">
- <h2>{{ _('Users Owning Most Datasets') }}</h2>
- <table class="table table-chunky table-bordered table-striped">
- <thead>
- <tr>
- <th>{{ _('User') }}</th>
- <th class="metric">{{ _('Number of Datasets') }}</th>
- </tr>
- </thead>
- <tbody>
- {% for user, num_packages in c.top_package_owners %}
- <tr>
- <td class="media">{{ h.linked_user(user) }}</td>
- <td class="metric">{{ num_packages }}</td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </section>
-{% endif %}
<section id="stats-by-org" class="module-content tab-content">
<h2>{{ _('Datasets by Organization') }}</h2>
{% if c.by_org %}
@@ -298,6 +210,29 @@
<p class="empty">{{ _('No groups') }}</p>
{% endif %}
</section>
+ <section id="stats-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>
</article>
{% endblock %}
@@ -306,19 +241,15 @@
<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 active"><a href="#summary" data-toggle="tab">{{ _('Summary') }}</a></li>
{% if h.check_access('sysadmin') %}
- <li class="nav-item"><a href="#activity-counts" data-toggle="tab">{{ _('Site Activity Log') }}</a></li>
- <li class="nav-item"><a href="#recent-datasets" data-toggle="tab">{{ _('Recent Datasets') }}</a></li>
- <li class="nav-item"><a href="#user-access-list" data-toggle="tab">{{ _('User Access List') }}</a></li>
+ <li class="nav-item"><a href="#stats-recent-datasets" data-toggle="tab">{{ _('Recent Datasets') }}</a></li>
+ <li class="nav-item"><a href="#stats-user-access-list" data-toggle="tab">{{ _('User Access List') }}</a></li>
{% endif %}
<li class="nav-item"><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> -->
<li class="nav-item"><a href="#stats-most-edited" data-toggle="tab">{{ _('Most Edited Datasets') }}</a></li>
-<!-- <li class="nav-item"><a href="#stats-top-tags" data-toggle="tab">{{ _('Top Tags') }}</a></li>
- <li class="nav-item"><a href="#stats-most-owned" data-toggle="tab">{{ _('Users Owning Most Datasets') }}</a></li> -->
<li class="nav-item"><a href="#stats-by-org" data-toggle="tab">{{ _('Datasets by Organization') }}</a></li>
+ <li class="nav-item active"><a href="#stats-summary" data-toggle="tab">{{ _('Summary') }}</a></li>
</ul>
</nav>
</section>