Skip to content

Commit

Permalink
Merge branch '551-remove-comments-template-method'
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Jun 14, 2013
2 parents bc877e0 + 80b026e commit 3dcb714
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 45 deletions.
24 changes: 0 additions & 24 deletions ckan/controllers/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ def _new_template(self, package_type):
def _edit_template(self, package_type):
return lookup_package_plugin(package_type).edit_template()

def _comments_template(self, package_type):
return lookup_package_plugin(package_type).comments_template()

def _search_template(self, package_type):
return lookup_package_plugin(package_type).search_template()

Expand Down Expand Up @@ -357,27 +354,6 @@ def read(self, id, format='html'):

return render(template, loader_class=loader)

def comments(self, id):
package_type = self._get_package_type(id)
context = {'model': model, 'session': model.Session,
'user': c.user or c.author}

# check if package exists
try:
c.pkg_dict = get_action('package_show')(context, {'id': id})
c.pkg = context['package']
except NotFound:
abort(404, _('Dataset not found'))
except NotAuthorized:
abort(401, _('Unauthorized to read package %s') % id)

# used by disqus plugin
c.current_package_id = c.pkg.id

# render the package
package_saver.PackageSaver().render_package(c.pkg_dict)
return render(self._comments_template(package_type))

def history(self, id):
package_type = self._get_package_type(id.split('@')[0])

Expand Down
3 changes: 0 additions & 3 deletions ckan/lib/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,6 @@ def read_template(self):
def edit_template(self):
return 'package/edit.html'

def comments_template(self):
return 'package/comments.html'

def search_template(self):
return 'package/search.html'

Expand Down
10 changes: 0 additions & 10 deletions ckan/plugins/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,16 +690,6 @@ def edit_template(self):
'''

def comments_template(self):
'''Return the path to the template for the dataset comments page.
The path should be relative to the plugin's templates dir, e.g.
``'package/comments.html'``.
:rtype: string
'''

def search_template(self):
'''Return the path to the template for use in the dataset search page.
Expand Down
5 changes: 0 additions & 5 deletions ckanext/example_idatasetform/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ class ExampleIDatasetFormPlugin(plugins.SingletonPlugin,
num_times_new_template_called = 0
num_times_read_template_called = 0
num_times_edit_template_called = 0
num_times_comments_template_called = 0
num_times_search_template_called = 0
num_times_history_template_called = 0
num_times_package_form_called = 0
Expand Down Expand Up @@ -150,10 +149,6 @@ def edit_template(self):
ExampleIDatasetFormPlugin.num_times_edit_template_called += 1
return super(ExampleIDatasetFormPlugin, self).edit_template()

def comments_template(self):
ExampleIDatasetFormPlugin.num_times_comments_template_called += 1
return super(ExampleIDatasetFormPlugin, self).comments_template()

def search_template(self):
ExampleIDatasetFormPlugin.num_times_search_template_called += 1
return super(ExampleIDatasetFormPlugin, self).search_template()
Expand Down
3 changes: 0 additions & 3 deletions ckanext/test_tag_vocab_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ def new_template(self):
def edit_template(self):
return 'package/edit.html'

def comments_template(self):
return 'package/comments.html'

def search_template(self):
return 'package/search.html'

Expand Down

0 comments on commit 3dcb714

Please sign in to comment.