diff options
author | 2015-01-28 19:15:33 +0100 | |
---|---|---|
committer | 2015-01-28 19:15:33 +0100 | |
commit | 1344f12a7bc4718fb327968c6903e2ccd5675508 (patch) | |
tree | 8801a1e8f754ca84b6e988cbd7d607c619486aca | |
parent | Sync new Tyrian footer (diff) | |
download | infra-status-1344f12a7bc4718fb327968c6903e2ccd5675508.tar.gz infra-status-1344f12a7bc4718fb327968c6903e2ccd5675508.tar.bz2 infra-status-1344f12a7bc4718fb327968c6903e2ccd5675508.zip |
Fix maintenance start times
-rw-r--r-- | views/notice.erb | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/views/notice.erb b/views/notice.erb index 9e2e8bf..b7c0ddd 100644 --- a/views/notice.erb +++ b/views/notice.erb @@ -12,16 +12,15 @@ <div style="margin-left: 1.25em"><em><%= date_format notice['created_at'] %></em></div> </div> <% if notice.has_key? 'starts_at' %> - <div class="col-sm-4 has-tooltip" data-toggle="tooltip" data-placement="top" title="Maintenance start time"> - <% diff = ((DateTime.now - notice['starts_at']) * 24 * 60 * 60).to_i %> + <%- diff = ((DateTime.now - notice['starts_at']) * 24 * 60 * 60).to_i %> + <div class="col-sm-4 has-tooltip" data-toggle="tooltip" data-placement="top" + <% if diff < 0 %> + title="Maintenance starts in <%= humanize(-diff) %>" + <% else %> + title="Maintenance started <%= humanize(diff) %> ago" + <% end %>> <span class="glyphicon glyphicon-wrench pull-left" title="Maintenance start time"></span> - <div style="margin-left: 1.25em;"><em><%= date_format notice['starts_at'] %></em><br> - <% if diff < 0 %> - (in <em><%= humanize(-diff) %></em>) - <% else %> - (<em><%= humanize(diff) %></em> ago) - <% end %> - </div> + <div style="margin-left: 1.25em;"><em><%= date_format notice['starts_at'] %></em></div> </div> <% else %> <div class="col-sm-4"></div> |