--- a/ckanext/dga_stats/templates/ckanext/stats/index.html +++ b/ckanext/dga_stats/templates/ckanext/stats/index.html @@ -1,1 +1,274 @@ - +{% extends "page.html" %} + +{% block breadcrumb_content %} +
  • {{ 'Statistics' }}
  • +{% endblock %} + +{% block primary_content %} +
    +
    +

    {{ _('Summary') }}

    + {% if c.summary_stats %} + + + + + + + + + {% for measure,value in c.summary_stats %} + + + + + {% endfor %} + +
    {{ _('Measure') }}{{ _('Value') }}
    {{measure}}{{ value }}
    + {% else %} +

    {{ _('No groups') }}

    + {% endif %} +
    +
    +

    {{ _('Site Activity Log') }}

    + {% if c.activity_counts %} + + + + + + + + + + {% for month, type, count in c.activity_counts %} + + + + + + {% endfor %} + +
    {{ _('Month') }}{{ _('Activity Type') }}{{ _('Count') }}
    {{ month }}{{ type }}{{ count }}
    + {% else %} +

    {{ _('No groups') }}

    + {% endif %} +
    + +
    +

    {{ _('Total number of Datasets') }}

    + + {% set xaxis = {'mode': 'time', 'timeformat': '%y-%b'} %} + {% set yaxis = {'min': 0} %} + + + + + + + + + {% for row in c.raw_packages_by_week %} + + + + + {% endfor %} + +
    {{ _("Date") }}{{ _("Total datasets") }}
    {{ row.total_packages }}
    +
    + +
    +

    {{ _('Dataset Revisions per Week') }}

    + + {% set xaxis = {'mode': 'time', 'timeformat': '%y-%b'} %} + {% set lines = {'fill': 1} %} + + + + + + + + + + {% for row in c.raw_all_package_revisions %} + + + + + + {% endfor %} + +
    {{ _("Date") }}{{ _("All dataset revisions") }}{{ _("New datasets") }}
    {{ row.total_revisions }}{{ c.raw_new_datasets[loop.index0].new_packages }}
    +
    + +
    +

    {{ _('Top Rated Datasets') }}

    + {% if c.top_rated_packages %} + + + + + + + + + + {% for package, rating, num_ratings in c.top_rated_packages %} + + + + + + {% endfor %} + +
    Dataset{{ _('Average rating') }}{{ _('Number of ratings') }}
    {{ h.link_to(package.title or package.name, h.url_for(controller='package', action='read', id=package.name)) }}{{ rating }}{{ num_ratings }}
    + {% else %} +

    {{ _('No ratings') }}

    + {% endif %} +
    + +
    +

    {{ _('Most Edited Datasets') }}

    + {% if c.most_edited_packages %} + + + + + + + + + {% for package, edits in c.most_edited_packages %} + + + + + {% endfor %} + +
    {{ _('Dataset') }}{{ _('Number of edits') }}
    {{ h.link_to(package.title or package.name, h.url_for(controller='package', action='read', id=package.name)) }}{{ edits }}
    + {% else %} +

    {{ _('No edited datasets') }}

    + {% endif %} +
    + +
    +

    {{ _('Largest Groups') }}

    + {% if c.largest_groups %} + + + + + + + + + {% for group, num_packages in c.largest_groups %} + + + + + {% endfor %} + +
    {{ _('Group') }}{{ _('Number of datasets') }}
    {{ h.link_to(group.title or group.name, h.url_for(controller='group', action='read', id=group.name)) }}{{ num_packages }}
    + {% else %} +

    {{ _('No groups') }}

    + {% endif %} +
    +
    +

    {{ _('Largest Groups') }}

    + {% if c.largest_groups %} + + + + + + + + + {% for group, num_packages in c.largest_groups %} + + + + + {% endfor %} + +
    {{ _('Group') }}{{ _('Number of datasets') }}
    {{ h.link_to(group.title or group.name, h.url_for(controller='group', action='read', id=group.name)) }}{{ num_packages }}
    + {% else %} +

    {{ _('No groups') }}

    + {% endif %} +
    + +
    +

    {{ _('Top Tags') }}

    + + + + + + + + + {% for tag, num_packages in c.top_tags %} + + + + + {% endfor %} + +
    {{ _('Tag Name') }}{{ _('Number of Datasets') }}
    {{ h.link_to(tag.name, h.url_for(controller='package', action='search', tags=tag.name)) }}{{ num_packages }}
    +
    + +
    +

    {{ _('Users Owning Most Datasets') }}

    + + + + + + + + + {% for user, num_packages in c.top_package_owners %} + + + + + {% endfor %} + +
    {{ _('User') }}{{ _('Number of Datasets') }}
    {{ h.linked_user(user) }}{{ num_packages }}
    +
    +
    +{% endblock %} + +{% block secondary_content %} +
    +

    {{ _('Statistics Menu') }}

    + +
    +{% endblock %} + +{% block scripts %} + {{ super() }} +{# +Hellish hack to get excanvas to work in IE8. We disable html5shiv from +overriding the createElement() method on this page. +See: http://stackoverflow.com/questions/10208062/using-flot-with-bootstrap-ie8-incompatibility +#} +{% resource "vendor/block_html5_shim" %} +{% resource "ckanext_dga_stats/stats" %} +{% endblock %} +