From caf2d7151fb6983f447147b4f3bb72c55cb349a0 Mon Sep 17 00:00:00 2001 From: Jesper Zedlitz <jesper.zedlitz@melund.landsh.de> Date: Wed, 6 Jul 2022 15:50:45 +0200 Subject: [PATCH] _SRVC aus der Formatanzeige entfernen --- ckanext/odsh/templates/package/snippets/resource_item.html | 5 +++-- ckanext/odsh/templates/snippets/package_item.html | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ckanext/odsh/templates/package/snippets/resource_item.html b/ckanext/odsh/templates/package/snippets/resource_item.html index 457eb4d8..296f03aa 100644 --- a/ckanext/odsh/templates/package/snippets/resource_item.html +++ b/ckanext/odsh/templates/package/snippets/resource_item.html @@ -6,6 +6,7 @@ {% set rtitle=h.resource_display_name(res) if res.name else ' '%} {% set resource_size = h.tpsh_get_resource_size(res) %} +{% set res_format = res.format.replace('_SRVC','') %} <li class="resource-item" data-id="{{ res.id }}"> <div class="resource-title-container"> @@ -35,9 +36,9 @@ {% endif %} {% endblock %} </div> - {% if res.format %} + {% if res_format %} <a href="{{ download }}" > - <div class="dataformat-label resource-dataformat-label label" style='font-size:{{150/(res.format|length)}}px'>{{res.format}}</div> + <div class="dataformat-label resource-dataformat-label label" style='font-size:{{150/(res_format|length)}}px'>{{res_format}}</div> </a> {% endif %} </div> diff --git a/ckanext/odsh/templates/snippets/package_item.html b/ckanext/odsh/templates/snippets/package_item.html index b0918d3e..d61b6a8f 100644 --- a/ckanext/odsh/templates/snippets/package_item.html +++ b/ckanext/odsh/templates/snippets/package_item.html @@ -121,8 +121,8 @@ Example: {% for resource in h.dict_list_reduce(package.resources, 'format') %} <li> <a href="{{ h.url_for(controller='package', action='read', id=package.name) }}" class="label dataformat-label" - data-format="{{ resource.lower() }}">{{ - resource }}</a> + data-format="{{ resource.lower().replace('_srvc','') }}">{{ + resource.replace('_srvc','') }}</a> </li> {% endfor %} {% endblock %} -- GitLab