diff --git a/.github/workflows/build-image.yaml b/.github/workflows/build-image.yaml index 739d2cb7..be512aeb 100644 --- a/.github/workflows/build-image.yaml +++ b/.github/workflows/build-image.yaml @@ -120,7 +120,7 @@ jobs: ;; "build_push_test_ckan") - echo "BUILD_TAGS=${{ matrix.app.version }}-test-d" >> $GITHUB_ENV + echo "BUILD_TAGS=${{ matrix.app.version }}-test" >> $GITHUB_ENV echo "DOCKERFILE=${{ matrix.app.version }}" >> $GITHUB_ENV echo "BUILD_CKAN_BASE=true" >> $GITHUB_ENV echo "ADD_PATCH_TAG=true" >> $GITHUB_ENV diff --git a/build-config.yaml b/build-config.yaml index 02356076..5f13c9c6 100644 --- a/build-config.yaml +++ b/build-config.yaml @@ -2,7 +2,7 @@ apps: ckan: &app_ckan name: ckan version: "2.10.4" - patch: g + patch: h pycsw: &app_pycsw name: pycsw version: "2.6.1" diff --git a/ckanext/datagovuk/ckan_patches/helpers.py b/ckanext/datagovuk/ckan_patches/helpers.py new file mode 100644 index 00000000..464e92ac --- /dev/null +++ b/ckanext/datagovuk/ckan_patches/helpers.py @@ -0,0 +1,21 @@ +import dominate +import dominate.tags as dom_tags +from markupsafe import Markup, escape +from typing import Any + +from ckan.lib.helpers import _preprocess_dom_attrs, literal, core_helper + + +@core_helper +def link_to(label: str, url: str, **attrs: Any) -> Markup: + attrs = _preprocess_dom_attrs(attrs) + attrs['href'] = url + if label == '' or label is None: + label = url + + # without dominate.util.raw the returned literal has encoding within it + return literal(dom_tags.a(dominate.util.raw(label), **attrs)) + + +import ckan.lib.helpers +ckan.lib.helpers.link_to = link_to diff --git a/ckanext/datagovuk/plugin.py b/ckanext/datagovuk/plugin.py index ee1e008e..20d7ba17 100644 --- a/ckanext/datagovuk/plugin.py +++ b/ckanext/datagovuk/plugin.py @@ -259,7 +259,7 @@ def dgu_home(): return bp # import these for monkey patching - from ckanext.datagovuk.ckan_patches import cli, logic, query + from ckanext.datagovuk.ckan_patches import cli, logic, query, helpers # ITemplateHelpers