diff --git a/README.md b/README.md index 12bc555..60cd7c3 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,9 @@ -[![Tests](https://github.com/keitaroinc/ckanext-iaea/workflows/Tests/badge.svg?branch=main)](https://github.com/keitaroinc/ckanext-iaea/actions) +[![Tests](https://github.com/keitaroinc/ckanext-iaea/workflows/Tests/badge.svg?branch=main)](https://github.com/keitaroinc/ckanext-iaea/actions/workflows/test.yml) +[![CKAN](https://img.shields.io/badge/ckan-2.9-orange.svg?style=flat-square)](https://github.com/ckan/ckan) # ckanext-iaea -**TODO:** Put a description of your extension here: What does it do? What features does it have? Consider including some screenshots or embedding a video! +A custom CKAN extension for International Atomic Energy Agency (IAEA) data portal. ## Requirements @@ -19,22 +20,13 @@ Compatibility with core CKAN versions: | 2.6 and earlier | not tested | | 2.7 | not tested | | 2.8 | not tested | -| 2.9 | not tested | +| 2.9 | Yes | +| 2.10 | Yes | -Suggested values: - -* "yes" -* "not tested" - I can't think of a reason why it wouldn't work -* "not yet" - there is an intention to get it working -* "no" ## Installation -**TODO:** Add any additional install steps to the list below. - For example installing any non-Python dependencies or adding any required - config settings. - To install ckanext-iaea: 1. Activate your CKAN virtual environment, for example: diff --git a/ckanext/iaea/assets/webassets.yml b/ckanext/iaea/assets/webassets.yml index 6fd1dc5..c247b30 100644 --- a/ckanext/iaea/assets/webassets.yml +++ b/ckanext/iaea/assets/webassets.yml @@ -1,14 +1,14 @@ -# iaea-js: -# filter: rjsmin -# output: ckanext-iaea/%(version)s-iaea.js -# contents: -# - js/iaea.js -# extra: -# preload: -# - base/main +iaea-js: + filter: rjsmin + output: ckanext-iaea/%(version)s-iaea.js + contents: + - js/iaea.js + extra: + preload: + - base/main -# iaea-css: -# filter: cssrewrite -# output: ckanext-iaea/%(version)s-iaea.css -# contents: -# - css/iaea.css +iaea-css: + filter: cssrewrite + output: ckanext-iaea/%(version)s-iaea.css + contents: + - css/iaea.css diff --git a/ckanext/iaea/plugin.py b/ckanext/iaea/plugin.py index 865c0db..0b2b6a4 100644 --- a/ckanext/iaea/plugin.py +++ b/ckanext/iaea/plugin.py @@ -4,11 +4,11 @@ class IaeaPlugin(plugins.SingletonPlugin): plugins.implements(plugins.IConfigurer) + plugins.implements(plugins.ITranslation) # IConfigurer def update_config(self, config_): toolkit.add_template_directory(config_, 'templates') toolkit.add_public_directory(config_, 'public') - toolkit.add_resource('fanstatic', - 'iaea') + toolkit.add_resource('assets', 'iaea') diff --git a/ckanext/iaea/templates/base.html b/ckanext/iaea/templates/base.html new file mode 100644 index 0000000..0a84b70 --- /dev/null +++ b/ckanext/iaea/templates/base.html @@ -0,0 +1,9 @@ +{% ckan_extends %} + +{% block styles %} + +{{ super() }} + +{% asset 'iaea/iaea-css' %} + +{% endblock %} \ No newline at end of file diff --git a/ckanext/iaea/tests/test_plugin.py b/ckanext/iaea/tests/test_plugin.py index 0c5a6d7..8355cfe 100644 --- a/ckanext/iaea/tests/test_plugin.py +++ b/ckanext/iaea/tests/test_plugin.py @@ -48,6 +48,10 @@ def test_some_action(): pass """ import ckanext.iaea.plugin as plugin +import pytest +@pytest.mark.ckan_config("ckan.plugins", "iaea") +@pytest.mark.usefixtures("with_plugins") def test_plugin(): + # assert plugin_loaded("iaea") pass