rubyforgood/casa

View on GitHub
app/components/notification_component.html.erb

Summary

Maintainability
Test Coverage
<a
  href="<%= mark_as_read_notification_path(notification) %>"
  class="<%= muted_display %> list-group-item list-group-item-action flex-column align-items-start"
  data-method="post">
  <div class="d-flex flex-row">
    <div class="d-flex-shrink-0">
      <% unless notification.read? %>
        <i class='fas fa-bell'></i>
      <% end %>
    </div>
    <div class="ml-2 flex-grow-1">
      <div class="d-flex justify-content-between">
        <h5 class="mb-1"><%= notification.event.title %></h5>
        <small><%= time_ago_in_words(notification.created_at) %> ago</small>
      </div>
      <div class="my-1">
        <%= simple_format notification.event.message %>
      </div>
    </div>
  </div>
</a>