Skip to content

Commit

Permalink
[#3414] remove if datapusher in g.plugins from core templates
Browse files Browse the repository at this point in the history
  • Loading branch information
wardi committed Jan 27, 2017
1 parent 685842e commit 10b60d5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 1 addition & 3 deletions ckan/templates/package/resource_edit_base.html
Expand Up @@ -22,9 +22,7 @@

{% block content_primary_nav %}
{{ h.build_nav_icon('resource_edit', _('Edit resource'), id=pkg.name, resource_id=res.id) }}
{% if 'datapusher' in g.plugins %}
{{ h.build_nav_icon('resource_data', _('DataStore'), id=pkg.name, resource_id=res.id) }}
{% endif %}
{% block inner_primary_nav %}{% endblock %}
{{ h.build_nav_icon('views', _('Views'), id=pkg.name, resource_id=res.id) }}
{% endblock %}

Expand Down
4 changes: 4 additions & 0 deletions ckanext/datapusher/plugin.py
Expand Up @@ -72,6 +72,7 @@ def resource_data(self, id, resource_id):


class DatapusherPlugin(p.SingletonPlugin):
p.implements(p.IConfigurer, inherit=True)
p.implements(p.IConfigurable, inherit=True)
p.implements(p.IActions)
p.implements(p.IAuthFunctions)
Expand All @@ -83,6 +84,9 @@ class DatapusherPlugin(p.SingletonPlugin):
legacy_mode = False
resource_show_action = None

def update_config(self, config):
p.toolkit.add_template_directory(config, 'templates')

def configure(self, config):
self.config = config

Expand Down
5 changes: 5 additions & 0 deletions ckanext/datapusher/templates/package/resource_edit_base.html
@@ -0,0 +1,5 @@
{% ckan_extends %}

{% block inner_primary_nav %}
{{ h.build_nav_icon('resource_data', _('DataPusher'), id=pkg.name, resource_id=res.id) }}
{% endblock %}

0 comments on commit 10b60d5

Please sign in to comment.