--- a/ckanext/dga_stats/templates/ckanext/stats/index.html +++ b/ckanext/dga_stats/templates/ckanext/stats/index.html @@ -163,7 +163,7 @@ <th class="metric">{{ _('Number of datasets') }}</th> </tr> </thead> - <tbody> + <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> @@ -173,30 +173,7 @@ </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 %} - <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> + <p class="empty">{{ _('No groups') }}</p> {% endif %} </section> @@ -239,6 +216,36 @@ </tbody> </table> </section> + <section id="stats-by-org" class="module-content tab-content"> + <h2>{{ _('Datasets by Organization') }}</h2> + {% if c.by_org %} + <table class="table table-chunky table-bordered table-striped"> + <thead> + <tr> + <th>{{ _('Group') }}</th> + <th>{{ _('Public/Archived') }}</th> + <th class="metric">{{ _('Number of datasets') }}</th> + </tr> + </thead> + <tbody> + {% for group,private, num_packages in c.by_org %} + <tr> + <td>{{ h.link_to(group.title or group.name, h.url_for(controller='organization', action='read', id=group.name)) }}</td> + {% if private == True %} + <td>Archived</td> + {% else %} + <td>Public</td> + {% endif %} + <td class="metric">{{ num_packages }}</td> + </tr> + {% endfor %} + </tbody> + </table> + {% else %} + <p class="empty">{{ _('No groups') }}</p> + {% endif %} + </section> + </article> {% endblock %} @@ -251,11 +258,11 @@ <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> +<!-- <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-largest-groups" data-toggle="tab">{{ _('Largest Groups') }}</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> </ul> </nav> </section>