Files
nairobi/app/views/notifications/_notification.html.erb
Javi Martín 629e208e9d Add and apply ArgumentAlignment rubocop rule
We're choosing the default `with_first_argument` style because it's the
one we use the most.
2023-08-18 14:56:16 +02:00

31 lines
1.2 KiB
Plaintext

<li id="<%= dom_id(notification) %>" class="notification <%= "unread" if notification&.unread? %>">
<% if notification.notifiable.try(:notifiable_available?) %>
<% locals = { notification: notification,
timestamp: notification.timestamp,
title: notification.notifiable_title,
body: notification.notifiable_body } %>
<% link_text = render "/notifications/notification_body", locals %>
<%= link_to_if notification.link.present?, link_text, notification.link, class: "notification-link" %>
<% else %>
<p>
<strong>
<%= t("notifications.notification.notifiable_hidden") %>
</strong>
</p>
<% end %>
<% if notification.unread? %>
<%= link_to t("notifications.notification.mark_as_read"),
mark_as_read_notification_path(notification),
method: :put,
remote: true,
class: "mark-notification small" %>
<% else %>
<%= link_to t("notifications.notification.mark_as_unread"),
mark_as_unread_notification_path(notification),
method: :put,
remote: true,
class: "mark-notification small" %>
<% end %>
</li>