[#12] Makes a harvest source admin page within org look a little nicer

This commit is contained in:
John Martin 2013-03-06 11:23:36 +00:00
parent ca2df234d2
commit 9d149e4e5d
4 changed files with 36 additions and 4 deletions

View File

@ -7,6 +7,7 @@ hide_resources - If true hides the resources (default: false).
banner - If true displays a popular banner (default: false).
truncate - The length to trucate the description to (default: 180)
truncate_title - The length to truncate the title to (default: 80).
show_organization - Boolean on whether to show the related organization
Example:
@ -37,7 +38,7 @@ Example:
<p class="muted">
{{ _('Datasets') }}: {{ source.status.total_datasets }}
{% if source.organization %}
{% if show_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 %}
{% 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 %}
{% endfor %}
</ul>
{% endif %}

View File

@ -1,2 +1,33 @@
{% extends 'organization/edit_base.html' %}
{% block subtitle %}{{ _('Harvest Sources') }} - {{ super() }}{% endblock %}
{% block primary_content_inner %}
<div class="clearfix">
<h1 class="hide-heading">{{ _('Harvest Sources') }}</h1>
<div class="primary">
<h3 class="results">
{%- if c.page.item_count -%}
{{ c.page.item_count }} harvest sources{{ _(" found for \"{query}\"").format(query=c.q) if c.q }}
{%- elif request.params -%}
{{ _('Sorry no harvest sources found for "{query}"').format(query=c.q) }}
{%- else -%}
{{ _('Harvest Sources') }}
{%- endif -%}
</h3>
{% snippet 'snippets/source_list.html', sources=c.page.items %}
</div>
<aside class="tertiary">
<form method="GET">
<span class="control-group search-normal">
<input type="text" class="search" name="q" value="{{ c.q }}" autocomplete="off" placeholder="{{ _('Search sources...') }}" />
<button type="submit"><i class="icon-search"></i> <span>{{ _('Search') }}</span></button>
</span>
</form>
{{ h.snippet('snippets/facet_list.html', title='Tags', name='tags', within_tertiary=true, extras={'id':c.group_dict.name}) }}
{{ h.snippet('snippets/facet_list.html', title='Formats', name='res_format', within_tertiary=true, extras={'id':c.group_dict.name}) }}
</aside>
</div>
{{ c.page.pager() }}
{% endblock %}
{% extends 'organization/read.html' %}

View File

@ -64,7 +64,7 @@
{% endtrans %}
{% endif %}
{{ h.snippet('snippets/source_list.html', sources=c.page.items) }}
{{ h.snippet('snippets/source_list.html', sources=c.page.items, show_organization=true) }}
</div>