html fixes and reeneable downloads count
html fixes and reeneable downloads count

import logging import logging
import ckan.lib.helpers as h import ckan.lib.helpers as h
import ckan.plugins as p import ckan.plugins as p
from ckan.plugins import implements, toolkit from ckan.plugins import implements, toolkit
   
from ckanext.ga_report.helpers import (most_popular_datasets, from ckanext.ga_report.helpers import (most_popular_datasets,
popular_datasets, popular_datasets,
single_popular_dataset, single_popular_dataset,
month_option_title) month_option_title)
   
log = logging.getLogger('ckanext.ga-report') log = logging.getLogger('ckanext.ga-report')
   
class GAReportPlugin(p.SingletonPlugin): class GAReportPlugin(p.SingletonPlugin):
implements(p.IConfigurer, inherit=True) implements(p.IConfigurer, inherit=True)
implements(p.IRoutes, inherit=True) implements(p.IRoutes, inherit=True)
implements(p.ITemplateHelpers, inherit=True) implements(p.ITemplateHelpers, inherit=True)
   
def update_config(self, config): def update_config(self, config):
toolkit.add_template_directory(config, 'templates') toolkit.add_template_directory(config, 'templates')
toolkit.add_public_directory(config, 'public') toolkit.add_public_directory(config, 'public')
   
def get_helpers(self): def get_helpers(self):
""" """
A dictionary of extra helpers that will be available to provide A dictionary of extra helpers that will be available to provide
ga report info to templates. ga report info to templates.
""" """
return { return {
'ga_report_installed': lambda: True, 'ga_report_installed': lambda: True,
'popular_datasets': popular_datasets, 'popular_datasets': popular_datasets,
'most_popular_datasets': most_popular_datasets, 'most_popular_datasets': most_popular_datasets,
'single_popular_dataset': single_popular_dataset, 'single_popular_dataset': single_popular_dataset,
'month_option_title': month_option_title 'month_option_title': month_option_title
} }
   
def after_map(self, map): def after_map(self, map):
# GaReport # GaReport
map.connect( map.connect(
'/site-usage', '/site-usage',
controller='ckanext.ga_report.controller:GaReport', controller='ckanext.ga_report.controller:GaReport',
action='index' action='index'
) )
map.connect( map.connect(
'/site-usage_{month}.csv', '/site-usage_{month}.csv',
controller='ckanext.ga_report.controller:GaReport', controller='ckanext.ga_report.controller:GaReport',
action='csv' action='csv'
) )
map.connect( map.connect(
'/site-usage/downloads', '/site-usage/downloads',
controller='ckanext.ga_report.controller:GaReport', controller='ckanext.ga_report.controller:GaReport',
action='downloads' action='downloads'
) )
map.connect( map.connect(
'/site-usage/downloads_{month}.csv', '/site-usage/downloads_{month}.csv',
controller='ckanext.ga_report.controller:GaReport', controller='ckanext.ga_report.controller:GaReport',
action='csv_downloads' action='csv_downloads'
) )
   
# GaDatasetReport # GaDatasetReport
map.connect( map.connect(
'/site-usage/publisher', '/site-usage/publisher',
controller='ckanext.ga_report.controller:GaDatasetReport', controller='ckanext.ga_report.controller:GaDatasetReport',
action='publishers' action='publishers'
) )
map.connect( map.connect(
'/site-usage/publishers_{month}.csv', '/site-usage/publishers_{month}.csv',
controller='ckanext.ga_report.controller:GaDatasetReport', controller='ckanext.ga_report.controller:GaDatasetReport',
action='publisher_csv' action='publisher_csv'
) )
map.connect( map.connect(
'/site-usagesetsets_{id}_{month}.csv', '/site-usage/dataset/datasets_{id}_{month}.csv',
controller='ckanext.ga_report.controller:GaDatasetReport', controller='ckanext.ga_report.controller:GaDatasetReport',
action='dataset_csv' action='dataset_csv'
) )
map.connect( map.connect(
'/site-usageset', '/site-usage/dataset',
controller='ckanext.ga_report.controller:GaDatasetReport', controller='ckanext.ga_report.controller:GaDatasetReport',
action='read' action='read'
) )
map.connect( map.connect(
'/site-usageset/{id}', '/site-usage/dataset/{id}',
controller='ckanext.ga_report.controller:GaDatasetReport', controller='ckanext.ga_report.controller:GaDatasetReport',
action='read_publisher' action='read_publisher'
) )
return map return map
   
   
<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="">
   
<xi:include href="../ga_util.html" /> <xi:include href="../ga_util.html" />
   
<py:def function="page_title">Usage by Dataset</py:def> <py:def function="page_title">Usage by Dataset</py:def>
   
<py:def function="optional_head"> <py:def function="optional_head">
<link rel="stylesheet" type="text/css" href="/scripts/vendor/rickshaw.min.css"/> <link rel="stylesheet" type="text/css" href="/scripts/vendor/rickshaw.min.css"/>
<link rel="stylesheet" type="text/css" href="/css/ga_report.css?1"/> <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/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/ckanext_ga_reports.js?1"></script>
<script type="text/javascript" src="/scripts/vendor/jquery.sparkline.modified.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/rickshaw_ie7_shim.js"></script>
<script type="text/javascript" src="/scripts/vendor/d3.v2.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/d3.layout.min.js"></script>
<script type="text/javascript" src="/scripts/vendor/rickshaw.min.js"></script> <script type="text/javascript" src="/scripts/vendor/rickshaw.min.js"></script>
</py:def> </py:def>
   
   
<py:match path="breadcrumbs"> <py:match path="breadcrumbs">
<li><a href="/site-usage">Site Analytics</a></li> <li><a href="/site-usage">Site Analytics</a></li>
<py:if test="c.publisher"> <py:if test="c.publisher">
<li><a href="/site-usage/publisher">Publishers</a></li> <li><a href="/site-usage/publisher">Publishers</a></li>
<li py:if="c.publisher"><a href="/site-usage/publisher/${c.publisher.name}">${c.publisher.title}</a></li> <li py:if="c.publisher"><a href="/site-usage/publisher/${c.publisher.name}">${c.publisher.title}</a></li>
</py:if> </py:if>
<py:if test="not c.publisher"> <py:if test="not c.publisher">
<li><a href="${request.url}">Usage By Dataset</a></li> <li><a href="${request.url}">Usage By Dataset</a></li>
</py:if> </py:if>
</py:match> </py:match>
   
