[#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:
|
try:
|
||||||
context = {'model':model, 'user':c.user}
|
context = {'model':model, 'user':c.user}
|
||||||
c.harvest_source = get_action('harvest_source_show')(context, {'id': source})
|
c.harvest_source = get_action('harvest_source_show')(context, {'id': source})
|
||||||
status = request.params.get('status', 'Finished')
|
c.jobs = get_action('harvest_job_list')(context, {'source_id': c.harvest_source['id']})
|
||||||
c.filter_nav = status
|
|
||||||
c.jobs = get_action('harvest_job_list')(context, {'source_id': c.harvest_source['id'], 'status': status})
|
|
||||||
|
|
||||||
return render('source/job/list.html')
|
return render('source/job/list.html')
|
||||||
|
|
||||||
|
|
|
@ -217,16 +217,12 @@ def harvest_job_list(context,data_dict):
|
||||||
session = context['session']
|
session = context['session']
|
||||||
|
|
||||||
source_id = data_dict.get('source_id',False)
|
source_id = data_dict.get('source_id',False)
|
||||||
status = data_dict.get('status',False)
|
|
||||||
|
|
||||||
query = session.query(HarvestJob)
|
query = session.query(HarvestJob)
|
||||||
|
|
||||||
if source_id:
|
if source_id:
|
||||||
query = query.filter(HarvestJob.source_id==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())
|
query = query.order_by(HarvestJob.created.desc())
|
||||||
|
|
||||||
jobs = query.all()
|
jobs = query.all()
|
||||||
|
|
|
@ -7,15 +7,7 @@
|
||||||
{% block primary_content_inner %}
|
{% block primary_content_inner %}
|
||||||
<div class="module-content">
|
<div class="module-content">
|
||||||
|
|
||||||
<header class="with-filter">
|
<h1 class="results">{{ _('Harvest Jobs') }}</h1>
|
||||||
<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>
|
|
||||||
|
|
||||||
{% if c.jobs|length == 0 %}
|
{% if c.jobs|length == 0 %}
|
||||||
<p class="empty">{{ _('No jobs yet for this source') }}</p>
|
<p class="empty">{{ _('No jobs yet for this source') }}</p>
|
||||||
|
@ -28,6 +20,9 @@
|
||||||
<a href="{{ h.url_for(controller=controller, action='show_job', source=source.name, id=job.id) }}">
|
<a href="{{ h.url_for(controller=controller, action='show_job', source=source.name, id=job.id) }}">
|
||||||
{{ _('Job: ') }} {{ job.id }}
|
{{ _('Job: ') }} {{ job.id }}
|
||||||
</a>
|
</a>
|
||||||
|
{% if job.status != 'Finished' %}
|
||||||
|
<span class="label">{{ job.status }}</span>
|
||||||
|
{% endif %}
|
||||||
</h3>
|
</h3>
|
||||||
<p>
|
<p>
|
||||||
{{ _('Started:') }} {{ h.render_datetime(job.gather_started, with_hours=True) or _('Not yet') }}
|
{{ _('Started:') }} {{ h.render_datetime(job.gather_started, with_hours=True) or _('Not yet') }}
|
||||||
|
|
Loading…
Reference in New Issue