Reinstating a sidebar with related info.
[ckanext-ga-report.git] / ckanext / ga_report / templates / ga_report / site / index.html
blob:a/ckanext/ga_report/templates/ga_report/site/index.html -> blob:b/ckanext/ga_report/templates/ga_report/site/index.html
<html xmlns:py="http://genshi.edgewall.org/" <html xmlns:py="http://genshi.edgewall.org/"
xmlns:i18n="http://genshi.edgewall.org/i18n" xmlns:i18n="http://genshi.edgewall.org/i18n"
xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xi="http://www.w3.org/2001/XInclude"
py:strip=""> py:strip="">
   
<py:def function="page_title">Site analytics</py:def> <xi:include href="../ga_util.html" />
   
  <py:def function="page_title">Site usage</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"/>
  <script type="text/javascript" src="/scripts/ckanext_ga_reports.js"></script>
  <script type="text/javascript" src="/scripts/vendor/jquery.sparkline.modified.js"></script>
  <script type="text/javascript" src="/scripts/rickshaw_ie7_shim.js"></script>
  <script type="text/javascript" src="/scripts/vendor/d3.v2.js"></script>
  <script type="text/javascript" src="/scripts/vendor/d3.layout.min.js"></script>
  <script type="text/javascript" src="/scripts/vendor/rickshaw.min.js"></script>
  </py:def>
   
<py:match path="primarysidebar"> <py:match path="primarysidebar">
<li class="widget-container boxed widget_text"> <li class="widget-container boxed widget_text">
<h4>Statistics</h4> <h4>Download</h4>
  <p><center>
  <a class="btn button btn-primary" href="${h.url_for(controller='ckanext.ga_report.controller:GaReport',action='csv',month=c.month or 'all')}">Download as CSV</a></center>
  </p>
</li> </li>
  <li class="widget-container boxed widget_text">
  <h4>Graph Legend</h4>
  <div id="graph-legend-container">
  <div id="legend_none">(No graph loaded)</div>
  </div>
  </li>
  <xi:include href="../notes.html" />
   
</py:match> </py:match>
   
<div py:match="content"> <div py:match="content">
<h1>Site statistics</h1> <h1>Site Usage</h1>
  ${usage_nav('Site-wide')}
<form class="form-inline" action="${h.url_for(controller='ckanext.ga_report.controller:GaReport',action='index')}" method="get">  
<div class="controls">  
<select name="month">  
<py:for each="val,desc in c.months">  
<option value='${val}' py:attrs="{'selected': 'selected' if c.month == val else None}">${desc}</option>  
</py:for>  
</select>  
<input class="btn button" type='submit' value="Update"/>  
</div>  
</form>  
   
<p><a href="${h.url_for(controller='ckanext.ga_report.controller:GaReport',action='csv',month=c.month)}">Export data</a> as CSV</p>  
   
<div class="tabbable"> <div class="tabbable">
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li class="active"><a href="#totals" data-toggle="tab">Totals</a></li> <li><a href="#totals" data-toggle="hashchange">Totals</a></li>
<li><a href="#browsers" data-toggle="tab">Browsers</a></li> <li class="dropdown">
<li><a href="#os" data-toggle="tab">Operating Systems</a></li> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Browsers
<li><a href="#social_networks" data-toggle="tab">Social Networks</a></li> <b class="caret"></b></a>
<li><a href="#languages" data-toggle="tab">Languages</a></li> <ul class="dropdown-menu">
<li><a href="#country" data-toggle="tab">Country</a></li> <li><a href="#browsers_names" data-toggle="hashchange">Browsers</a></li>
  <li><a href="#browsers_versions" data-toggle="hashchange">Versions</a></li>
  </ul>
  </li>
  <li class="dropdown">
  <a href="#" class="dropdown-toggle" data-toggle="dropdown">Operating Systems
  <b class="caret"></b></a>
  <ul class="dropdown-menu">
  <li><a href="#os" data-toggle="hashchange">Operating Systems</a></li>
  <li><a href="#os_versions" data-toggle="hashchange">Versions</a></li>
  </ul>
  </li>
  <li class="dropdown">
  <a href="#" class="dropdown-toggle" data-toggle="dropdown">Social
  <b class="caret"></b></a>
  <ul class="dropdown-menu">
  <li><a href="#social_networks" data-toggle="hashchange">All networks</a></li>
  <li><a href="#social_referrals_totals" data-toggle="hashchange">Referral links</a></li>
  </ul>
  </li>
  <li><a href="#languages" data-toggle="hashchange">Languages</a></li>
  <li><a href="#country" data-toggle="hashchange">Country</a></li>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
<div class="tab-pane active" id="totals"> <div class="tab-pane" id="totals">
<table class="table table-condensed table-bordered table-striped"> <table class="ga-reports-table table table-condensed table-bordered table-striped">
<tr> <tr>
<th>Name</th> <th>Name</th>
<th>Value</th> <th class="td-numeric">Value</th>
  <th>History</th>
</tr> </tr>
<py:for each="name, value in c.global_totals"> <py:for each="name, value, graph in c.global_totals">
<tr> <tr>
<td>${name}</td> <td>${name}</td>
<td>${value}</td> <td class="td-numeric">${value}</td>
  <td class="sparkline-cell">
  <span class="sparkline" sparkTooltips="${','.join([x for x,y in graph])}">
  ${','.join([y for x,y in graph])}
  </span>
  </td>