<div py:match="content"> <div py:match="content">
   
<py:with vars="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:with vars="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')">
<a class="btn button btn-primary btn-sm pull-right" href="${download_link}"><i class="icon-download"></i>&nbsp; Download as CSV</a> <a class="btn button btn-primary btn-sm pull-right" href="${download_link}"><i class="icon-download"></i>&nbsp; Download as CSV</a>
</py:with> </py:with>
<h1>Site Usage <h1>Site Usage
<small py:if="c.publisher">${c.publisher.title}</small> <small py:if="c.publisher">${c.publisher.title}</small>
<small py:if="not c.publisher">All datasets</small> <small py:if="not c.publisher">All datasets</small>
</h1> </h1>
   
<div class="row" style="background: #fff;"> <div class="row" style="background: #fff;">
<div class="col-md-8"> <div class="col-md-8">
<div class="whitebox"> <div class="whitebox">
<py:if test="c.graph_data"> <py:if test="c.graph_data">
${rickshaw_graph(c.graph_data,'dataset-downloads',debug=True)} ${rickshaw_graph(c.graph_data,'dataset-downloads',debug=True)}
</py:if> </py:if>
</div> </div>
</div> </div>
</div> </div>
<hr/> <hr/>
<py:if test="c.month"> <py:if test="c.month">
<h4>Statistics for ${h.month_option_title(c.month,c.months,c.day)}:</h4> <h4>Statistics for ${h.month_option_title(c.month,c.months,c.day)}:</h4>
</py:if> </py:if>
<py:if test="not c.month"> <py:if test="not c.month">
<h2>Statistics for all months</h2> <h2>Statistics for all months</h2>
</py:if> </py:if>
<form style="margin-bottom:10px;" class="form-inline" action="${h.url_for(controller='ckanext.ga_report.controller:GaDatasetReport',action='read')}" method="get"> <form style="margin-bottom:10px;" class="form-inline" action="${h.url_for(controller='ckanext.ga_report.controller:GaDatasetReport',action='read')}" method="get">
<div class="controls"> <div class="controls">
   
${month_selector(c.month, c.months, c.day)} ${month_selector(c.month, c.months, c.day)}
   
<select name="publisher"> <select name="publisher">
<option value='' py:attrs="{'selected': 'selected' if not c.publisher else None}">All publishers</option> <option value='' py:attrs="{'selected': 'selected' if not c.publisher else None}">All publishers</option>
<py:for each="val,desc in c.publishers"> <py:for each="val,desc in c.publishers">
<option value='${val}' py:attrs="{'selected': 'selected' if c.publisher_name == val else None}">${desc}</option> <option value='${val}' py:attrs="{'selected': 'selected' if c.publisher_name == val else None}">${desc}</option>
</py:for> </py:for>
</select> </select>
<input class="btn button btn-primary btn-xs" type='submit' value="Update"/> <input class="btn button btn-primary btn-xs" type='submit' value="Update"/>
</div> </div>
</form> </form>
<div class="alert alert-info" py:if="not c.top_packages">No page views in this period.</div> <div class="alert alert-info" py:if="not c.top_packages">No page views in this period.</div>
<py:if test="c.top_packages"> <py:if test="c.top_packages">
<table class="ga-reports-table table table-condensed table-bordered"> <table class="ga-reports-table table table-condensed table-bordered">
<tr> <tr>
<th>Dataset</th> <th>Dataset</th>
<th>Views</th> <th>Views</th>
<th>Downloads</th> <th>Downloads</th>
</tr> </tr>
<py:for each="package, views, visits,downloads in c.top_packages"> <py:for each="package, views, visits,downloads in c.top_packages">
<tr> <tr>
<td> <td>
${h.link_to(package.title or package.name, h.url_for(controller='package', action='read', id=package.name))} ${h.link_to(package.title or package.name, h.url_for(controller='package', action='read', id=package.name))}
</td> </td>
<td class="td-numeric">${views}</td> <td class="td-numeric">${views}</td>
<td class="td-numeric">${downloads}</td> <td class="td-numeric">${downloads}</td>
</tr> </tr>
</py:for> </py:for>
</table> </table>
</py:if> </py:if>
   
${ga_footer()} ${ga_footer()}
   
</div> </div>
   
<xi:include href="../site/layout.html" /> <xi:include href="../site/layout.html" />
</html> </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="">
   
<xi:include href="../ga_util.html" /> <xi:include href="../ga_util.html" />
   
<py:def function="page_title">Site usage</py:def> <py:def function="page_title">Site usage</py:def>
   
<py:def function="optional_head"> <py:def function="optional_head">
</py:def> </py:def>
   
<py:match path="breadcrumbs"> <py:match path="breadcrumbs">
<li><a href="/site-usage">Site Analytics</a></li> <li><a href="/site-usage">Site Analytics</a></li>
<li><a href="/site-usage">Site-wide</a></li> <li><a href="/site-usage">Site-wide</a></li>
</py:match> </py:match>
   
<div py:match="content"> <div py:match="content">
<div class="row"> <div class="row">
<div class="col-sm-7 col-md-8 col-lg-9"> <div class="col-sm-7 col-md-8 col-lg-9">
<py:with vars="download_link=h.url_for(controller='ckanext.ga_report.controller:GaReport',action='csv',month=c.month or 'all')"> <py:with vars="download_link=h.url_for(controller='ckanext.ga_report.controller:GaReport',action='csv',month=c.month or 'all')">
<a class="btn button btn-primary btn-sm pull-right" href="${download_link}"><i class="icon-download"></i>&nbsp; Download as CSV</a> <a class="btn button btn-primary btn-sm pull-right" href="${download_link}"><i class="icon-download"></i>&nbsp; Download as CSV</a>
</py:with> </py:with>
<h1>Site Usage</h1> <h1>Site Usage</h1>
</div> </div>
<div class="col-sm-5 col-md-4 col-lg-3"> <div class="col-sm-5 col-md-4 col-lg-3">
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"><strong>Jump To...</strong></div> <div class="panel-heading"><strong>Jump To...</strong></div>
<div class="panel-body"> <div class="panel-body">
<ul> <ul>
<li><a href="/site-usage/publisher">Publisher Usage Statistics</a></li> <li><a href="/site-usage/publisher">Publisher Usage Statistics</a></li>
<li><a href="/site-usageset">Dataset Usage Statistics</a></li> <li><a href="/site-usage/dataset">Dataset Usage Statistics</a></li>
</ul> </ul>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
   
