-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from ckan.common import config | ||
|
||
|
||
def get_unckan_version(): | ||
""" Get the UNCKAN extnsion version from CKAN_UNI_VERSION """ | ||
return config.get('ckanext.unckan.version') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,26 @@ | ||
import logging | ||
from ckan import plugins | ||
from ckan.plugins import toolkit | ||
from ckanext.unckan.helpers import base | ||
|
||
|
||
log = logging.getLogger(__name__) | ||
|
||
|
||
class UnCKANPlugin(plugins.SingletonPlugin): | ||
plugins.implements(plugins.IConfigurer) | ||
plugins.implements(plugins.ITemplateHelpers) | ||
|
||
# IConfigurer | ||
|
||
def update_config(self, config_): | ||
toolkit.add_template_directory(config_, "templates") | ||
toolkit.add_public_directory(config_, "public") | ||
toolkit.add_resource("assets", "unckan") | ||
|
||
# ITemplateHelpers | ||
|
||
def get_helpers(self): | ||
return { | ||
'get_unckan_version': base.get_unckan_version | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{% ckan extends %} | ||
|
||
{%- block footer %} | ||
{{ super() }} | ||
UNCKAN v{{ h.get_unckan_version }} | ||
{% endblock -%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters