summaryrefslogtreecommitdiff
blob: 5959fac73fcb17cbd266f9946a28ec55c7308aad (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
<div class="card <%= panel_class(notice) %> notice" data-services="<%= notice['affects'].join ' ' %>" data-url="<%= notice.url %>">
  <h3 class="card-header"><%= item_icon notice['type']%> <a class="text-dark" href="/notice/<%= h notice['id'] %>"><%= h notice['title'] %></a></h3>
  <div class="card-body">
    <%= markdown notice.content %>
  </div>
  <div class="card-footer">
    <div class="row">
      <div class="col-sm-4 has-tooltip" data-toggle="tooltip" data-placement="top" title="Notice publication date">
        <div><i class="fa fa-paper-plane mr-1" title="Notice publication date" aria-hidden="true"></i> <em><%= date_format notice['created_at'] %></em></div>
      </div>
      <% if notice.key? 'starts_at' %>
        <%- 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 %>>
          <div><i class="fa fa-wrench mr-1" title="Maintenance start time" aria-hidden="true"></i> <em><%= date_format notice['starts_at'] %></em></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">
        <div>
          <i class="fa fa-check mr-1" title="Estimated time of service recovery" aria-hidden="true"></i>
          <% if notice.key? 'eta' %>
            <em><%= date_format notice['eta'] %></em> (estimated)
          <% else %>
            No ETA for service recovery available.
          <% end %>
        </div>
      </div>
    </div>
  </div>
</div>