From 376a8ae34d2a5332dcd24cba7a786620e70d79bd Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 12 Jul 2026 09:09:57 +0000 Subject: [PATCH] feat: Projekt-Typ Vorlage (template) - login-geschuetzt, isTemplate-Flag - neuer Typ template: hasWebsite wie preview, isPublic=false, isTemplate=true - deriveProjectType erkennt isTemplate; Appwrite-Update schreibt isTemplate - .webklar-preview.json bekommt template-Flag Co-Authored-By: Claude Opus 4.8 --- server/services/giteaAdmin.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/server/services/giteaAdmin.js b/server/services/giteaAdmin.js index 71789ca..0f40212 100644 --- a/server/services/giteaAdmin.js +++ b/server/services/giteaAdmin.js @@ -316,9 +316,11 @@ export async function createProjectFromTemplate({ * kein expliziter Typ mitgegeben wurde. * preview -> Website mit Login-geschuetzter Preview (Standard) * website -> oeffentliche Website ohne Login + * template -> Website-Vorlage (login-geschuetzt, nur Admin, in Vorlagen-Ansicht) * project -> internes Projekt ohne Hosting/Subdomain */ function deriveProjectType(doc) { + if (doc?.isTemplate) return 'template' if (doc?.isPublic) return 'website' if (doc?.subdomain) return 'preview' return 'project' @@ -354,8 +356,11 @@ export async function updateWebsiteProject(projectId, { projectName, subdomain, const nextName = String(projectName ?? doc.projectName ?? '').trim() || doc.projectName || repoSlug || '' const nextType = projectType || deriveProjectType(doc) - const hasWebsite = nextType === 'preview' || nextType === 'website' + // template = login-geschuetzte Vorlage: braucht Preview (wie 'preview'), aber + // nicht oeffentlich; wird als isTemplate markiert. + const hasWebsite = nextType === 'preview' || nextType === 'website' || nextType === 'template' const isPublic = nextType === 'website' + const isTemplate = nextType === 'template' const oldSubdomain = doc.subdomain || '' let nextSubdomain = '' @@ -394,6 +399,7 @@ export async function updateWebsiteProject(projectId, { projectName, subdomain, templateName: doc.templateName || config.gitea.templateRepo, projectType: nextType, public: isPublic, + template: isTemplate, ...(hasWebsite && nextSubdomain ? { subdomain: nextSubdomain } : {}), } @@ -437,6 +443,7 @@ export async function updateWebsiteProject(projectId, { projectName, subdomain, previewUrl, projectType: nextType, isPublic, + isTemplate, status: hasWebsite ? (deployResult.deployed ? 'deployed' : 'pending') : 'created', provisioningStatus: hasWebsite ? (deployResult.deployed ? 'ready' : (deployResult.error ? 'deploy_failed' : 'pending'))