Skip to content

Commit

Permalink
[#2618] Stats uses fanstatic
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Aug 16, 2012
1 parent 8f70817 commit fe53e85
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
1 change: 1 addition & 0 deletions ckanext/stats/plugin.py
Expand Up @@ -24,3 +24,4 @@ def update_config(self, config):
templates = 'templates_legacy'
p.toolkit.add_template_directory(config, templates)
p.toolkit.add_public_directory(config, 'public')
p.toolkit.add_resource('public/ckanext/stats', 'ckanext_stats')
12 changes: 12 additions & 0 deletions ckanext/stats/public/ckanext/stats/resource.config
@@ -0,0 +1,12 @@
[IE conditional]

lte IE 8 = vendor/excanvas.js

[groups]

stats =
css/stats.css
vendor/excanvas.js
vendor/jquery.flot.js
javascript/modules/plot.js
javascript/modules/stats-nav.js
11 changes: 1 addition & 10 deletions ckanext/stats/templates/ckanext/stats/index.html
@@ -1,11 +1,5 @@
{% extends "page.html" %}


{% block styles %}
{{ super() }}
<link rel="stylesheet" href="{% url_for_static "/ckanext/stats/css/stats.css" %}" />
{% endblock %}

{% block breadcrumb_content %}
<li class="active">{{ 'Statistics' }}</li>
{% endblock %}
Expand Down Expand Up @@ -195,14 +189,11 @@ <h2 class="module-heading"><i class="icon-bar-chart icon-medium"></i> {{ _('Stat

{% block scripts %}
{{ super() }}
<!--[if lte IE 8]><script src="{% url_for_static "/ckanext/stats/vendor/excanvas.js" %}"></script><![endif]-->
<script src="{% url_for_static "/ckanext/stats/vendor/jquery.flot.js" %}"></script>
<script src="{% url_for_static "/ckanext/stats/javascript/modules/plot.js" %}"></script>
<script src="{% url_for_static "/ckanext/stats/javascript/modules/stats-nav.js" %}"></script>
{#
Hellish hack to get excanvas to work in IE8. We disable html5shiv from
overriding the createElement() method on this page.
See: http://stackoverflow.com/questions/10208062/using-flot-with-bootstrap-ie8-incompatibility
#}
{% resource "vendor/block_html5_shim" %}
{% resource "ckanext_stats/stats" %}
{% endblock %}

0 comments on commit fe53e85

Please sign in to comment.