Skip to content

Commit

Permalink
[#2493] Stats extension clean-up
Browse files Browse the repository at this point in the history
* removed templates_legacy - no-one uses these. Removed associated
  style.css.
* leaderboard goes with it as there is no jinja equiv and no interest.
  Removed associated controller, demo.html and app.js.
  • Loading branch information
David Read committed Jun 25, 2015
1 parent dd5d6a4 commit 9793ce9
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 352 deletions.
15 changes: 2 additions & 13 deletions ckanext/stats/controller.py
@@ -1,8 +1,9 @@
import ckan.plugins as p
from ckan.lib.base import BaseController, config
from ckan.lib.base import BaseController
import stats as stats_lib
import ckan.lib.helpers as h


class StatsController(BaseController):

def index(self):
Expand All @@ -19,13 +20,8 @@ def index(self):
c.num_packages_by_week = rev_stats.get_num_packages_by_week()
c.package_revisions_by_week = rev_stats.get_by_week('package_revisions')

# Used in the legacy CKAN templates.
c.packages_by_week = []

# Used in new CKAN templates gives more control to the templates for formatting.
c.raw_packages_by_week = []
for week_date, num_packages, cumulative_num_packages in c.num_packages_by_week:
c.packages_by_week.append('[new Date(%s), %s]' % (week_date.replace('-', ','), cumulative_num_packages))
c.raw_packages_by_week.append({'date': h.date_str_to_datetime(week_date), 'total_packages': cumulative_num_packages})

c.all_package_revisions = []
Expand All @@ -41,10 +37,3 @@ def index(self):
c.raw_new_datasets.append({'date': h.date_str_to_datetime(week_date), 'new_packages': num_packages})

return p.toolkit.render('ckanext/stats/index.html')

def leaderboard(self, id=None):
c = p.toolkit.c
c.solr_core_url = config.get('ckanext.stats.solr_core_url',
'http://solr.okfn.org/solr/ckan')
return p.toolkit.render('ckanext/stats/leaderboard.html')

59 changes: 0 additions & 59 deletions ckanext/stats/public/ckanext/stats/app.js

This file was deleted.

25 changes: 0 additions & 25 deletions ckanext/stats/public/ckanext/stats/demo.html

This file was deleted.

59 changes: 0 additions & 59 deletions ckanext/stats/public/ckanext/stats/style.css

This file was deleted.

Empty file.
Empty file.
Empty file.
163 changes: 0 additions & 163 deletions ckanext/stats/templates_legacy/ckanext/stats/index.html

This file was deleted.

33 changes: 0 additions & 33 deletions ckanext/stats/templates_legacy/ckanext/stats/leaderboard.html

This file was deleted.

0 comments on commit 9793ce9

Please sign in to comment.