--- a/ckanext/ga_report/templates/ga_report/ga_util.html +++ b/ckanext/ga_report/templates/ga_report/ga_util.html @@ -34,10 +34,11 @@ <div id="chart_container_$id" class="rickshaw_chart_container"> <div id="y_axis_$id" class="rickshaw_y_axis"></div> <div id="chart_$id" class="rickshaw_chart"></div> - <div id="legend_$id" class="rickshaw_legend"></div> <script type="text/javascript"> $(function() { - CKAN.GA_Reports.render_rickshaw('$id', $items_json, '$mode', '$colorscheme'); + var items = $items_json; + if (items.length==0) { return; } + CKAN.GA_Reports.render_rickshaw('$id', items, '$mode', '$colorscheme'); }); </script> </div> @@ -62,12 +63,13 @@ <div id="minornavigation-bg-left"> <div id="minornavigation-bg-right"> <ul class="nav nav-pills"> - <li py:attrs="{'class': 'active' if active_name=='Site-wide' else None}"><a py:attrs="{'class': 'active' if active_name=='Site-wide' else None}" href="${h.url_for(controller='ckanext.ga_report.controller:GaReport',action='index')}"><img src="/images/icons/page_white.png" height="16px" width="16px" alt="None" class="inline-icon "/> Site-wide</a></li> + <?python querystring='?month='+c.month if c.month else '' ?> + <li py:attrs="{'class': 'active' if active_name=='Site-wide' else None}"><a py:attrs="{'class': 'active' if active_name=='Site-wide' else None}" href="${h.url_for(controller='ckanext.ga_report.controller:GaReport',action='index')}${querystring}"><img src="/images/icons/page_white.png" height="16px" width="16px" alt="None" class="inline-icon "/> Site-wide</a></li> <li py:attrs="{'class': 'active' if active_name=='Publishers' else None}"> - <a py:attrs="{'class': 'active' if active_name=='Publishers' else None}" href="${h.url_for(controller='ckanext.ga_report.controller:GaDatasetReport',action='publishers')}"><img src="/images/icons/page_white.png" height="16px" width="16px" alt="None" class="inline-icon "/> Publishers</a> + <a py:attrs="{'class': 'active' if active_name=='Publishers' else None}" href="${h.url_for(controller='ckanext.ga_report.controller:GaDatasetReport',action='publishers')}${querystring}"><img src="/images/icons/page_white.png" height="16px" width="16px" alt="None" class="inline-icon "/> Publishers</a> </li> <li py:attrs="{'class': 'active' if active_name=='Datasets' else None}"> - <a py:attrs="{'class': 'active' if active_name=='Datasets' else None}" href="${h.url_for(controller='ckanext.ga_report.controller:GaDatasetReport',action='read')}"><img src="/images/icons/page_white.png" height="16px" width="16px" alt="None" class="inline-icon "/> Datasets</a> + <a py:attrs="{'class': 'active' if active_name=='Datasets' else None}" href="${h.url_for(controller='ckanext.ga_report.controller:GaDatasetReport',action='read')}${querystring}"><img src="/images/icons/page_white.png" height="16px" width="16px" alt="None" class="inline-icon "/> Datasets</a> </li> </ul> </div>