-
Notifications
You must be signed in to change notification settings - Fork 2k
/
resource_format.html
39 lines (38 loc) · 1.84 KB
/
resource_format.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<li>
<p>
{% set format_search_base_url = (
h.url_for(controller="organization", action="read", id=ah.org_id)
if ah.org_id else
h.url_for(controller="dataset", action="search")) %}
{% if ah.method == "add" %}
{{ _('Set format of resource <a href="{resource_url}">{resource_name}
</a> to <a href="{format_url}">{format}</a> in
<a href="{pkg_url}">{dataset}</a>').format(
pkg_url = h.url_for(controller='dataset', action='read', id=ah.pkg_id),
dataset = ah.title,
resource_url = h.url_for(controller='resource', action='read',
id=ah.pkg_id, resource_id=ah.resource_id),
resource_name = ah.resource_name,
format_url = format_search_base_url + "?res_format=" + ah.format,
format = ah.format
)|safe }}
{% elif ah.method == "change" %}
{{ _('Set format of resource <a href="{resource_url}">{resource_name}
</a> to <a href="{new_format_url}">{new_format}</a>
(previously <a href="{old_format_url}">{old_format}</a>) in
<a href="{pkg_url}">{dataset}</a>').format(
pkg_url = h.url_for(controller='dataset', action='read', id=ah.pkg_id),
dataset = ah.title,
resource_url = h.url_for(controller='resource', action='read',
id=ah.pkg_id, resource_id=ah.resource_id),
resource_name = ah.resource_name,
new_format_url = format_search_base_url + "?res_format=" + ah.new_format,
new_format = ah.new_format,
old_format_url = format_search_base_url + "?res_format=" + ah.old_format,
old_format = ah.old_format
)|safe }}
{% else %}
{{ _('No fields were updated. See the metadata diff for more details.') }}
{% endif %}
</p>
</li>