aboutsummaryrefslogtreecommitdiff
path: root/app/views/shared/_jobs.html.erb
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/shared/_jobs.html.erb')
-rw-r--r--app/views/shared/_jobs.html.erb22
1 files changed, 20 insertions, 2 deletions
diff --git a/app/views/shared/_jobs.html.erb b/app/views/shared/_jobs.html.erb
index 71d93da..a507267 100644
--- a/app/views/shared/_jobs.html.erb
+++ b/app/views/shared/_jobs.html.erb
@@ -15,16 +15,30 @@
<a role="button"
data-toggle="collapse"
data-parent="#accordion"
+ title="Job id: <%= job.id %>"
href="#job_<%= job.id %>"
aria-expanded="true"
aria-controls="job_<%= job.id %>"
>
+ Job:
<%= job.job_class.constantize.try(:job_title, job) || job.job_class %>
<span class="caret"></span>
</a>
<span class="pull-right">
<% if job.finished_at %>
- Job finished at <%= job.finished_at %>
+ <span title="<%= job.finished_at %>">
+ Finished
+ <%= distance_of_time_in_words_to_now(
+ job.run_at, include_seconds: true
+ ) %> ago
+ </span>
+ <% elsif job.expired_at %>
+ <span title="<%= job.expired_at %>">
+ Canceled at
+ <%= distance_of_time_in_words_to_now(
+ job.expired_at, include_seconds: true
+ ) %> ago
+ </span>
<% else %>
<% if job['error_count'] != 0 %>
<%= job['error_count'] %> failures,
@@ -59,7 +73,11 @@
</div>
<% elsif job.finished_at %>
<div class="col-md-12">
- Finished after <%= job['error_count'] %> errors.
+ <% if job['error_count'] == 0 %>
+ Finished without any errors
+ <% else %>
+ Finished after <%= pluralize(job['error_count'], 'error') %>.
+ <% end %>
<% if job.args.last == 'build' %>
<%# TODO: Generalise this somehow %>