--- a/ckanext/ga_report/templates/ga_report/ga_util.html +++ b/ckanext/ga_report/templates/ga_report/ga_util.html @@ -5,6 +5,14 @@ xmlns:xi="http://www.w3.org/2001/XInclude" py:strip="" > + +<select name="month" py:def="month_selector(current_month, months, day)"> + <option value='' py:attrs="{'selected': 'selected' if not current_month else None}">All months</option> + <py:for each="i, (val,desc) in enumerate(months)"> + <option value='${val}' py:attrs="{'selected': 'selected' if current_month == val else None}">${desc}<py:if test="i == 0 and day"> (up to ${day})</py:if></option> + </py:for> +</select> + <table py:def="social_table(items, with_source=False)" class="table table-condensed table-bordered table-striped"> <tr> @@ -20,6 +28,20 @@ </tr> </py:for> </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">