Skip to content
Snippets Groups Projects
Commit c432c636 authored by Thorge Petersen's avatar Thorge Petersen
Browse files

Fixes for url generation

parent 35c0a04c
Branches
Tags
2 merge requests!41Version 2.0.0,!38Merge py3 into dev
...@@ -151,7 +151,7 @@ def gather_collection_info(collection_dict, datasets_in_collection, dataset_dict ...@@ -151,7 +151,7 @@ def gather_collection_info(collection_dict, datasets_in_collection, dataset_dict
} }
def url_from_id(package_id): def url_from_id(package_id):
return helpers.url_for(named_route='dataset.read', id=package_id) return helpers.url_for('dataset.read', id=package_id)
def url_last_member(name_collection): def url_last_member(name_collection):
return toolkit.url_for('odsh_collection.latest_dataset', id=name_collection) return toolkit.url_for('odsh_collection.latest_dataset', id=name_collection)
......
...@@ -185,7 +185,7 @@ def get_address_org(organization): ...@@ -185,7 +185,7 @@ def get_address_org(organization):
def get_body_mail(organization, package): def get_body_mail(organization, package):
package_name = package.get('name') package_name = package.get('name')
url = helpers.url_for(named_route='dataset.read', id=package_name, qualified = True) url = helpers.url_for('dataset.read', id=package_name, qualified = True)
title = package.get('title') title = package.get('title')
anrede = "Sehr geehrte Damen und Herren," + "%0D%0A" + "%0D%0A" + "zu folgendem Eintrag habe ich eine Anmerkung/Frage:" + "%0D%0A" + "%0D%0A" anrede = "Sehr geehrte Damen und Herren," + "%0D%0A" + "%0D%0A" + "zu folgendem Eintrag habe ich eine Anmerkung/Frage:" + "%0D%0A" + "%0D%0A"
mail_titel = "Titel: " + title + "%0D%0A" mail_titel = "Titel: " + title + "%0D%0A"
......
...@@ -11,7 +11,7 @@ Example: ...@@ -11,7 +11,7 @@ Example:
{% endfor %} {% endfor %}
</ul> </ul>
#} #}
{% set url = h.url_for(named_route='organization.read', id=organization.name) %} {% set url = h.url_for('organization.read', id=organization.name) %}
<a class="organization-item" href="{{ url }}" title="{{ _('View {organization_name}').format(organization_name=organization.display_name) }}"> <a class="organization-item" href="{{ url }}" title="{{ _('View {organization_name}').format(organization_name=organization.display_name) }}">
<div class="row organization-item"> <div class="row organization-item">
<div class="span1 organization-item-text"> <div class="span1 organization-item-text">
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
{% block toolbar %} {% block toolbar %}
{{ super() }} {{ super() }}
<form id='dataset-search-box-form' class="section site-search simple-input" action="{% url_for named_route='dataset.search' %}" <form id='dataset-search-box-form' class="section site-search simple-input" action="{% url_for 'dataset.search' %}"
method="get" data-module="select-switch"> method="get" data-module="select-switch">
<div class="row filter-search-row"> <div class="row filter-search-row">
<div class='btn show-filters'>{{ _("Filter") }}</div> <div class='btn show-filters'>{{ _("Filter") }}</div>
...@@ -50,7 +50,7 @@ method="get" data-module="select-switch"> ...@@ -50,7 +50,7 @@ method="get" data-module="select-switch">
<div class="container-fluid filter-reset"> <div class="container-fluid filter-reset">
<div class="filter-reset-label"><span>{{ _("Filter") }}:</span></div> <div class="filter-reset-label"><span>{{ _("Filter") }}:</span></div>
<div class="filter-reset-box"> <div class="filter-reset-box">
<a href="{{h.url_for(named_route='dataset.search')}}">{{ _('Reset') }}</a> <a href="{{h.url_for('dataset.search')}}">{{ _('Reset') }}</a>
</div> </div>
</div> </div>
</div> </div>
......
{% set url_action = 'edit' if url_is_edit and can_edit else 'read' %} {% set url_action = 'edit' if url_is_edit and can_edit else 'read' %}
{% set url = h.url_for(named_route='resource.'+url_action, id=pkg.name, resource_id=res.id) %} {% set url = h.url_for('resource.'+url_action, id=pkg.name, resource_id=res.id) %}
{# hack for correcting slave url if resource was uploaded #} {# hack for correcting slave url if resource was uploaded #}
{% set download = h.odsh_public_resource_url(res) or url %} {% set download = h.odsh_public_resource_url(res) or url %}
......
...@@ -67,7 +67,7 @@ Example: ...@@ -67,7 +67,7 @@ Example:
{% endif %} {% endif %}
{% endblock heading_private %} {% endblock heading_private %}
{% block heading_title %} {% block heading_title %}
{{ h.link_to(h.truncate(title, truncate_title), h.url_for(named_route='dataset.read', id=package.name),title=_('View {organization_name}').format(organization_name=title))}} {{ h.link_to(h.truncate(title, truncate_title), h.url_for('%s.read' % package.type, id=package.name),title=_('View {organization_name}').format(organization_name=title))}}
{% endblock heading_title %} {% endblock heading_title %}
{% block heading_meta %} {% block heading_meta %}
{% if package.get('state', '').startswith('draft') %} {% if package.get('state', '').startswith('draft') %}
...@@ -120,7 +120,7 @@ Example: ...@@ -120,7 +120,7 @@ Example:
{% block resources_inner %} {% block resources_inner %}
{% for resource in h.dict_list_reduce(package.resources, 'format') %} {% for resource in h.dict_list_reduce(package.resources, 'format') %}
<li> <li>
<a href="{{ h.url_for(named_route='dataset.read', id=package.name) }}" class="label dataformat-label" <a href="{{ h.url_for(package.type ~ '.read', id=package.name) }}" class="label dataformat-label"
data-format="{{ resource.lower().replace('_srvc','') }}">{{ data-format="{{ resource.lower().replace('_srvc','') }}">{{
resource.replace('_SRVC','') }}</a> resource.replace('_SRVC','') }}</a>
</li> </li>
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
{% else %} {% else %}
<h2>{% snippet 'snippets/search_result_text.html', query=query, count=count, type=type %}</h2> <h2>{% snippet 'snippets/search_result_text.html', query=query, count=count, type=type %}</h2>
{% if type == 'dataset' %} {% if type == 'dataset' %}
<a aria-label="{{ _('rss feeds') }}" href={{h.remove_url_param([''], named_route='feeds.custom') }}> <a aria-label="{{ _('rss feeds') }}" href={{h.remove_url_param([''], controller='feeds', action='custom') }}>
<i aria-hidden="true" class="fa fa-solid fa-rss"></i> <i aria-hidden="true" class="fa fa-solid fa-rss"></i>
</a> </a>
{%- endif -%} {%- endif -%}
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
{% block help_forgotten_inner %} {% block help_forgotten_inner %}
<span>{{ _('Forgotten your password?') }}:</span> <span>{{ _('Forgotten your password?') }}:</span>
{% block help_forgotten_button %} {% block help_forgotten_button %}
<a class="btn-forget-password" href="{{ h.url_for(user.request_reset) }}"> <a class="btn-forget-password" href="{{ h.url_for('user.request_reset') }}">
{{ _('Change password') }}</a> {{ _('Change password') }}</a>
{% endblock %} {% endblock %}
{% endblock %} {% endblock %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment