--- a/ckanext/ga_report/templates/ga_report/ga_util.html +++ b/ckanext/ga_report/templates/ga_report/ga_util.html @@ -30,6 +30,20 @@ </table> +<div py:def="rickshaw_graph(items_json,id,mode='line',colorscheme='munin')"> + <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'); + }); + </script> + </div> +</div> + + <table py:def="stat_table(items, title='Views')" class="table table-condensed table-bordered table-striped"> <tr> <th>Name</th> @@ -38,23 +52,6 @@ <py:for each="name, value in items"> <tr> <td>${name}</td> - <td>${value}</td> - </tr> - </py:for> - </table> - - -<table py:def="downloads_table(items)" class="table table-condensed table-bordered table-striped"> - <tr> - <th>Dataset and resource</th> - <th>Downloads</th> - </tr> - <py:for each="resource, value in items"> - <tr> - <td> - <strong>${resource.resource_group.package.title}</strong><br/> - ${h.link_to((resource.name or resource.description).strip() or "No name", h.url_for(controller='package', action='resource_read', id=resource.resource_group.package.name, resource_id=resource.id))}<br/> - </td> <td>${value}</td> </tr> </py:for> @@ -72,9 +69,6 @@ <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> </li> - <li py:attrs="{'class': 'active' if active_name=='Downloads' else None}"> - <a py:attrs="{'class': 'active' if active_name=='Downloads' else None}" href="${h.url_for(controller='ckanext.ga_report.controller:GaReport',action='downloads')}"><img src="/images/icons/page_white.png" height="16px" width="16px" alt="None" class="inline-icon "/> Downloads</a> - </li> </ul> </div> </div>