<div class="row" style="background: #fff;"> <div class="row" style="background: #fff;">
<div class="col-md-8"> <div class="col-md-8">
<div class="whitebox"> <div class="whitebox">
<div class="tabbable"> <div class="tabbable">
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li class="active"><a href="#totals" data-hash="totals" data-toggle="tab">Totals</a></li> <li class="active"><a href="#totals" data-hash="totals" data-toggle="tab">Totals</a></li>
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Browsers <a href="#" class="dropdown-toggle" data-toggle="dropdown">Browsers
<b class="caret"></b></a> <b class="caret"></b></a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a href="#browsers_names" data-hash="browsers_names" data-toggle="tab">Browsers</a></li> <li><a href="#browsers_names" data-hash="browsers_names" data-toggle="tab">Browsers</a></li>
<li><a href="#browsers_versions" data-hash="browsers_versions" data-toggle="tab">Versions</a></li> <li><a href="#browsers_versions" data-hash="browsers_versions" data-toggle="tab">Versions</a></li>
</ul> </ul>
</li> </li>
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Operating Systems <a href="#" class="dropdown-toggle" data-toggle="dropdown">Operating Systems
<b class="caret"></b></a> <b class="caret"></b></a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a href="#os" data-hash="os" data-toggle="tab">Operating Systems</a></li> <li><a href="#os" data-hash="os" data-toggle="tab">Operating Systems</a></li>
<li><a href="#os_versions" data-hash="os_versions" data-toggle="tab">Versions</a></li> <li><a href="#os_versions" data-hash="os_versions" data-toggle="tab">Versions</a></li>
</ul> </ul>
</li> </li>
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Social <a href="#" class="dropdown-toggle" data-toggle="dropdown">Social
<b class="caret"></b></a> <b class="caret"></b></a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a href="#social_networks" data-hash="social_networks" data-toggle="tab">All networks</a></li> <li><a href="#social_networks" data-hash="social_networks" data-toggle="tab">All networks</a></li>
<li><a href="#social_referrals_totals" data-hash="social_referrals_totals" data-toggle="tab">Referral links</a></li> <li><a href="#social_referrals_totals" data-hash="social_referrals_totals" data-toggle="tab">Referral links</a></li>
</ul> </ul>
</li> </li>
<li><a href="#languages" data-hash="languages" data-toggle="tab">Languages</a></li> <li><a href="#languages" data-hash="languages" data-toggle="tab">Languages</a></li>
<li><a href="#country" data-hash="country" data-toggle="tab">Country</a></li> <li><a href="#country" data-hash="country" data-toggle="tab">Country</a></li>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
<div class="tab-pane active" id="totals"> <div class="tab-pane active" id="totals">
<form class="form-inline" action="${h.url_for(controller='ckanext.ga_report.controller:GaReport',action='index')}" method="get"> <form class="form-inline" action="${h.url_for(controller='ckanext.ga_report.controller:GaReport',action='index')}" method="get">
<h4 class="ga-reports-heading">Show stats table for:</h4> <h4 class="ga-reports-heading">Show stats table for:</h4>
${month_selector(c.month, c.months, c.day)} ${month_selector(c.month, c.months, c.day)}
</form> </form>
<table class="ga-reports-table 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 class="td-numeric">Value</th> <th class="td-numeric">Value</th>
<th>History</th> <th>History</th>
</tr> </tr>
<py:for each="name, value, graph in c.global_totals"> <py:for each="name, value, graph in c.global_totals">
<tr> <tr>
<td>${name}</td> <td>${name}</td>
<td class="td-numeric">${value}</td> <td class="td-numeric">${value}</td>
<td class="sparkline-cell"> <td class="sparkline-cell">
<span class="sparkline" sparkTooltips="${','.join([x for x,y in graph])}"> <span class="sparkline" sparkTooltips="${','.join([x for x,y in graph])}">
${','.join([y for x,y in graph])} ${','.join([y for x,y in graph])}
</span> </span>
</td> </td>
</tr> </tr>
</py:for> </py:for>
</table> </table>
</div> </div>
<div class="tab-pane" id="browsers_versions"> <div class="tab-pane" id="browsers_versions">
${rickshaw_graph(c.browser_versions_graph,'browser-versions',mode='stack')} ${rickshaw_graph(c.browser_versions_graph,'browser-versions',mode='stack')}
<hr/> <hr/>
<p>Note: Where a browser has a large number of versions, these have been grouped together.</p> <p>Note: Where a browser has a large number of versions, these have been grouped together.</p>
<form class="form-inline" action="${h.url_for(controller='ckanext.ga_report.controller:GaReport',action='index')}" method="get"> <form class="form-inline" action="${h.url_for(controller='ckanext.ga_report.controller:GaReport',action='index')}" method="get">
<h4 class="ga-reports-heading">Show stats table for:</h4> <h4 class="ga-reports-heading">Show stats table for:</h4>
${month_selector(c.month, c.months, c.day)} ${month_selector(c.month, c.months, c.day)}
</form> </form>
<hr/> <hr/>
${stat_table(c.browser_versions)} ${stat_table(c.browser_versions)}
</div> </div>
<div class="tab-pane" id="browsers_names"> <div class="tab-pane" id="browsers_names">
${rickshaw_graph(c.browsers_graph,'browsers',mode='stack')} ${rickshaw_graph(c.browsers_graph,'browsers',mode='stack')}
<hr/> <hr/>
<form class="form-inline" action="${h.url_for(controller='ckanext.ga_report.controller:GaReport',action='index')}" method="get"> <form class="form-inline" action="${h.url_for(controller='ckanext.ga_report.controller:GaReport',action='index')}" method="get">
<h4 class="ga-reports-heading">Show stats table for:</h4> <h4 class="ga-reports-heading">Show stats table for:</h4>
${month_selector(c.month, c.months, c.day)} ${month_selector(c.month, c.months, c.day)}
</form> </form>
<hr/> <hr/>
${stat_table(c.browsers)} ${stat_table(c.browsers)}
</div> </div>
<div class="tab-pane" id="os"> <div class="tab-pane" id="os">
${rickshaw_graph(c.os_graph,'os',mode='stack')} ${rickshaw_graph(c.os_graph,'os',mode='stack')}
<hr/> <hr/>
<form class="form-inline" action="${h.url_for(controller='ckanext.ga_report.controller:GaReport',action='index')}" method="get"> <form class="form-inline" action="${h.url_for(controller='ckanext.ga_report.controller:GaReport',action='index')}" method="get">
<h4 class="ga-reports-heading">Show stats table for:</h4> <h4 class="ga-reports-heading">Show stats table for:</h4>
${month_selector(c.month, c.months, c.day)} ${month_selector(c.month, c.months, c.day)}
</form> </form>
<hr/> <hr/>
${stat_table(c.os)} ${stat_table(c.os)}
</div> </div>
<div class="tab-pane" id="os_versions"> <div class="tab-pane" id="os_versions">
${rickshaw_graph(c.os_versions_graph,'os_versions',mode='stack')} ${rickshaw_graph(c.os_versions_graph,'os_versions',mode='stack')}
<hr/> <hr/>
<form class="form-inline" action="${h.url_for(controller='ckanext.ga_report.controller:GaReport',action='index')}" method="get"> <form class="form-inline" action="${h.url_for(controller='ckanext.ga_report.controller:GaReport',action='index')}" method="get">
<h4 class="ga-reports-heading">Show stats table for:</h4> <h4 class="ga-reports-heading">Show stats table for:</h4>
${month_selector(c.month, c.months, c.day)} ${month_selector(c.month, c.months, c.day)}
</form> </form>
<hr/> <hr/>
${stat_table(c.os_versions)} ${stat_table(c.os_versions)}
</div> </div>
<div class="tab-pane" id="social_referrals_totals"> <div class="tab-pane" id="social_referrals_totals">
<p>Number of visits that were referred from social networks</p> <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"> <form class="form-inline" action="${h.url_for(controller='ckanext.ga_report.controller:GaReport',action='index')}" method="get">
<h4 class="ga-reports-heading">Show stats table for:</h4> <h4 class="ga-reports-heading">Show stats table for:</h4>
${month_selector(c.month, c.months, c.day)} ${month_selector(c.month, c.months, c.day)}
</form> </form>
${social_table(c.social_referrer_totals)} ${social_table(c.social_referrer_totals)}
</div> </div>
<div class="tab-pane" id="social_networks"> <div class="tab-pane" id="social_networks">
${rickshaw_graph(c.social_networks_graph, 'social_networks',mode='stack')} ${rickshaw_graph(c.social_networks_graph, 'social_networks',mode='stack')}
<hr/> <hr/>
<p>Percentage of visits that were referred from these social networks</p> <p>Percentage of visits that were referred from these social networks</p>
<form class="form-inline" action="${h.url_for(controller='ckanext.ga_report.controller:GaReport',action='index')}" method="get"> <form class="form-inline" action="${h.url_for(controller='ckanext.ga_report.controller:GaReport',action='index')}" method="get">
<h4 class="ga-reports-heading">Show stats table for:</h4> <h4 class="ga-reports-heading">Show stats table for:</h4>
${month_selector(c.month, c.months, c.day)} ${month_selector(c.month, c.months, c.day)}
</form> </form>
<hr/> <hr/>
${stat_table(c.social_networks, 'Visits')} ${stat_table(c.social_networks, 'Visits')}
</div> </div>
<div class="tab-pane" id="languages"> <div class="tab-pane" id="languages">
${rickshaw_graph(c.languages_graph,'languages',mode='stack')} ${rickshaw_graph(c.languages_graph,'languages',mode='stack')}
<hr/> <hr/>
<form class="form-inline" action="${h.url_for(controller='ckanext.ga_report.controller:GaReport',action='index')}" method="get"> <form class="form-inline" action="${h.url_for(controller='ckanext.ga_report.controller:GaReport',action='index')}" method="get">
<h4 class="ga-reports-heading">Show stats table for:</h4> <h4 class="ga-reports-heading">Show stats table for:</h4>
${month_selector(c.month, c.months, c.day)} ${month_selector(c.month, c.months, c.day)}
</form> </form>
<hr/> <hr/>
${stat_table(c.languages)} ${stat_table(c.languages)}
</div> </div>
<div class="tab-pane" id="country"> <div class="tab-pane" id="country">
${rickshaw_graph(c.country_graph,'country',mode='stack')} ${rickshaw_graph(c.country_graph,'country',mode='stack')}
<hr/> <hr/>
<form class="form-inline" action="${h.url_for(controller='ckanext.ga_report.controller:GaReport',action='index')}" method="get"> <form class="form-inline" action="${h.url_for(controller='ckanext.ga_report.controller:GaReport',action='index')}" method="get">
<h4 class="ga-reports-heading">Show stats table for:</h4> <h4 class="ga-reports-heading">Show stats table for:</h4>
${month_selector(c.month, c.months, c.day)} ${month_selector(c.month, c.months, c.day)}
</form> </form>
<hr/> <hr/>
${stat_table(c.country)} ${stat_table(c.country)}
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
   
