Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Agregar la version de UNCKAN al footer #14

Merged
merged 2 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
6 changes: 6 additions & 0 deletions ckanext-unckan/ckanext/unckan/helpers/base.py
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')
9 changes: 9 additions & 0 deletions ckanext-unckan/ckanext/unckan/plugin.py
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,
}
6 changes: 6 additions & 0 deletions ckanext-unckan/ckanext/unckan/templates/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{% ckan_extends %}

{% block footer_attribution %}
{{ super() }}
<p>UNCKAN v{{ h.get_unckan_version() }}</p>
{% endblock %}
2 changes: 1 addition & 1 deletion docker/ckan/files/env/base.env
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Do not change this file for your local env
# Use local.env to set your local env variables

CKAN_UNI_VERSION=0.4.2
CKAN_UNI_VERSION=0.4.3
CKAN_GIT_URL=https://github.com/ckan/ckan.git
CKAN_GIT_BRANCH=ckan-2.10.5

Expand Down
2 changes: 2 additions & 0 deletions docker/ckan/files/scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ DATAPUSHER_TOKEN=$(ckan user token add default datapusher_multi expires_in=365 u
ckan config-tool ckan.ini "ckan.datapusher.api_token=${DATAPUSHER_TOKEN}"
ckan config-tool ckan.ini "ckanext.datapusher_plus.api_token=${DATAPUSHER_TOKEN}"

ckan config-tool ckan.ini "ckanext.unckan.version=${CKAN_UNI_VERSION}"

# Rebuild webassets in can they were patched
ckan asset build

Expand Down
Loading