Files
nairobi/app/views/notifications/index.html.erb
Bertocq a683fcff98 Refactor notification partials and index view
The notification body has been extracted to a new partial to allow
notifications without link to be rendered without needing an if-else
duplicating view code.

Note the `link_to_if` at _notification partial, as well as the optional
body attribute.
2018-07-25 18:31:41 +02:00

34 lines
1.0 KiB
Plaintext

<div class="row margin-bottom">
<div class="small-12 column">
<h1 class="inline-block margin-bottom">
<%= t("notifications.index.title") %>
</h1>
<%= link_to t("notifications.index.mark_all_as_read"),
mark_all_as_read_notifications_path, method: :put,
class: "button hollow float-right-medium" %>
<ul class="menu simple clear">
<li class="is-active">
<h2><%= link_to t("notifications.index.unread"), notifications_path %></h2>
</li>
<li>
<%= link_to t("notifications.index.read"), read_notifications_path %>
</li>
</ul>
<% if @notifications.empty? %>
<div data-alert class="callout primary margin-top clear">
<%= t("notifications.index.empty_notifications") %>
</div>
<% else %>
<ul class="no-bullet clear notifications-list">
<% @notifications.each do |notification| %>
<%= render partial: '/notifications/notification', locals: {notification: notification} %>
<% end %>
</ul>
<% end %>
</div>
</div>