From 00c330fcae4317ae799d9d69f4d10acec1ccf332 Mon Sep 17 00:00:00 2001 From: Thorge Petersen <petersen@rz.uni-kiel.de> Date: Mon, 16 Sep 2024 15:42:08 +0200 Subject: [PATCH] Replaced deprecated resource blueprint with preferred <package_type>_resource --- ckanext/odsh/templates/package/read.html | 2 +- ckanext/odsh/templates/package/resource_edit_base.html | 4 ++-- ckanext/odsh/templates/package/snippets/resource_form.html | 2 +- ckanext/odsh/templates/package/snippets/resource_item.html | 4 ++-- ckanext/odsh/templates/package/snippets/resources_list.html | 2 +- ckanext/odsh/templates/package/view_edit_base.html | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ckanext/odsh/templates/package/read.html b/ckanext/odsh/templates/package/read.html index 17d6f37f..62ab0d93 100644 --- a/ckanext/odsh/templates/package/read.html +++ b/ckanext/odsh/templates/package/read.html @@ -106,7 +106,7 @@ {% snippet "package/snippets/resources_list.html", pkg=pkg, resources=pkg.resources %} {% if h.check_access('package_update', {'id':pkg.id }) %} <div class='add-resource-container'> - {% link_for _('Add new resource'), named_route='resource.new', id=pkg.name, class_='btn btn-primary', icon='plus' %} + {% link_for _('Add new resource'), named_route='dataset_resource.new', id=pkg.name, class_='btn btn-primary', icon='plus' %} </div> {% endif %} {% endblock package_resources %} diff --git a/ckanext/odsh/templates/package/resource_edit_base.html b/ckanext/odsh/templates/package/resource_edit_base.html index 4ada9a1e..1262ac0a 100644 --- a/ckanext/odsh/templates/package/resource_edit_base.html +++ b/ckanext/odsh/templates/package/resource_edit_base.html @@ -8,7 +8,7 @@ {% block breadcrumb_content %} {{ super() }} {% if res %} - <li>{% link_for h.resource_display_name(res)|truncate(30), named_route='resource.read', id=pkg.name, resource_id=res.id %}</li> + <li>{% link_for h.resource_display_name(res)|truncate(30), named_route='dataset_resource.read', id=pkg.name, resource_id=res.id %}</li> <li{% block breadcrumb_edit_selected %} class="active"{% endblock %}><a href="">{{ _('Edit') }}</a></li> {% endif %} {% endblock %} @@ -25,7 +25,7 @@ {% if res %} <div class="odsh-dataset-heading"> <span class='title'>Ressource {%if(res.name)%}"{{res.name}}"{%endif%} bearbeiten</span> - {% link_for _('Back'), named_route='resource.read', id=pkg.name, resource_id=res.id, class_='btn btn-heading', icon='arrow-left' %} + {% link_for _('Back'), named_route='dataset_resource.read', id=pkg.name, resource_id=res.id, class_='btn btn-heading', icon='arrow-left' %} <span class="clear"></span> </div> {% endif %} diff --git a/ckanext/odsh/templates/package/snippets/resource_form.html b/ckanext/odsh/templates/package/snippets/resource_form.html index d67a14ba..f2ee2a83 100644 --- a/ckanext/odsh/templates/package/snippets/resource_form.html +++ b/ckanext/odsh/templates/package/snippets/resource_form.html @@ -3,7 +3,7 @@ {% set data = data or {} %} {% set errors = errors or {} %} {% set active = data and data.state=='active' %} -{% set action = form_action or h.url_for('resource.new', id=pkg_name) %} +{% set action = form_action or h.url_for('dataset_resource.new', id=pkg_name) %} <form id="resource-edit" class="{%if(data)%}resource-edit-form{%endif%}" method="post" action="{{ action }}" data-module="basic-form resource-form" enctype="multipart/form-data" novalidate> {{ h.csrf_input() }} diff --git a/ckanext/odsh/templates/package/snippets/resource_item.html b/ckanext/odsh/templates/package/snippets/resource_item.html index 5c957ea6..84cc628e 100644 --- a/ckanext/odsh/templates/package/snippets/resource_item.html +++ b/ckanext/odsh/templates/package/snippets/resource_item.html @@ -1,5 +1,5 @@ {% set url_action = 'edit' if url_is_edit and can_edit else 'read' %} -{% set url = h.url_for('resource.'+url_action, id=pkg.name, resource_id=res.id) %} +{% set url = h.url_for('dataset_resource.'+url_action, id=pkg.name, resource_id=res.id) %} {# hack for correcting slave url if resource was uploaded #} {% set download = h.odsh_public_resource_url(res) or url %} @@ -46,7 +46,7 @@ <div aria-hidden="true" class="icon icon-download"></div> </a> {% if can_edit %} - <a href="{{ h.url_for('resource.edit', id=pkg.name, resource_id=res.id) }}"> + <a href="{{ h.url_for('dataset_resource.edit', id=pkg.name, resource_id=res.id) }}"> <div class="icon icon-edit"></div> </a> {% endif %} diff --git a/ckanext/odsh/templates/package/snippets/resources_list.html b/ckanext/odsh/templates/package/snippets/resources_list.html index e6766817..cc4b9efd 100644 --- a/ckanext/odsh/templates/package/snippets/resources_list.html +++ b/ckanext/odsh/templates/package/snippets/resources_list.html @@ -23,7 +23,7 @@ Example: </ul> {% else %} {% if h.check_access('resource_create', {'package_id': pkg['id']}) %} - {% trans url=h.url_for('resource.new', id=pkg.name) %} + {% trans url=h.url_for('dataset_resource.new', id=pkg.name) %} <p class="empty">This dataset has no data, <a href="{{ url }}">why not add some?</a></p> {% endtrans %} {% else %} diff --git a/ckanext/odsh/templates/package/view_edit_base.html b/ckanext/odsh/templates/package/view_edit_base.html index 6b3e0de8..23b205cb 100644 --- a/ckanext/odsh/templates/package/view_edit_base.html +++ b/ckanext/odsh/templates/package/view_edit_base.html @@ -6,9 +6,9 @@ {% block breadcrumb_edit_selected %}{% endblock %} {% block content_action %} - {% link_for _('All views'), named_route='resource.views', id=pkg.name, resource_id=res.id, class_='btn', icon='arrow-left' %} + {% link_for _('All views'), named_route='dataset_resource.views', id=pkg.name, resource_id=res.id, class_='btn', icon='arrow-left' %} {% if res %} - {% set url = h.url_for('resource.read', id=pkg.name, resource_id=res.id) ~ '?view_id=' ~ resource_view.id %} + {% set url = h.url_for('dataset_resource.read', id=pkg.name, resource_id=res.id) ~ '?view_id=' ~ resource_view.id %} <a href="{{ url }}" class="btn"><i class="fa fa-eye"></i> {{ _('View view') }}</a> {% endif %} {% endblock %} -- GitLab