Skip to content

Commit

Permalink
Mostrar la version en el footer
Browse files Browse the repository at this point in the history
  • Loading branch information
avdata99 committed Oct 23, 2024
1 parent 62872c3 commit 6af5e88
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 1 deletion.
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/page.html
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 -%}
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

0 comments on commit 6af5e88

Please sign in to comment.