Retrospring/app/views/notifications/index.turbo_stream.haml

19 lines
749 B
Plaintext

= turbo_stream.append "notifications" do
- @notifications.each do |notification|
%li.card
.card-body
.d-flex
= render "notifications/type/#{notification.target.class.name.downcase.split('::').last}", notification: notification
= turbo_stream.update "paginator" do
- if @more_data_available
= button_to t("voc.load"), notifications_path(type: params[:type]),
class: "btn btn-light",
method: :get,
params: { last_id: @notifications_last_id },
data: { controller: :hotkey, hotkey: "." },
form: { data: { turbo_stream: true } }
= turbo_stream.update "notification-desktop-icon" do
= render "navigation/icons/notifications", notification_count: current_user.unread_notification_count