package handler import ( "html/template" "net/http" "os" "path/filepath" "strings" "codeberg.org/VARASYS/ZDDC/zddc/internal/apps" "codeberg.org/VARASYS/ZDDC/zddc/internal/config" "codeberg.org/VARASYS/ZDDC/zddc/internal/zddc" ) // editorView is the data passed to the editor template. Field naming is // kept short for template ergonomics. type editorView struct { Path string IsRoot bool CanEdit bool Exists bool Email string HasCustomCSS bool File zddc.ZddcFile EffectiveChain []chainEntry AppsRows []appsRow ProfilePathPrefix string // /.profile AssetsPathPrefix string // /.profile/zddc/assets } // appsRow renders one line of the Apps section: the apps key (default or // app name), its current value at THIS level (may be empty), and the // preview of how it resolves once the cascade is applied. type appsRow struct { Key string // "default" or canonical app name Value string // current spec at this .zddc level (empty = inherits) ResolvesTo string // human-readable preview line } // serveZddcEditor renders the form-based .zddc editor at // GET /.profile/zddc/edit?path=
{{ if .IsRoot }}Editing the root /.zddc.{{ else }}Editing {{ .Path }}/.zddc.{{ end }} You are signed in as {{ .Email }}.