</div> </div>
   
   
<py:def function="optional_footer"> <py:def function="optional_footer">
<script type="text/javascript"> <script type="text/javascript">
$(function() { $(function() {
CKAN.GA_Reports.bind_sparklines(); CKAN.GA_Reports.bind_sparklines();
CKAN.GA_Reports.bind_sidebar(); CKAN.GA_Reports.bind_sidebar();
CKAN.GA_Reports.bind_month_selector(); CKAN.GA_Reports.bind_month_selector();
}); });
</script> </script>
</py:def> </py:def>
   
<xi:include href="layout.html" /> <xi:include href="layout.html" />
</html> </html>
   
   
   
   
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--[if IE 8 ]> <html class="no-js ie8" lang="en"> <![endif]--> <!--[if IE 8 ]> <html class="no-js ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--> <html class="no-js" lang="en" <!--[if (gte IE 9)|!(IE)]><!--> <html class="no-js" lang="en"
xmlns="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml"
xmlns:i18n="http://genshi.edgewall.org/i18n" xmlns:i18n="http://genshi.edgewall.org/i18n"
xmlns:py="http://genshi.edgewall.org/" xmlns:py="http://genshi.edgewall.org/"
xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xi="http://www.w3.org/2001/XInclude"
> <!--<![endif]--> > <!--<![endif]-->
<xi:include href="../../_util.html" /> <xi:include href="../../_util.html" />
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
   
