[#7] Small template tweaks to job pages

This commit is contained in:
John Martin 2013-02-12 15:49:06 +00:00
parent bdc8206e8b
commit 891f247181
8 changed files with 90 additions and 59 deletions

View File

@ -22,15 +22,6 @@ header.with-filter h1 {
line-height: 1.3;
color: #000;
}
.harvest-jobs a .errors {
float: right;
font-size: 16px;
line-height: 1.3;
margin-top: 5px;
-webkit-border-radius: 100px;
-moz-border-radius: 100px;
border-radius: 100px;
}
.harvest-jobs a p {
clear: both;
overflow: hidden;
@ -54,9 +45,32 @@ header.with-filter h1 {
.harvest-jobs a:last-child {
border-bottom-width: 0;
}
.harvest-errors {
float: right;
}
.harvest-errors .badge {
float: left;
font-size: 16px;
line-height: 1.3;
margin-top: 5px;
}
.harvest-errors .badge:first-child {
padding-right: 8px;
-webkit-border-radius: 100px 0 0 100px;
-moz-border-radius: 100px 0 0 100px;
border-radius: 100px 0 0 100px;
}
.harvest-errors .badge:last-child {
font-weight: normal;
padding-left: 8px;
-webkit-border-radius: 0 100px 100px 0;
-moz-border-radius: 0 100px 100px 0;
border-radius: 0 100px 100px 0;
}
.harvest-diff span {
display: inline-block;
color: #000;
padding: 5px 10px;
padding: 2px 10px;
margin-right: 5px;
font-size: 12px;
-webkit-border-radius: 5px;

View File

@ -22,13 +22,6 @@ header.with-filter {
line-height: 1.3;
color: #000;
}
.errors {
float: right;
font-size: 16px;
line-height: 1.3;
margin-top: 5px;
.border-radius(100px);
}
p {
clear: both;
overflow: hidden;
@ -57,10 +50,31 @@ header.with-filter {
}
}
.harvest-errors {
.clearfix();
float: right;
.badge {
float: left;
font-size: 16px;
line-height: 1.3;
margin-top: 5px;
&:first-child {
padding-right: 8px;
.border-radius(100px 0 0 100px);
}
&:last-child {
font-weight: normal;
padding-left: 8px;
.border-radius(0 100px 100px 0);
}
}
}
.harvest-diff {
span {
display: inline-block;
color: #000;
padding: 5px 10px;
padding: 2px 10px;
margin-right: 5px;
font-size: 12px;
.border-radius(5px);

View File

@ -17,12 +17,13 @@ Example:
{% set stats = job.stats %}
<p class="pull-right">
<p class="harvest-errors">
{% if 'errored' in stats and stats['errored'] > 0 %}
<span class="badge badge-important">{{ stats['errored'] }}</span> {{ _('errors') }}
<span class="badge badge-important">{{ stats['errored'] }}</span>
{% else %}
<span class="badge">0</span> {{ _('errors') }}
<span class="badge">0</span>
{% endif %}
<span class="badge">{{ _('errors') }}</span>
</p>
<p class="harvest-diff">
@ -57,30 +58,3 @@ Example:
<td>{{ _(job.status) }}</td>
</tr>
</table>
<h3>{{ _('Error Summary') }}</h3>
{% if job.error_summary|length == 0 %}
<p class="empty">{{ _('No errors for this job') }}</p>
{% else %}
<p class="empty">{{ _('Only the 20 most frequent errors are shown') }}</p>
<table class="table table-striped table-bordered table-condensed harvest-error-summary">
<colgroup>
<col width="8">
<col width="92">
</colgroup>
<thead>
<tr>
<th class="count">{{ _('Count') }}</th>
<th>{{ _('Message') }}</th>
</tr>
</thead>
<tbody>
{% for error in job.error_summary %}
<tr>
<td class="count">{{ error[1] }}</td>
<td>{{ error[0] }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}

View File

@ -2,14 +2,13 @@
{% block primary_content_inner %}
<section class="module-content">
<h1>Last Harvest Job</h1>
{% 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">
<i class="icon-briefcase"></i>
{{ _('View full job report') }}
</a>
<h1>Last Harvest Job</h1>
{% snippet "snippets/job_details.html", job=source.status.last_job %}
<div class="form-actions">
<a href="#" class="btn">View full job report</a>
</div>
</section>
{% endblock %}

View File

@ -14,8 +14,8 @@
{% block page_header %}
{% snippet 'snippets/page_header.html', items=[
h.build_nav_icon('{0}_admin'.format(c.dataset_type), _('Dashboard'), id=source.name),
h.build_nav_icon('harvest_job_list'.format(c.dataset_type), _('Jobs'), source=source.name),
h.build_nav_icon('{0}_edit'.format(c.dataset_type), _('Edit'), id=source.name),
h.build_nav_icon('{0}_admin'.format(c.dataset_type), _('Dashboard'), id=source.name, icon='dashboard'),
h.build_nav_icon('harvest_job_list'.format(c.dataset_type), _('Jobs'), source=source.name, icon='reorder'),
h.build_nav_icon('{0}_edit'.format(c.dataset_type), _('Edit'), id=source.name, icon='edit'),
] %}
{% endblock %}

View File

@ -24,7 +24,10 @@
<li>
<a href="{{ h.url_for(controller=controller, action='show_job', source=source.name, id=job.id) }}">
{% if 'errored' in job.stats and job.stats['errored'] > 0 %}
<span class="errors badge badge-important" title="{{ _('Errors') }}">{{ job.stats['errored'] }}</span>
<span class="harvest-errors">
<span class="badge badge-important">{{ job.stats['errored'] }}</span>
<span class="badge">{{ _('errors') }}</span>
</span>
{% endif %}
<h4>{{ _('Job: ') }} {{ job.id }}</h4>
<p>

View File

@ -12,6 +12,33 @@
<h1>{{ _('Job Report') }}</h1>
{% snippet 'snippets/job_details.html', job=c.job %}
<h2>{{ _('Error Summary') }}</h2>
{% if c.job.error_summary|length == 0 %}
<p class="empty">{{ _('No errors for this job') }}</p>
{% else %}
<p class="empty">{{ _('Only the 20 most frequent errors are shown') }}</p>
<table class="table table-striped table-bordered table-condensed harvest-error-summary">
<colgroup>
<col width="8">
<col width="92">
</colgroup>
<thead>
<tr>
<th class="count">{{ _('Count') }}</th>
<th>{{ _('Message') }}</th>
</tr>
</thead>
<tbody>
{% for error in c.job.error_summary %}
<tr>
<td class="count">{{ error[1] }}</td>
<td>{{ error[0] }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
<h2>{{ _('Error Report') }}</h2>
<p class="lead">{{ c.job_report.keys()|length}} documents with errors</p>

View File

@ -33,8 +33,8 @@
<article class="module prose">
{% block page_header %}
{% snippet 'snippets/page_header.html', items=[
h.build_nav_icon('{0}_read'.format(c.dataset_type), _('Datasets'), id=source.name),
h.build_nav_icon('{0}_about'.format(c.dataset_type), _('About'), id=source.name),
h.build_nav_icon('{0}_read'.format(c.dataset_type), _('Datasets'), id=source.name, icon='sitemap'),
h.build_nav_icon('{0}_about'.format(c.dataset_type), _('About'), id=source.name, icon='info-sign'),
] %}
{% endblock %}
{% block primary_content_inner %}{% endblock %}