[#12] When harvest source listing is within org links goto edit pages

This commit is contained in:
John Martin 2013-03-06 11:36:24 +00:00
parent 9d149e4e5d
commit 246898049e
3 changed files with 5 additions and 4 deletions

View File

@ -18,11 +18,12 @@ Example:
{% set truncate_title = truncate_title or 80 %}
{% set title = source.title or source.name %}
{% set source_type = h.get_pkg_dict_extra(source, 'source_type') %}
{% set url = h.url_for('harvest_source_edit', id=source.name) if within_organization else h.url_for('harvest_source_read', id=source.name) %}
<li class="{{ item_class or "dataset-item" }}">
<div class="dataset-content">
<h3 class="dataset-heading">
{{ h.link_to(h.truncate(title, truncate_title), h.url_for('harvest_source_read', id=source.name)) }}
{{ h.link_to(h.truncate(title, truncate_title), url) }}
{% if source.get(state, '').startswith('draft') %}
<span class="label label-info">{{ _('Draft') }}</span>
{% elif source.get(state, '').startswith('deleted') %}
@ -38,7 +39,7 @@ Example:
<p class="muted">
{{ _('Datasets') }}: {{ source.status.total_datasets }}
{% if show_organization and source.organization %}
{% if not within_organization and source.organization %}
&mdash; {{ _('Organization') }}: {{ h.link_to(source.organization.title or source.organization.name, h.url_for('organization_read', id=source.organization.name)) }}</a>
{% endif %}
</p>

View File

@ -17,7 +17,7 @@ Example:
{% if sources %}
<ul class="{{ list_class or 'dataset-list unstyled' }}">
{% for source in sources %}
{% snippet 'snippets/source_item.html', source=source, item_class=item_class, hide_resources=hide_resources, banner=banner, truncate=truncate, truncate_title=truncate_title, show_organization=show_organization %}
{% snippet 'snippets/source_item.html', source=source, item_class=item_class, hide_resources=hide_resources, banner=banner, truncate=truncate, truncate_title=truncate_title, within_organization=within_organization %}
{% endfor %}
</ul>
{% endif %}

View File

@ -15,7 +15,7 @@
{{ _('Harvest Sources') }}
{%- endif -%}
</h3>
{% snippet 'snippets/source_list.html', sources=c.page.items %}
{% snippet 'snippets/source_list.html', sources=c.page.items, within_organization=true %}
</div>
<aside class="tertiary">
<form method="GET">