Make projects depend on templates

This commit is contained in:
2026-09-08 10:25:52 +00:00
committed by Twyco
parent 40f9b473fc
commit fef82cb88f
19 changed files with 281 additions and 14 deletions
@@ -30,7 +30,7 @@ const breadcrumbs: BreadcrumbItem[] = [
href: projectShow(props.project.id),
},
{
title: 'Save as template',
title: 'Save as new template',
href: `/projects/${props.project.id}/templates/create`,
},
];
@@ -58,13 +58,13 @@ const submit = (): void => {
<template>
<AppLayout :breadcrumbs="breadcrumbs">
<Head :title="`Save ${project.name} as template`" />
<Head :title="`Save ${project.name} as new template`" />
<div class="mx-auto flex w-full max-w-3xl flex-1 flex-col gap-6 p-4">
<div class="space-y-3">
<Badge variant="outline" class="px-3 py-1">{{ project.key }}</Badge>
<Heading
:title="`Save ${project.name} as template`"
:title="`Save ${project.name} as new template`"
description="Capture reusable project configuration without copying operational ticket data."
/>
</div>
@@ -127,7 +127,7 @@ const submit = (): void => {
<div class="flex items-center gap-3">
<Button type="submit" :disabled="form.processing">
Save template
Save new template
</Button>
<Button as-child variant="outline">
@@ -38,7 +38,7 @@ const removeTemplate = (templateId: number): void => {
<div class="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between">
<Heading
title="Project templates"
description="Reusable project configuration templates saved from existing projects."
description="Reusable published project templates. Internal project base templates stay hidden here by default."
/>
<div class="flex flex-wrap gap-3">
@@ -60,7 +60,7 @@ const removeTemplate = (templateId: number): void => {
</div>
<div v-if="templates.length === 0" class="text-muted-foreground text-sm">
No project templates have been saved yet.
No published project templates have been saved yet.
</div>
<div v-else class="grid gap-4 md:grid-cols-2 xl:grid-cols-3">
+1 -1
View File
@@ -100,7 +100,7 @@ const projectAreas = [
variant="outline"
>
<Link :href="`/projects/${project.id}/templates/create`">
Save as template
Save as new template
</Link>
</Button>
@@ -2,6 +2,8 @@ import type { ProjectModel } from '@/types/models/project-model';
export type ProjectTemplateModel = {
id: number;
is_published: boolean;
project_id: number | null;
source_project_id: number | null;
source_project: ProjectModel | null;
name: string;