From: root Date: Mon, 16 Dec 2013 03:34:38 +0000 Subject: additional overview stats X-Git-Url: https://maxious.lambdacomplex.org/git/?p=ckanext-dga-stats.git&a=commitdiff&h=b7b3043b725e370ecb8a8c4e6cc569811fb42280 --- additional overview stats --- --- a/ckanext/dga_stats/stats.py +++ b/ckanext/dga_stats/stats.py @@ -123,10 +123,12 @@ def summary_stats(cls): connection = model.Session.connection() -# select 'Total Archived Datasets', count(*) from package where (state='active' or state='draft' or state='draft-complete') and private = 't' union \ res = connection.execute("SELECT 'Total Organisations', count(*) from \"group\" where type = 'organization' and state = 'active' union \ select 'Total Datasets', count(*) from package where (state='active' or state='draft' or state='draft-complete') and private = 'f' union \ - select 'Total Data Files/Resources', count(*) from resource where state='active'").fetchall(); + select 'Total Archived Datasets', count(*) from package where (state='active' or state='draft' or state='draft-complete') and private = 't' union \ + select 'Total Data Files/Resources', count(*) from resource where state='active' union \ + select 'Total Machine Readable/Data API Resources', count(*) from resource where state='active' and webstore_url = 'active'\ + ").fetchall(); return res --- a/ckanext/dga_stats/templates/ckanext/stats/index.html +++ b/ckanext/dga_stats/templates/ckanext/stats/index.html @@ -222,10 +222,12 @@ {% for measure,value in c.summary_stats %} + {% if 'Archived' not in measure or h.check_access('sysadmin') %} {{measure}} {{ value }} + {% endif %} {% endfor %}