Skip to content

Commit

Permalink
Merge branch 'fix-jinja-status-exception' of git://github.com/metaodi…
Browse files Browse the repository at this point in the history
…/ckanext-harvest into metaodi-fix-jinja-status-exception
  • Loading branch information
amercader committed Aug 15, 2013
2 parents 01ca5c0 + f26baf6 commit 05e6362
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion ckanext/harvest/templates_new/snippets/source_item.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ <h3 class="dataset-heading">
{% endif %}

<p class="muted">
{{ _('Datasets') }}: {{ source.status.total_datasets }}
{% if source.status %}
{{ _('Datasets') }}: {{ source.status.total_datasets }}
{% endif %}
{% 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 %}
Expand Down
2 changes: 1 addition & 1 deletion ckanext/harvest/templates_new/source/admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% block primary_content_inner %}
<section class="module-content">
<h1>Last Harvest Job</h1>
{% if source.status.last_job %}
{% if source.status and source.status.last_job %}
{% snippet "snippets/job_details.html", job=source.status.last_job %}
<div class="form-actions">
<a href="{{ h.url_for(controller='ckanext.harvest.controllers.view:ViewController', action='show_last_job', source=source.name) }}" class="btn pull-right">
Expand Down
2 changes: 1 addition & 1 deletion ckanext/harvest/templates_new/source/admin_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{% endblock %}

{% block actions_content %}
{% if source.status.last_job and (source.status.last_job.status == 'New' or source.status.last_job.status == 'Running') %}
{% if source.status and source.status.last_job and (source.status.last_job.status == 'New' or source.status.last_job.status == 'Running') %}
<li><a class="btn disabled" rel="tooltip" title="There already is an unrun job for this source"><i class="icon-refresh icon-large"></i> Reharvest</a></li>
{% else %}
{% set locale = h.dump_json({'content': _('This will re-run the harvesting for this source. Any updates at the source will overwrite the local datasets. Sources with a large number of datasets may take a significant amount of time to finish harvesting. Please confirm you would like us to start reharvesting.')}) %}
Expand Down
6 changes: 4 additions & 2 deletions ckanext/harvest/templates_new/source/read_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ <h1 class="heading">{{ c.harvest_source.title }}</h1>
{% endif %}
<div class="nums">
<dl>
<dt>{{ _('Datasets') }}</dt>
<dd>{{ c.harvest_source.status.total_datasets }}</dd>
{% if c.harvest_source.status %}
<dt>{{ _('Datasets') }}</dt>
<dd>{{ c.harvest_source.status.total_datasets }}</dd>
{% endif %}
</dl>
</div>
</section>
Expand Down

0 comments on commit 05e6362

Please sign in to comment.