[#7] Removed faceted navigation for uneeded toggles in job reports
This commit is contained in:
parent
574c69fa9c
commit
7544d5c5ef
|
@ -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')
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -7,15 +7,7 @@
|
|||
{% block primary_content_inner %}
|
||||
<div class="module-content">
|
||||
|
||||
<header class="with-filter">
|
||||
<ul class="nav nav-pills pull-right">
|
||||
<li class="disabled"><a>{{ _('Show me:') }}</a></li>
|
||||
<li{% if c.filter_nav == 'Finished' %} class="active"{% endif %}>{{ h.nav_named_link(_('Finished'), 'harvest_job_list', source=source.name) }}</li>
|
||||
<li{% if c.filter_nav == 'New' %} class="active"{% endif %}>{{ h.nav_named_link(_('New'), 'harvest_job_list', source=source.name, status='New') }}</li>
|
||||
<li{% if c.filter_nav == 'Running' %} class="active"{% endif %}>{{ h.nav_named_link(_('Running'), 'harvest_job_list', source=source.name, status='Running') }}</li>
|
||||
</ul>
|
||||
<h1>{{ _('Harvest Jobs') }}</h1>
|
||||
</header>
|
||||
<h1 class="results">{{ _('Harvest Jobs') }}</h1>
|
||||
|
||||
{% if c.jobs|length == 0 %}
|
||||
<p class="empty">{{ _('No jobs yet for this source') }}</p>
|
||||
|
@ -28,8 +20,11 @@
|
|||
<a href="{{ h.url_for(controller=controller, action='show_job', source=source.name, id=job.id) }}">
|
||||
{{ _('Job: ') }} {{ job.id }}
|
||||
</a>
|
||||
{% if job.status != 'Finished' %}
|
||||
<span class="label">{{ job.status }}</span>
|
||||
{% endif %}
|
||||
</h3>
|
||||
<p>
|
||||
<p>
|
||||
{{ _('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') }}
|
||||
|
|
Loading…
Reference in New Issue