Skip to content

Commit

Permalink
Initial configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
blagojabozinovski committed Feb 23, 2024
1 parent 777bacb commit 26ae4b8
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 28 deletions.
18 changes: 5 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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:
Expand Down
26 changes: 13 additions & 13 deletions ckanext/iaea/assets/webassets.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions ckanext/iaea/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
9 changes: 9 additions & 0 deletions ckanext/iaea/templates/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{% ckan_extends %}

{% block styles %}

{{ super() }}

{% asset 'iaea/iaea-css' %}

{% endblock %}
4 changes: 4 additions & 0 deletions ckanext/iaea/tests/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 26ae4b8

Please sign in to comment.