--- a/ckanext/ga_report/templates/ga_report/publisher/read.html +++ b/ckanext/ga_report/templates/ga_report/publisher/read.html @@ -7,11 +7,10 @@ <py:def function="page_title">Usage by Dataset</py:def> - <py:def function="content_class"><!----></py:def> - <py:def function="optional_head"> <link rel="stylesheet" type="text/css" href="/scripts/vendor/rickshaw.min.css"/> <link rel="stylesheet" type="text/css" href="/css/ga_report.css?1"/> + <script type="text/javascript" src="/scripts/modernizr-2.6.2.custom.js"></script> <script type="text/javascript" src="/scripts/ckanext_ga_reports.js?1"></script> <script type="text/javascript" src="/scripts/vendor/jquery.sparkline.modified.js"></script> <script type="text/javascript" src="/scripts/rickshaw_ie7_shim.js"></script> @@ -20,20 +19,17 @@ <script type="text/javascript" src="/scripts/vendor/rickshaw.min.js"></script> </py:def> - <py:match path="primarysidebar"> + <py:def function="sidebar"> ${ga_sidebar(download_link=h.url_for(controller='ckanext.ga_report.controller:GaDatasetReport',action='dataset_csv',id=c.publisher_name or 'all',month=c.month or 'all'))} - </py:match> - + </py:def> + <py:def function="page_heading">Site Usage ${usage_nav('Datasets')}</py:def> <div py:match="content"> - <h1>Site Usage ${usage_nav('Datasets')}</h1> <div class="boxed"> <h3 py:if="c.publisher"><a href="${h.url_for(controller='ckanext.dgu.controllers.publisher:PublisherController',action='read',id=c.publisher.name)}">${c.publisher.title}</a></h3> - <p py:if="not c.top_packages">No page views in this period</p> - - <py:if test="c.top_packages"> + <py:if test="c.graph_data"> ${rickshaw_graph(c.graph_data,'dataset-downloads',debug=True)} </py:if> <form class="form-inline" action="${h.url_for(controller='ckanext.ga_report.controller:GaDatasetReport',action='read')}" method="get"> @@ -50,6 +46,13 @@ <input class="btn button btn-primary" type='submit' value="Update"/> </div> </form> + <py:if test="c.month"> + <h4>Statistics for ${h.month_option_title(c.month,c.months,c.day)}:</h4> + </py:if> + <py:if test="not c.month"> + <h4>Statistics for all months:</h4> + </py:if> + <div class="alert alert-info" py:if="not c.top_packages">No page views in this period.</div> <py:if test="c.top_packages"> <table class="ga-reports-table table table-condensed table-bordered table-striped"> <tr>