commit:     15253a210025865dfae22996efe2ea1dff3c8269
Author:     Alex Legler <alex <AT> a3li <DOT> li>
AuthorDate: Thu Apr 17 16:41:31 2014 +0000
Commit:     Alex Legler <a3li <AT> gentoo <DOT> org>
CommitDate: Thu Apr 17 16:41:31 2014 +0000
URL:        
http://git.overlays.gentoo.org/gitweb/?p=proj/infra-status.git;a=commit;h=15253a21

Notice footer rework

---
 views/notice.erb | 37 +++++++++++++++++++++++++++++++------
 1 file changed, 31 insertions(+), 6 deletions(-)

diff --git a/views/notice.erb b/views/notice.erb
index c27f802..5a91342 100644
--- a/views/notice.erb
+++ b/views/notice.erb
@@ -6,11 +6,36 @@
     <%= markdown notice.get_content %>
   </div>
   <div class="panel-footer">
-    <span class="pull-right">Posted at <em><%= date_format 
notice['created_at'] %></em></span>
-    <% if notice.has_key? 'eta' %>
-      <strong>Estimated time of service recovery: <em><%= date_format 
notice['eta'] %></em></strong>
-    <% else %>
-      <strong>No estimated time of service recovery available.</strong>
-    <% end %>
+    <div class="row">
+      <div class="col-sm-4 has-tooltip" data-toggle="tooltip" 
data-placement="top" title="Notice publication date">
+        <span class="glyphicon glyphicon-send pull-left" title="Notice 
publication date"></span>
+        <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 %>
+          <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>
+      <% else %>
+        <div class="col-sm-4"></div>
+      <% end %>
+      <div class="col-sm-4 has-tooltip" data-toggle="tooltip" 
data-placement="top" title="Estimated time of service recovery">
+        <span class="glyphicon glyphicon-ok pull-left" title="Estimated time 
of service recovery"></span>
+        <div style="margin-left: 1.25em;">
+          <% if notice.has_key? 'eta' %>
+            <em><%= date_format notice['eta'] %></em> (estimated)
+          <% else %>
+            No estimated time of service recovery available.
+          <% end %>
+        </div>
+      </div>
+    </div>
   </div>
 </div>

Reply via email to