<title>${page_title()} - ${g.site_title}</title> <title>${page_title()} - ${g.site_title}</title>
<meta name="description" content="" /> <meta name="description" content="" />
<meta name="author" content="" /> <meta name="author" content="" />
   
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="shortcut icon" href="${h.url_for_static(g.favicon)}" /> <link rel="shortcut icon" href="${h.url_for_static(g.favicon)}" />
   
<py:choose> <py:choose>
<py:when test="defined('optional_feed')"> <py:when test="defined('optional_feed')">
${optional_feed()} ${optional_feed()}
</py:when> </py:when>
<py:otherwise> <py:otherwise>
<link rel="alternate" type="application/atom+xml" title="${g.site_title} - Recent Revision History" href="${h.url_for(controller='revision', action='list', format='atom', days=1)}" /> <link rel="alternate" type="application/atom+xml" title="${g.site_title} - Recent Revision History" href="${h.url_for(controller='revision', action='list', format='atom', days=1)}" />
</py:otherwise> </py:otherwise>
</py:choose> </py:choose>
<link href='http://fonts.googleapis.com/css?family=Ubuntu:400,700' rel='stylesheet' type='text/css' /> <link href='http://fonts.googleapis.com/css?family=Ubuntu:400,700' rel='stylesheet' type='text/css' />
   
<link rel="stylesheet" href="${h.url_for_static('/scripts/vendor/jqueryui/1.8.14/css/jquery-ui.custom.css')}" type="text/css" media="screen, print" /> <link rel="stylesheet" href="${h.url_for_static('/scripts/vendor/jqueryui/1.8.14/css/jquery-ui.custom.css')}" type="text/css" media="screen, print" />
<link rel="stylesheet" href="${h.url_for_static('/css/bootstrap.min.css')}" type="text/css" media="screen, projection" /> <link rel="stylesheet" href="${h.url_for_static('/css/bootstrap.min.css')}" type="text/css" media="screen, projection" />
<link rel="stylesheet" href="${h.url_for_static('/css/chosen.css')}" type="text/css" /> <link rel="stylesheet" href="${h.url_for_static('/css/chosen.css')}" type="text/css" />
<link rel="stylesheet" href="${h.url_for_static('/css/style.css?v=2')}" /> <link rel="stylesheet" href="${h.url_for_static('/css/style.css?v=2')}" />
${jsConditionalForIe(9, '&lt;script type="text/javascript" src="' + h.url_for_static('/scripts/vendor/html5shiv/html5.js') + '"&gt;&lt;/script&gt;')} ${jsConditionalForIe(9, '&lt;script type="text/javascript" src="' + h.url_for_static('/scripts/vendor/html5shiv/html5.js') + '"&gt;&lt;/script&gt;')}
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script> <script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script> <script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<link rel="stylesheet" type="text/css" href="/scripts/vendor/rickshaw.min.css"/> <link rel="stylesheet" type="text/css" href="/scripts/vendor/rickshaw.min.css"/>
<link rel="stylesheet" type="text/css" href="/css/ga_report.css?1"/> <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/modernizr-2.6.2.custom.js"></script>
<script type="text/javascript" src="/scripts/vendor/jquery.sparkline.modified.js"></script> <script type="text/javascript" src="/scripts/vendor/jquery.sparkline.modified.js"></script>
<script type="text/javascript" src="/scripts/ckanext_ga_reports.js?1"></script> <script type="text/javascript" src="/scripts/ckanext_ga_reports.js?1"></script>
<script type="text/javascript" src="/scripts/rickshaw_ie7_shim.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.v2.js"></script>
<script type="text/javascript" src="/scripts/vendor/d3.layout.min.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> <script type="text/javascript" src="/scripts/vendor/rickshaw.min.js"></script>
<style> <style>
#pre-content #breadcrumbs { #pre-content #breadcrumbs {
padding-left: 0; padding-left: 0;
padding-top: 10px; padding-top: 10px;
padding-bottom: 10px; padding-bottom: 10px;
margin-bottom: 0; margin-bottom: 0;
list-style-type: none; list-style-type: none;
color: #ccc color: #ccc
} }
   
#pre-content #breadcrumbs li { #pre-content #breadcrumbs li {
color: #999; color: #999;
display: inline-block; display: inline-block;
zoom: 1; zoom: 1;
*display: inline; *display: inline;
margin-right: 8px margin-right: 8px
} }
   
#pre-content #breadcrumbs li:after { #pre-content #breadcrumbs li:after {
content: '/'; content: '/';
display: inline-block; display: inline-block;
zoom: 1; zoom: 1;
*display: inline; *display: inline;
margin-left: 12px margin-left: 12px
} }
   
#pre-content #breadcrumbs li:last-child:after { #pre-content #breadcrumbs li:last-child:after {
display: none display: none
} }
   
#pre-content #breadcrumbs a { #pre-content #breadcrumbs a {
color: #999 color: #999
} }
   
#pre-content #breadcrumbs a:hover { #pre-content #breadcrumbs a:hover {
color: #000; color: #000;
text-decoration: none text-decoration: none
} }
   
#pre-content #breadcrumbs .spacer { #pre-content #breadcrumbs .spacer {
color: #ccc color: #ccc
} }
</style> </style>
<py:if test="defined('optional_head')"> <py:if test="defined('optional_head')">
${optional_head()} ${optional_head()}
</py:if> </py:if>
   
${h.literal(getattr(g, 'template_head_end', ''))} ${h.literal(getattr(g, 'template_head_end', ''))}
</head> </head>
   
