Files
openproject/app/components/messages/show_page_header_component.html.erb
2026-02-09 15:08:13 +01:00

63 lines
1.9 KiB
Plaintext

<%=
render Primer::OpenProject::PageHeader.new do |header|
header.with_title { @topic.subject }
header.with_breadcrumbs(breadcrumb_items)
watcher_action_button(header, @topic)
if !@topic.locked? && authorize_for("messages", "reply")
header.with_action_button(
tag: :a,
scheme: :default,
mobile_icon: :quote,
mobile_label: t(:button_quote),
size: :medium,
href: url_for({ action: "quote", id: @topic }),
aria: { label: I18n.t(:button_delete) },
data: { action: "forum-messages#quote", test_selector: "message-quote-button" },
title: t(:button_quote)
) do |button|
button.with_leading_visual_icon(icon: :quote)
t(:button_quote)
end
end
if @message.editable_by?(User.current)
header.with_action_button(
tag: :a,
scheme: :default,
mobile_icon: :pencil,
mobile_label: t(:button_edit),
size: :medium,
href: edit_project_forum_topic_path(@topic.forum.project, @topic.forum, @topic),
aria: { label: t(:button_edit) },
data: { test_selector: "message-edit-button" },
title: t(:button_edit)
) do |button|
button.with_leading_visual_icon(icon: :pencil)
t(:button_edit)
end
end
if @message.destroyable_by?(User.current)
header.with_action_button(
tag: :a,
scheme: :danger,
mobile_icon: :trash,
mobile_label: t(:button_delete),
size: :medium,
href: project_forum_topic_path(@topic.forum.project, @topic.forum, @topic),
aria: { label: I18n.t(:button_delete) },
data: {
turbo_confirm: I18n.t(:text_are_you_sure),
turbo_method: :delete
},
title: I18n.t(:button_delete)
) do |button|
button.with_leading_visual_icon(icon: :trash)
t(:button_delete)
end
end
end
%>