aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2018-07-05 13:28:58 +0100
committerChristopher Baines <mail@cbaines.net>2018-07-05 13:30:58 +0100
commit190b6dff14fceec92e3a5f35252988d6ef7bce14 (patch)
treedd727b080862560c962480759cf956bbd981eaad /app
parent3ccad334466cb917f724f24768fcd7be3c03efac (diff)
downloadgovuk-mini-environment-admin-190b6dff14fceec92e3a5f35252988d6ef7bce14.tar
govuk-mini-environment-admin-190b6dff14fceec92e3a5f35252988d6ef7bce14.tar.gz
Use alerts rather than contextual panel classes
As the alerts are a bit less overpowering visually.
Diffstat (limited to 'app')
-rw-r--r--app/views/shared/_jobs.html.erb95
1 files changed, 51 insertions, 44 deletions
diff --git a/app/views/shared/_jobs.html.erb b/app/views/shared/_jobs.html.erb
index 3dd18c6..e74410e 100644
--- a/app/views/shared/_jobs.html.erb
+++ b/app/views/shared/_jobs.html.erb
@@ -9,7 +9,7 @@
<% jobs.each do |job| %>
<% job_state = job_states.find { |x| x[:id] == job.id } %>
- <% panel_class_suffix = if job.finished_at
+ <% alert_class_suffix = if job.finished_at
'success'
elsif job.expired_at
'warning'
@@ -18,52 +18,59 @@
end
%>
- <div class="panel panel-<%= panel_class_suffix %>">
- <div class="panel-heading" role="tab" id="jobHeading<%= job.id %>">
- <h4 class="panel-title">
- <a role="button"
- data-toggle="collapse"
- data-parent="#jobs"
- title="Job id: <%= job.id %>"
- href="#job_<%= job.id %>"
- aria-expanded="true"
- aria-controls="job_<%= job.id %>"
- >
- <%= job.job_class.constantize.try(:job_title, job) || job.job_class %>
- <span class="caret"></span>
- </a>
- <span class="pull-right">
- <% if 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,
- <% end %>
- <% if job_state %>
- running for
- <% else %>
- running
- <% if job['error_count'] != 0 %>again<% end %>
- in
- <% end %>
+ <div class="panel panel-default">
+ <div class="panel-heading"
+ style="display: flex;"
+ role="tab"
+ id="jobHeading<%= job.id %>"
+ >
+ <a role="button"
+ class="panel-title"
+ style="display: inline-block; width: 70%;"
+ data-toggle="collapse"
+ data-parent="#jobs"
+ title="Job id: <%= job.id %>"
+ href="#job_<%= job.id %>"
+ aria-expanded="true"
+ aria-controls="job_<%= job.id %>"
+ >
+ <%= job.job_class.constantize.try(:job_title, job) || job.job_class %>
+ <span class="caret"></span>
+ </a>
+ <div class="alert alert-<%= alert_class_suffix %> text-center"
+ style="width: 30%; margin-left: auto; margin-bottom: 0px;"
+ >
+ <% if 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,
<% end %>
- </span>
- </h4>
+ <% if job_state %>
+ running for
+ <% else %>
+ running
+ <% if job['error_count'] != 0 %>again<% end %>
+ in
+ <% end %>
+ <%= distance_of_time_in_words_to_now(
+ job.run_at, include_seconds: true
+ ) %>
+ <% end %>
+ </span>
+ </div>
</div>
<div id="job_<%= job.id %>"
class="panel-collapse collapse"