From ed17d9d51f3db7e73fd36be7f65573a5b4b1e150 Mon Sep 17 00:00:00 2001 From: Thorge Petersen <petersen@rz.uni-kiel.de> Date: Fri, 14 Apr 2023 10:33:36 +0200 Subject: [PATCH] Removed named route --- .../odsh/templates/datarequests/snippets/comment_item.html | 4 ++-- .../templates/organization/snippets/organization_form.html | 4 ++-- ckanext/odsh/templates/package/resource_read.html | 2 +- ckanext/odsh/templates/package/snippets/resource_form.html | 2 +- ckanext/odsh/templates/package/snippets/resource_item.html | 4 ++-- ckanext/odsh/templates/package/view_edit_base.html | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ckanext/odsh/templates/datarequests/snippets/comment_item.html b/ckanext/odsh/templates/datarequests/snippets/comment_item.html index 678afe85..899eb7d3 100644 --- a/ckanext/odsh/templates/datarequests/snippets/comment_item.html +++ b/ckanext/odsh/templates/datarequests/snippets/comment_item.html @@ -6,7 +6,7 @@ {% endif %} <div class="odsh-comment-wrapper"> - {# <a href="{{ h.url_for(named_route='user.read', id=comment.user.get('name')) }}" + {# <a href="{{ h.url_for('user.read', id=comment.user.get('name')) }}" class="comment-avatar"> {{ h.gravatar(comment.user.get('email_hash'), 48) }} </a> @@ -29,7 +29,7 @@ #} <div class="comment-header-text"> <i class="icon-comment fa fa-comment"></i> - <a href="{{ h.url_for(named_route='user.read', id=comment.user.get('name')) }}" class="comment-author">{{ comment.user.get('display_name') }}</a> + <a href="{{ h.url_for('user.read', id=comment.user.get('name')) }}" class="comment-author">{{ comment.user.get('display_name') }}</a> <span class='comment-date' title="{{comment.time}}">{{ h.odsh_render_datetime(comment.time).lower() }}</span> </div> </div> diff --git a/ckanext/odsh/templates/organization/snippets/organization_form.html b/ckanext/odsh/templates/organization/snippets/organization_form.html index 1c4e8b1e..1f8f80a5 100644 --- a/ckanext/odsh/templates/organization/snippets/organization_form.html +++ b/ckanext/odsh/templates/organization/snippets/organization_form.html @@ -10,8 +10,8 @@ {{ form.input('title', label=_('Name'), id='field-name', placeholder=_('My Organization'), value=data.title, error=errors.title, classes=['control-full'], attrs=attrs) }} {# Perhaps these should be moved into the controller? #} - {% set prefix = h.url_for(named_route='organization.read', id='') %} - {% set domain = h.url_for(named_route='organization.read', id='', qualified=true) %} + {% set prefix = h.url_for('organization.read', id='') %} + {% set domain = h.url_for('organization.read', id='', qualified=true) %} {% set domain = domain|replace("http://", "")|replace("https://", "") %} {% set attrs = {'data-module': 'slug-preview-slug', 'data-module-prefix': domain, 'data-module-placeholder': '<organization>'} %} diff --git a/ckanext/odsh/templates/package/resource_read.html b/ckanext/odsh/templates/package/resource_read.html index 758b2e15..663baecf 100644 --- a/ckanext/odsh/templates/package/resource_read.html +++ b/ckanext/odsh/templates/package/resource_read.html @@ -65,7 +65,7 @@ {% if not res.description and package.notes %} <h3>{{ _('From the dataset abstract') }}</h3> <blockquote>{{ h.markdown_extract(h.get_translated(package, 'notes')) }}</blockquote> - <p>{% trans dataset=package.title, url=h.url_for(named_route='dataset.read', id=package['name']) %}Source: <a href="{{ url }}">{{ dataset }}</a>{% endtrans %} + <p>{% trans dataset=package.title, url=h.url_for('dataset.read', id=package['name']) %}Source: <a href="{{ url }}">{{ dataset }}</a>{% endtrans %} {% endif %} </div> {% endblock %} diff --git a/ckanext/odsh/templates/package/snippets/resource_form.html b/ckanext/odsh/templates/package/snippets/resource_form.html index ce277790..81983e4b 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(named_route='resource.new', id=pkg_name) %} +{% set action = form_action or h.url_for('resource.new', id=pkg_name) %} <form id="resource-edit" class="dataset-form dataset-resource-form {%if(data)%}resource-edit-form{%endif%}" method="post" action="{{ action }}" data-module="basic-form resource-form" enctype="multipart/form-data" novalidate> {% block stages %} diff --git a/ckanext/odsh/templates/package/snippets/resource_item.html b/ckanext/odsh/templates/package/snippets/resource_item.html index 3f981fd6..b08e58bd 100644 --- a/ckanext/odsh/templates/package/snippets/resource_item.html +++ b/ckanext/odsh/templates/package/snippets/resource_item.html @@ -30,7 +30,7 @@ <div aria-hidden="true" class="icon icon-download"></div> </a> {% if can_edit %} - <a href="{{ h.url_for(named_route='resource.edit', id=pkg.name, resource_id=res.id) }}"> + <a href="{{ h.url_for('resource.edit', id=pkg.name, resource_id=res.id) }}"> <div class="icon icon-edit"></div> </a> {% endif %} @@ -52,7 +52,7 @@ <div aria-hidden="true" class="icon icon-download"></div> </a> {% if can_edit %} - <a href="{{ h.url_for(named_route='resource.edit', id=pkg.name, resource_id=res.id) }}"> + <a href="{{ h.url_for('resource.edit', id=pkg.name, resource_id=res.id) }}"> <div class="icon icon-edit"></div> </a> {% endif %} diff --git a/ckanext/odsh/templates/package/view_edit_base.html b/ckanext/odsh/templates/package/view_edit_base.html index 822af310..6b3e0de8 100644 --- a/ckanext/odsh/templates/package/view_edit_base.html +++ b/ckanext/odsh/templates/package/view_edit_base.html @@ -8,7 +8,7 @@ {% block content_action %} {% link_for _('All views'), named_route='resource.views', id=pkg.name, resource_id=res.id, class_='btn', icon='arrow-left' %} {% if res %} - {% set url = h.url_for(named_route='resource.read', id=pkg.name, resource_id=res.id) ~ '?view_id=' ~ resource_view.id %} + {% set url = h.url_for('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