</tr> </tr>
</py:for> </py:for>
</table> </table>
</div> </div>
<div class="tab-pane" id="browsers"> <div class="tab-pane" id="browsers_versions">
<table class="table table-condensed table-bordered table-striped"> ${rickshaw_graph(c.browser_versions_graph,'browser-versions',mode='stack')}
<tr> <p>Note: Where a browser has a large number of versions, these have been grouped together.</p>
<th>Name</th> <form class="form-inline" action="${h.url_for(controller='ckanext.ga_report.controller:GaReport',action='index')}" method="get">
<th>Value</th> <label>Show stats table for:</label>
</tr> ${month_selector(c.month, c.months, c.day)}
<py:for each="name, value in c.browsers"> </form>
<tr> ${stat_table(c.browser_versions)}
<td>${name}</td> </div>
<td>${value}</td> <div class="tab-pane" id="browsers_names">
</tr> ${rickshaw_graph(c.browsers_graph,'browsers',mode='stack')}
</py:for> <form class="form-inline" action="${h.url_for(controller='ckanext.ga_report.controller:GaReport',action='index')}" method="get">
</table> <label>Show stats table for:</label>
</div> ${month_selector(c.month, c.months, c.day)}
<div class="tab-pane" id="os"> </form>
<table class="table table-condensed table-bordered table-striped"> ${stat_table(c.browsers)}
<tr> </div>
<th>Name</th> <div class="tab-pane" id="os">
<th>Value</th> ${rickshaw_graph(c.os_graph,'os',mode='stack')}
</tr> <form class="form-inline" action="${h.url_for(controller='ckanext.ga_report.controller:GaReport',action='index')}" method="get">
<py:for each="name, value in c.os"> <label>Show stats table for:</label>
<tr> ${month_selector(c.month, c.months, c.day)}
<td>${name}</td> </form>
<td>${value}</td> ${stat_table(c.os)}
</tr> </div>
</py:for> <div class="tab-pane" id="os_versions">
</table> ${rickshaw_graph(c.os_versions_graph,'os_versions',mode='stack')}
  <form class="form-inline" action="${h.url_for(controller='ckanext.ga_report.controller:GaReport',action='index')}" method="get">
  <label>Show stats table for:</label>
  ${month_selector(c.month, c.months, c.day)}
  </form>
  ${stat_table(c.os_versions)}
  </div>
  <div class="tab-pane" id="social_referrals_totals">
  <p>Number of visits that were referred from social networks</p>
  <form class="form-inline" action="${h.url_for(controller='ckanext.ga_report.controller:GaReport',action='index')}" method="get">
  <label>Show stats table for:</label>
  ${month_selector(c.month, c.months, c.day)}
  </form>
  ${social_table(c.social_referrer_totals)}
</div> </div>
<div class="tab-pane" id="social_networks"> <div class="tab-pane" id="social_networks">
<table class="table table-condensed table-bordered table-striped"> ${rickshaw_graph(c.social_networks_graph, 'social_networks',mode='stack')}
<tr> <p>Percentage of visits that were referred from these social networks</p>
<th>Name</th> <form class="form-inline" action="${h.url_for(controller='ckanext.ga_report.controller:GaReport',action='index')}" method="get">
<th>Value</th> <label>Show stats table for:</label>
</tr> ${month_selector(c.month, c.months, c.day)}
<py:for each="name, value in c.social_networks"> </form>
<tr> ${stat_table(c.social_networks, 'Visits')}
<td>${name}</td>  
<td>${value}</td>  
</tr>  
</py:for>  
</table>  
</div> </div>
<div class="tab-pane" id="languages"> <div class="tab-pane" id="languages">
<table class="table table-condensed table-bordered table-striped"> ${rickshaw_graph(c.languages_graph,'languages',mode='stack')}
<tr> <form class="form-inline" action="${h.url_for(controller='ckanext.ga_report.controller:GaReport',action='index')}" method="get">
<th>Name</th> <label>Show stats table for:</label>
<th>Value</th> ${month_selector(c.month, c.months, c.day)}
</tr> </form>
<py:for each="name, value in c.languages"> ${stat_table(c.languages)}
<tr>  
<td>${name}</td>  
<td>${value}</td>  
</tr>  
</py:for>  
</table>  
</div> </div>
<div class="tab-pane" id="country"> <div class="tab-pane" id="country">
<table class="table table-condensed table-bordered table-striped"> ${rickshaw_graph(c.country_graph,'country',mode='stack')}
<tr> <form class="form-inline" action="${h.url_for(controller='ckanext.ga_report.controller:GaReport',action='index')}" method="get">
<th>Name</th> <label>Show stats table for:</label>
<th>Value</th> ${month_selector(c.month, c.months, c.day)}
</tr> </form>
<py:for each="name, value in c.country"> ${stat_table(c.country)}
<tr>  
<td>${name}</td>  
<td>${value}</td>  
</tr>  
</py:for>  
</table>  
</div> </div>
  </div>
  </div>
  </div>
   
   
</div> <py:def function="optional_footer">
</div> <script type="text/javascript">
  $(function() {
  CKAN.GA_Reports.bind_sparklines();
  CKAN.GA_Reports.bind_sidebar();
</div> CKAN.GA_Reports.bind_month_selector();
  if (!window.location.hash) {
  window.location.hash='totals';
  }
  else {
  $(window).trigger('hashchange');
  }
  });
  </script>
  </py:def>
   
<xi:include href="../../layout.html" /> <xi:include href="../../layout.html" />
   
<py:def function="optional_footer">  
<script type='text/javascript'>  
$('.nav-tabs li a').click(function (e) {  
e.preventDefault();  
$(this).tab('show');  
})  
</script>  
</py:def>  
</html> </html>