[#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 truncate_title = truncate_title or 80 %}
{% set title = source.title or source.name %} {% set title = source.title or source.name %}
{% set source_type = h.get_pkg_dict_extra(source, 'source_type') %} {% 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" }}"> <li class="{{ item_class or "dataset-item" }}">
<div class="dataset-content"> <div class="dataset-content">
<h3 class="dataset-heading"> <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') %} {% if source.get(state, '').startswith('draft') %}
<span class="label label-info">{{ _('Draft') }}</span> <span class="label label-info">{{ _('Draft') }}</span>
{% elif source.get(state, '').startswith('deleted') %} {% elif source.get(state, '').startswith('deleted') %}
@ -38,7 +39,7 @@ Example:
<p class="muted"> <p class="muted">
{{ _('Datasets') }}: {{ source.status.total_datasets }} {{ _('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> &mdash; {{ _('Organization') }}: {{ h.link_to(source.organization.title or source.organization.name, h.url_for('organization_read', id=source.organization.name)) }}</a>
{% endif %} {% endif %}
</p> </p>

View File

@ -17,7 +17,7 @@ Example:
{% if sources %} {% if sources %}
<ul class="{{ list_class or 'dataset-list unstyled' }}"> <ul class="{{ list_class or 'dataset-list unstyled' }}">
{% for source in sources %} {% 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 %} {% endfor %}
</ul> </ul>
{% endif %} {% endif %}

View File

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