diff options
author | Alex Legler <alex@a3li.li> | 2014-04-17 18:41:31 +0200 |
---|---|---|
committer | Alex Legler <alex@a3li.li> | 2014-04-17 18:41:31 +0200 |
commit | 15253a210025865dfae22996efe2ea1dff3c8269 (patch) | |
tree | 249ae53699ac0108992e6dbbdd6513a958da794b | |
parent | Implement starts_at (diff) | |
download | infra-status-15253a210025865dfae22996efe2ea1dff3c8269.tar.gz infra-status-15253a210025865dfae22996efe2ea1dff3c8269.tar.bz2 infra-status-15253a210025865dfae22996efe2ea1dff3c8269.zip |
Notice footer rework
-rw-r--r-- | views/notice.erb | 37 |
1 files 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> |