From 7544d5c5ef645e604a29c09058148fc17ca419fc Mon Sep 17 00:00:00 2001 From: John Martin Date: Tue, 5 Mar 2013 15:23:42 +0000 Subject: [PATCH] [#7] Removed faceted navigation for uneeded toggles in job reports --- ckanext/harvest/controllers/view.py | 4 +--- ckanext/harvest/logic/action/get.py | 4 ---- .../harvest/templates_new/source/job/list.html | 15 +++++---------- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/ckanext/harvest/controllers/view.py b/ckanext/harvest/controllers/view.py index 66461a5..0d2b907 100644 --- a/ckanext/harvest/controllers/view.py +++ b/ckanext/harvest/controllers/view.py @@ -365,9 +365,7 @@ class ViewController(BaseController): try: context = {'model':model, 'user':c.user} c.harvest_source = get_action('harvest_source_show')(context, {'id': source}) - status = request.params.get('status', 'Finished') - c.filter_nav = status - c.jobs = get_action('harvest_job_list')(context, {'source_id': c.harvest_source['id'], 'status': status}) + c.jobs = get_action('harvest_job_list')(context, {'source_id': c.harvest_source['id']}) return render('source/job/list.html') diff --git a/ckanext/harvest/logic/action/get.py b/ckanext/harvest/logic/action/get.py index 6e7c24f..2f49784 100644 --- a/ckanext/harvest/logic/action/get.py +++ b/ckanext/harvest/logic/action/get.py @@ -217,16 +217,12 @@ def harvest_job_list(context,data_dict): session = context['session'] source_id = data_dict.get('source_id',False) - status = data_dict.get('status',False) query = session.query(HarvestJob) if source_id: query = query.filter(HarvestJob.source_id==source_id) - if status: - query = query.filter(HarvestJob.status==status) - query = query.order_by(HarvestJob.created.desc()) jobs = query.all() diff --git a/ckanext/harvest/templates_new/source/job/list.html b/ckanext/harvest/templates_new/source/job/list.html index 2c89856..ab05f74 100644 --- a/ckanext/harvest/templates_new/source/job/list.html +++ b/ckanext/harvest/templates_new/source/job/list.html @@ -7,15 +7,7 @@ {% block primary_content_inner %}
-
- -

{{ _('Harvest Jobs') }}

-
+

{{ _('Harvest Jobs') }}

{% if c.jobs|length == 0 %}

{{ _('No jobs yet for this source') }}

@@ -28,8 +20,11 @@ {{ _('Job: ') }} {{ job.id }} + {% if job.status != 'Finished' %} + {{ job.status }} + {% endif %} -

+

{{ _('Started:') }} {{ h.render_datetime(job.gather_started, with_hours=True) or _('Not yet') }} — {{ _('Finished:') }} {{ h.render_datetime(job.gather_finished, with_hours=True) or _('Not yet') }}