<body class="${request.environ.get('pylons.routes_dict', {}).get('action')} <body class="${request.environ.get('pylons.routes_dict', {}).get('action')}
${request.environ.get('pylons.routes_dict', {}).get('controller').split(':')[-1]} ${request.environ.get('pylons.routes_dict', {}).get('controller').split(':')[-1]}
${defined('body_class') and body_class()} ${defined('body_class') and body_class()}
"> ">
   
<div id="wrap"> <div id="wrap">
<div class="header outer"> <div class="header outer">
<header class="container"> <header class="container">
<div class="menu account"> <div class="menu account">
<span class="ckan-logged-in" style="display: none;"> <span class="ckan-logged-in" style="display: none;">
<a href="${h.url_for(controller='user',action='me')}">${h.gravatar((c.userobj.email_hash if c and c.userobj else ''),size=20)}${c.user}</a> <a href="${h.url_for(controller='user',action='me')}">${h.gravatar((c.userobj.email_hash if c and c.userobj else ''),size=20)}${c.user}</a>
<a href="${h.url_for('/user/_logout')}">Logout</a> <a href="${h.url_for('/user/_logout')}">Logout</a>
</span> </span>
<span class="ckan-logged-out"> <span class="ckan-logged-out">
<a href="${h.url_for(controller='user',action='login')}">Login</a> <a href="${h.url_for(controller='user',action='login')}">Login</a>
<a href="${h.url_for(controller='user',action='register')}">Register</a> <a href="${h.url_for(controller='user',action='register')}">Register</a>
</span> </span>
</div> </div>
<a href="${h.url('home')}"> <a href="${h.url('home')}">
<img width="64" src="${h.url_for_static(g.site_logo)}" alt="${g.site_title} Logo" title="${g.site_title} Logo" id="logo" /> <img width="196" src="${h.url_for_static(g.site_logo)}" alt="${g.site_title} Logo" title="${g.site_title} Logo" id="logo" />
</a> </a>
<div id="site-name"> <div id="site-name">
<!-- <a href="${h.url('home')}">${g.site_title} &mdash; ${g.site_description}</a>--> <!-- <a href="${h.url('home')}">${g.site_title} &mdash; ${g.site_description}</a>-->
</div> </div>
<div class="menu"> <div class="menu">
<!-- <span id="menusearch"> <!-- <span id="menusearch">
<form action="${h.url(controller='package', action='search')}" method="GET"> <form action="${h.url(controller='package', action='search')}" method="GET">
<input name="q" value="${c.q if hasattr(c, 'q') else ''}" class="search" placeholder="${_('Find datasets')}" /> <input name="q" value="${c.q if hasattr(c, 'q') else ''}" class="search" placeholder="${_('Find datasets')}" />
</form> </form>
</span> </span>
<div id="mainmenu"> <div id="mainmenu">
<span py:if="h.check_access('package_create')">${h.nav_link(_('Add a dataset'), controller='package', action='new')}</span> <span py:if="h.check_access('package_create')">${h.nav_link(_('Add a dataset'), controller='package', action='new')}</span>
${h.nav_link(_('Search'), controller='package', action='search', highlight_actions = 'new index')} ${h.nav_link(_('Search'), controller='package', action='search', highlight_actions = 'new index')}
${h.nav_link(_('Groups'), named_route='%s_index' % h.default_group_type())} ${h.nav_link(_('Groups'), named_route='%s_index' % h.default_group_type())}
${h.nav_link(_('About'), controller='home', action='about')} ${h.nav_link(_('About'), controller='home', action='about')}
</div>--> </div>-->
</div> </div>
</header> </header>
</div> </div>
<div id="pre-content"> <div id="pre-content">
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<ul id="breadcrumbs"> <ul id="breadcrumbs">
<li><a href="/"><i class="icon-home"></i></a></li> <li><a href="/"><i class="icon-home"></i></a></li>
<breadcrumbs> <breadcrumbs>
</breadcrumbs> </breadcrumbs>
</ul> </ul>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
   
<py:with vars="messages = list(h.flash.pop_messages())"> <py:with vars="messages = list(h.flash.pop_messages())">
<div class="flash-messages container"> <div class="flash-messages container">
<div class="alert ${m.category}" py:for="m in messages"> <div class="alert ${m.category}" py:for="m in messages">
${h.literal(m)} ${h.literal(m)}
</div> </div>
</div> </div>
</py:with> </py:with>
   
<div id="main" class="container" role="main"> <div id="main" class="container" role="main">
<h1 py:if="defined('page_heading')" class="page_heading"> <h1 py:if="defined('page_heading')" class="page_heading">
<img py:if="defined('page_logo')" id="page-logo" src="${page_logo()}" alt="Page Logo" /> <img py:if="defined('page_logo')" id="page-logo" src="${page_logo()}" alt="Page Logo" />
<!-- ${page_heading()} --> <!-- ${page_heading()} -->
</h1> </h1>
<div class="row"> <div class="row">
<div class="span12"> <div class="span12">
<div id="minornavigation"> <div id="minornavigation">
<minornavigation></minornavigation> <minornavigation></minornavigation>
</div> </div>
</div> </div>
</div> </div>
   
<div class="row"> <div class="row">
<div class="span9 content-outer"> <div class="span9 content-outer">
<div id="content"> <div id="content">
<py:if test="defined('content')"> <py:if test="defined('content')">
${content()} ${content()}
</py:if> </py:if>
<content> <content>
<p>Master content template placeholder &hellip; please replace me.</p> <p>Master content template placeholder &hellip; please replace me.</p>
</content> </content>
</div> <!-- /content --> </div> <!-- /content -->
</div> </div>
<div class="span3 sidebar-outer"> <div class="span3 sidebar-outer">
<div id="sidebar"> <div id="sidebar">
<div class="col-md-4"> <div class="col-md-4">
<div class="whitebox"> <div class="whitebox">
<strong>Graph Legend</strong> <strong>Graph Legend</strong>
<div id="graph-legend-container"> <div id="graph-legend-container">
<div style="display: none;" id="legend_none">(No graph is loaded)</div> <div style="display: none;" id="legend_none">(No graph is loaded)</div>
</div> </div>
</div> </div>
</div> </div>
   
