Retrospring/app/views/inbox/show.turbo_stream.haml

25 lines
894 B
Plaintext

- inbox_count = current_user.unread_inbox_count
= turbo_stream.append "entries" do
- @inbox.each do |i|
= render "inbox/entry", i:
= turbo_stream.update "paginator" do
- if @more_data_available
= button_to t("voc.load"), inbox_path,
class: "btn btn-light",
method: :get,
params: { last_id: @inbox_last_id, author: @author }.compact,
data: { controller: :hotkey, hotkey: "." },
form: { data: { turbo_stream: true } }
= turbo_stream.update "nav-inbox-desktop" do
= nav_entry t("navigation.inbox"), "/inbox",
badge: inbox_count, badge_attr: { data: { controller: "pwa-badge" } },
icon: "inbox", hotkey: "g i"
= turbo_stream.update "nav-inbox-mobile" do
= nav_entry t("navigation.inbox"), "/inbox",
badge: inbox_count, badge_color: "primary", badge_pill: true,
icon: "inbox", icon_only: true