summaryrefslogtreecommitdiff
blob: 5a9134285f0e5eb9591bf138e5af11580fdaba3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<div class="panel <%= panel_class(notice) %>">
  <div class="panel-heading">
    <h3 class="panel-title"><%= item_icon notice['type']%> <a href="/notice/<%= h notice['id'] %>"><%= h notice['title'] %></a></h3>
  </div>
  <div class="panel-body">
    <%= markdown notice.get_content %>
  </div>
  <div class="panel-footer">
    <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>