<ul class="widget-list"> <ul class="widget-list">
<py:if test="defined('primary_sidebar_extras')"> <py:if test="defined('primary_sidebar_extras')">
${primary_sidebar_extras()} ${primary_sidebar_extras()}
</py:if> </py:if>
<primarysidebar> <primarysidebar>
<!-- Primary Side Bar Goes Here --> <!-- Primary Side Bar Goes Here -->
</primarysidebar> </primarysidebar>
</ul> </ul>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<br/><br/> <br/><br/>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
<div class="footer outer"> <div class="footer outer">
<footer class="container"> <footer class="container">
<div class="row"> <div class="row">
<!-- <div class="span3"> <!-- <div class="span3">
<h3 class="widget-title">About ${g.site_title}</h3> <h3 class="widget-title">About ${g.site_title}</h3>
<div class="textwidget"> <div class="textwidget">
<ul> <ul>
<li>${h.link_to(_('About'), h.url_for(controller='home', action='about'))}</li> <li>${h.link_to(_('About'), h.url_for(controller='home', action='about'))}</li>
<li> <li>
<a href="http://twitter.com/ckanproject">Twitter @ckanproject</a> <a href="http://twitter.com/ckanproject">Twitter @ckanproject</a>
</li> </li>
<li>${h.link_to(_('API'), h.url_for(controller='api', action='get_api', ver=1))}</li> <li>${h.link_to(_('API'), h.url_for(controller='api', action='get_api', ver=1))}</li>
<li>${h.link_to(_('API Docs'), 'http://docs.ckan.org/en/latest/api.html')}</li> <li>${h.link_to(_('API Docs'), 'http://docs.ckan.org/en/latest/api.html')}</li>
<li> <li>
<a href="http://ckan.org/contact/">Contact Us</a> <a href="http://ckan.org/contact/">Contact Us</a>
</li> </li>
<li> <li>
<a href="http://okfn.org/privacy-policy/">Privacy Policy</a> <a href="http://okfn.org/privacy-policy/">Privacy Policy</a>
</li> </li>
</ul> </ul>
</div> </div>
</div> </div>
<div class="span3"> <div class="span3">
<h3 class="widget-title">Sections</h3> <h3 class="widget-title">Sections</h3>
<div class="textwidget"> <div class="textwidget">
<ul> <ul>
<li> <li>
<a href="${h.url(controller='user', action='index')}"> <a href="${h.url(controller='user', action='index')}">
Users Users
</a> </a>
</li> </li>
<li> <li>
<a href="${h.url(controller='tag', action='index')}"> <a href="${h.url(controller='tag', action='index')}">
Tags Tags
</a> </a>
</li> </li>
<li py:if="'stats' in config.get('ckan.plugins','').split(' ')"> <li py:if="'stats' in config.get('ckan.plugins','').split(' ')">
<a href="${h.url('stats')}"> <a href="${h.url('stats')}">
Statistics Statistics
</a> </a>
</li> </li>
<li> <li>
<a href="${h.url(controller='revision', action='index')}"> <a href="${h.url(controller='revision', action='index')}">
Revisions Revisions
</a> </a>
</li> </li>
<li> <li>
<a href="${h.url_for('ckanadmin_index')}"> <a href="${h.url_for('ckanadmin_index')}">
Site Admin Site Admin
</a> </a>
</li> </li>
</ul> </ul>
</div> </div>
</div> </div>
<div class="span3"> <div class="span3">
<h3 class="widget-title">Languages</h3> <h3 class="widget-title">Languages</h3>
<div class="textwidget"> <div class="textwidget">
<ul> <ul>
<?python <?python
current_url = request.environ['CKAN_CURRENT_URL'] current_url = request.environ['CKAN_CURRENT_URL']
?> ?>
<li py:for="locale in h.get_available_locales()"> <li py:for="locale in h.get_available_locales()">
<a href="${h.url(current_url, locale=str(locale))}"> <a href="${h.url(current_url, locale=str(locale))}">
${locale.display_name or locale.english_name} ${locale.display_name or locale.english_name}
</a> </a>
</li> </li>
</ul> </ul>
</div> </div>
</div>--> </div>-->
<div class="span12"> <div class="span12">
<p id="credits"> <p id="credits">
&copy; 2012-2014 &copy; 2012-2014
<img src="//assets.okfn.org/images/logo/okf_logo_white_and_green_tiny.png" id="footer-okf-logo" /> <img src="//assets.okfn.org/images/logo/okf_logo_white_and_green_tiny.png" id="footer-okf-logo" />
<a href="http://okfn.org/">Open Knowledge Foundation</a> <a href="http://okfn.org/">Open Knowledge Foundation</a>
Licensed under the <a href="http://opendatacommons.org/licenses/odbl/1.0/">Open Database License</a> Licensed under the <a href="http://opendatacommons.org/licenses/odbl/1.0/">Open Database License</a>
<a href="http://opendefinition.org/"><img alt="This Content and Data is Open" src="//assets.okfn.org/images/ok_buttons/od_80x15_blue.png" style="border: none;"/></a> <a href="http://opendefinition.org/"><img alt="This Content and Data is Open" src="//assets.okfn.org/images/ok_buttons/od_80x15_blue.png" style="border: none;"/></a>
   
