feat(cv): qualify templates and reliable local import processing

This commit is contained in:
cesnimda
2026-10-28 14:36:12 +01:00
parent 73ea888375
commit 3f4db8ca81
69 changed files with 2597 additions and 180 deletions
@@ -50,7 +50,7 @@ public sealed class CvVariantController : ControllerBase
var user = await _users.GetUserAsync(User);
if (user is null) return Unauthorized();
var proThemes = AccountPlans.ForRoles(await _users.GetRolesAsync(user)).ProThemes;
var themes = CvThemeCatalog.Themes.Select(t => new
var themes = CvThemeCatalog.RevisedThemes.Select(t => new
{
id = t.Id,
name = t.Name,
@@ -67,6 +67,7 @@ public sealed class CvVariantController : ControllerBase
supportedSettings = t.SupportedSettings,
pageMarginMm = t.PageMarginMm,
bodyFont = t.BodyFont,
headingFont = t.HeadingFont,
baseFontSizePt = t.BodySizePt,
lineHeight = t.LineHeight,
});
@@ -82,7 +83,7 @@ public sealed class CvVariantController : ControllerBase
if (user is null) return Unauthorized();
if (!CvThemeCatalog.Exists(themeId)) return NotFound();
var theme = CvThemeCatalog.Resolve(themeId);
var settings = CvVariantSettingsJson.Normalize(new CvVariantSettings { ThemeId = theme.Id, ShowIcons = true });
var settings = CvVariantSettingsJson.Normalize(new CvVariantSettings { ThemeId = theme.Id, DesignVersion = 2, ShowIcons = true });
var render = _renderer.Render(TemplatePreviewModel(), theme, settings);
return Ok(new RenderDto(render.ThemeId, render.Html, render.SuggestedFileName));
}