Files
openproject/app/components/notifications/index_sub_header_component.html.erb

34 lines
1.3 KiB
Plaintext

<%= render(Primer::OpenProject::SubHeader.new) do |subheader|
subheader.with_segmented_control("aria-label": I18n.t(:label_filter_plural)) do |control|
control.with_item(
tag: :a,
icon: :unread,
href: notifications_path(facet: nil, **current_filters),
label: t("notifications.facets.unread"),
title: t("notifications.facets.unread_title"),
selected: @facet != "all"
)
control.with_item(
tag: :a,
icon: :read,
href: notifications_path(facet: "all", **current_filters),
label: t("notifications.facets.all"),
title: t("notifications.facets.all_title"),
selected: @facet == "all"
)
end
subheader.with_action_button(
tag: :a,
href: mark_all_read_notifications_path(**current_filters),
data: { turbo_method: :post, turbo_confirm: I18n.t("js.notifications.center.mark_all_read_confirmation") },
size: :medium,
leading_icon: :"op-read-all",
label: I18n.t("js.notifications.center.mark_all_read"),
disabled: !unread_notifications?,
test_selector: "mark-all-as-read-button"
) do
I18n.t("js.notifications.center.mark_all_read")
end
end %>