Add editable project template flow

This commit is contained in:
2026-05-25 11:12:55 +00:00
parent e38c77198d
commit 39a039cd1e
11 changed files with 438 additions and 1 deletions
@@ -11,6 +11,7 @@ import {
CardTitle,
} from '@/components/ui/card';
import AppLayout from '@/layouts/AppLayout.vue';
import { edit as projectTemplatesEdit } from '@/routes/project-templates';
import { create as projectsCreate, index as projectsIndex } from '@/routes/projects/index';
import type { BreadcrumbItem, ProjectTemplatesIndexPageProps } from '@/types';
@@ -69,6 +70,9 @@ const removeTemplate = (templateId: number): void => {
<div class="flex flex-wrap items-center gap-2">
<CardTitle>{{ template.name }}</CardTitle>
<Badge variant="secondary">{{ template.slug }}</Badge>
<Badge v-if="template.linked_project_count" variant="outline">
{{ template.linked_project_count }} linked {{ template.linked_project_count === 1 ? 'project' : 'projects' }}
</Badge>
</div>
<CardDescription>
<template v-if="template.source_project">
@@ -91,6 +95,12 @@ const removeTemplate = (templateId: number): void => {
</div>
<div class="flex flex-wrap gap-3">
<Button as-child variant="secondary">
<Link :href="projectTemplatesEdit(template.id)">
Edit
</Link>
</Button>
<Button as-child variant="outline">
<Link :href="projectsCreate({ query: { template: template.id } })">
Use template