Some pages display a message in the table body when empty, while others show a full-page empty state. This PR unifies the empty states to consistently show a message in the table body. It removes the conditional wrapping the table. The new method of displaying the empty state is also more consistent with the rest of the app and includes the page header.
35 lines
836 B
Plaintext
35 lines
836 B
Plaintext
<% @page_title = "Projects" %>
|
|
|
|
<%== render(
|
|
"components/page_header",
|
|
locals: {
|
|
right_items: (@projects.count > 0) ? [
|
|
render("components/button", locals: { text: "Create Project", link: "/project/create" })
|
|
] : []
|
|
}
|
|
) %>
|
|
|
|
<div class="grid gap-6">
|
|
<%== render(
|
|
"components/table_card",
|
|
locals: {
|
|
headers: ["Name"],
|
|
rows: @projects.map do |p|
|
|
[
|
|
[
|
|
[p[:name], {link: p[:path] + "/dashboard"}]
|
|
],
|
|
{ id: "project-#{p[:id]}" }
|
|
]
|
|
end,
|
|
empty_state: {
|
|
icon: "hero-folder-open",
|
|
title: "No projects",
|
|
description: "Get started by creating a new project.",
|
|
button_link: "/project/create",
|
|
button_title: "Create Project"
|
|
}
|
|
}
|
|
) %>
|
|
</div>
|