Files
2025-02-11 18:49:20 +01:00

49 lines
1.8 KiB
Plaintext

<%=
if @work_package.present?
grid_layout("op-wp-hover-card", tag: :div) do |grid|
grid.with_area(:info, tag: :div) do
render(WorkPackages::InfoLineComponent.new(work_package: @work_package))
end
grid.with_area(:project, tag: :div) do
render(Primer::Beta::Text.new(font_size: :small, color: :muted)) { @work_package.project.name }
end
grid.with_area(:subject, tag: :div) do
render(Primer::Beta::Text.new(font_weight: :semibold)) { @work_package.subject }
end
grid.with_area(:assignee, tag: :div, font_size: :small, color: :muted) do
if @assignee.present?
# Render the avatar without a hover card => opening another hover card within a hover card is not supported
render(
Users::AvatarComponent.new(
user: @assignee,
show_name: true,
link: false,
size: :mini,
classes: "op-wp-hover-card--principal",
hover_card: { active: false }
)
)
else
concat(render(Primer::Beta::Octicon.new(icon: :person, mr: 1)))
concat(render(Primer::Beta::Text.new) { "-" })
end
end
grid.with_area(:dates, tag: :div, font_size: :small, color: :muted) do
if show_date_field?
concat(render(Primer::Beta::Octicon.new(icon: :calendar, mr: 1)))
concat(render(WorkPackages::HighlightedDateComponent.new(work_package: @work_package)))
end
end
end
else
render Primer::Beta::Blankslate.new(border: false, narrow: true) do |component|
component.with_visual_icon(icon: "x-circle")
component.with_heading(tag: :h3).with_content(I18n.t("api_v3.errors.not_found.work_package"))
end
end
%>