<br/><br/> <br/><br/>
Powered by <a href="http://ckan.org">CKAN</a> v${c.__version__}.<br/> Powered by <a href="http://ckan.org">CKAN</a> v${c.__version__}.<br/>
</p> </p>
</div> </div>
</div> </div>
</footer> </footer>
</div> <!-- eo #container --> </div> <!-- eo #container -->
<div style="display:none;" id="scripts"> <div style="display:none;" id="scripts">
<!--<script src="${h.url_for_static('/scripts/vendor/jquery/1.7.1/jquery.js')}"></script>--> <!--<script src="${h.url_for_static('/scripts/vendor/jquery/1.7.1/jquery.js')}"></script>-->
<script type="text/javascript" src="${h.url_for_static('/scripts/vendor/json2.js')}"></script> <script type="text/javascript" src="${h.url_for_static('/scripts/vendor/json2.js')}"></script>
<script type="text/javascript" src="${h.url_for_static('/scripts/vendor/jquery.tmpl/beta1/jquery.tmpl.js')}"></script> <script type="text/javascript" src="${h.url_for_static('/scripts/vendor/jquery.tmpl/beta1/jquery.tmpl.js')}"></script>
<script type="text/javascript" src="${h.url_for_static('/scripts/vendor/jquery.cookie/jquery.cookie.min.js')}"></script> <script type="text/javascript" src="${h.url_for_static('/scripts/vendor/jquery.cookie/jquery.cookie.min.js')}"></script>
<script type="text/javascript" src="${h.url_for_static('/scripts/vendor/jquery.chosen/0.9.7/chosen.js')}"></script> <script type="text/javascript" src="${h.url_for_static('/scripts/vendor/jquery.chosen/0.9.7/chosen.js')}"></script>
<script type="text/javascript" src="${h.url_for_static('/scripts/vendor/jquery.placeholder/jquery.placeholder.js')}"></script> <script type="text/javascript" src="${h.url_for_static('/scripts/vendor/jquery.placeholder/jquery.placeholder.js')}"></script>
<script type="text/javascript" src="${h.url_for_static('/scripts/vendor/jqueryui/1.8.14/jquery-ui.min.js')}"></script> <script type="text/javascript" src="${h.url_for_static('/scripts/vendor/jqueryui/1.8.14/jquery-ui.min.js')}"></script>
<script type="text/javascript" src="${h.url_for_static('/scripts/vendor/bootstrap/2.0.3/bootstrap.min.js')}"></script> <script type="text/javascript" src="${h.url_for_static('/scripts/vendor/bootstrap/2.0.3/bootstrap.min.js')}"></script>
   
<!-- for application.js --> <!-- for application.js -->
<script type="text/javascript" src="${h.url_for_static('/scripts/vendor/underscore/1.1.6/underscore.js')}"></script> <script type="text/javascript" src="${h.url_for_static('/scripts/vendor/underscore/1.1.6/underscore.js')}"></script>
<script type="text/javascript" src="${h.url_for_static('/scripts/vendor/backbone/0.5.1/backbone.js')}"></script> <script type="text/javascript" src="${h.url_for_static('/scripts/vendor/backbone/0.5.1/backbone.js')}"></script>
<script type="text/javascript" src="${h.url_for_static('/scripts/vendor/jquery.fileupload/20110801/jquery.iframe-transport.js')}"></script> <script type="text/javascript" src="${h.url_for_static('/scripts/vendor/jquery.fileupload/20110801/jquery.iframe-transport.js')}"></script>
<script type="text/javascript" src="${h.url_for_static('/scripts/vendor/jquery.fileupload/20110801/jquery.fileupload.js')}"></script> <script type="text/javascript" src="${h.url_for_static('/scripts/vendor/jquery.fileupload/20110801/jquery.fileupload.js')}"></script>
   
<!-- Translated js strings live inside an html template. --> <!-- Translated js strings live inside an html template. -->
<xi:include href="../../js_strings.html" /> <xi:include href="../../js_strings.html" />
<!-- finally our application js that sets everything up--> <!-- finally our application js that sets everything up-->
<script type="text/javascript" src="${h.url_for_static('/scripts/application.js?lang=${c.locale}')}"></script> <script type="text/javascript" src="${h.url_for_static('/scripts/application.js?lang=${c.locale}')}"></script>
<script type="text/javascript" src="${h.url_for_static('/scripts/templates.js')}"></script> <script type="text/javascript" src="${h.url_for_static('/scripts/templates.js')}"></script>
   
<script type="text/javascript"> <script type="text/javascript">
CKAN.plugins = [ CKAN.plugins = [
// Declare js array from Python string // Declare js array from Python string
${['\'%s\', '%s for s in config.get('ckan.plugins','').split(' ')]} ${['\'%s\', '%s for s in config.get('ckan.plugins','').split(' ')]}
]; ];
<py:if test="config.get('ckan.storage.bucket', '')"> <py:if test="config.get('ckan.storage.bucket', '')">
CKAN.plugins.push('storage'); CKAN.plugins.push('storage');
</py:if> </py:if>
CKAN.SITE_URL = '${h.url('/')}'; CKAN.SITE_URL = '${h.url('/')}';
CKAN.SITE_URL_NO_LOCALE = '${h.url('/', locale='default')}'; CKAN.SITE_URL_NO_LOCALE = '${h.url('/', locale='default')}';
CKAN.LANG = '${h.lang()}'; CKAN.LANG = '${h.lang()}';
// later use will add offsets with leading '/' so ensure no trailing slash // later use will add offsets with leading '/' so ensure no trailing slash
CKAN.SITE_URL = CKAN.SITE_URL.replace(/\/$/, ''); CKAN.SITE_URL = CKAN.SITE_URL.replace(/\/$/, '');
CKAN.SITE_URL_NO_LOCALE = CKAN.SITE_URL_NO_LOCALE.replace(/\/$/, ''); CKAN.SITE_URL_NO_LOCALE = CKAN.SITE_URL_NO_LOCALE.replace(/\/$/, '');
$(document).ready(function() { $(document).ready(function() {
var ckan_user = '${c.user}'; var ckan_user = '${c.user}';
if (ckan_user) { if (ckan_user) {
$(".ckan-logged-out").hide(); $(".ckan-logged-out").hide();
$(".ckan-logged-in").show(); $(".ckan-logged-in").show();
} }
$('input[placeholder], textarea[placeholder]').placeholder(); $('input[placeholder], textarea[placeholder]').placeholder();
   
$(".chzn-select").chosen(); $(".chzn-select").chosen();
}); });
</script> </script>
   
<py:if test="h.asbool(config.get('ckan.tracking_enabled', 'false'))"> <py:if test="h.asbool(config.get('ckan.tracking_enabled', 'false'))">
${ h.snippet('snippets/internal-tracking.html') } ${ h.snippet('snippets/internal-tracking.html') }
</py:if> </py:if>
</div> <!-- #scripts --> </div> <!-- #scripts -->
   
<py:if test="defined('optional_footer')"> <py:if test="defined('optional_footer')">
${optional_footer()} ${optional_footer()}
</py:if> </py:if>
   
${h.literal(getattr(g, 'template_footer_end', ''))} ${h.literal(getattr(g, 'template_footer_end', ''))}
</body> </body>
</html> </html>