workspace

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 12 Imported by: 0

Documentation

Overview

Package workspace provides the per-site workspace UI (config-driven SPA).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterSPARoutes

func RegisterSPARoutes(router *gin.Engine, siteRouter *knet.SiteRouter)

RegisterSPARoutes serves the SPA at /workspace, /assets, and /s/:site/*. Uses a single NoRoute handler to avoid conflicts.

func SPAFS

func SPAFS() fs.FS

SPAFS returns the embedded filesystem containing the built SPA.

func StaticHandler

func StaticHandler() http.Handler

StaticHandler returns a handler that serves the embedded templates for HTMX partials.

Types

type Handler

type Handler struct {
	Registry *doctype.Registry // fallback for single-site or boot
}

Handler holds dependencies for the workspace UI.

func NewHandler

func NewHandler(registry *doctype.Registry) *Handler

NewHandler creates a new workspace UI handler.

func (*Handler) HandleConfigView

func (h *Handler) HandleConfigView(c *gin.Context)

HandleConfigView renders the config manager page.

func (*Handler) HandleEditForm

func (h *Handler) HandleEditForm(c *gin.Context)

HandleEditForm renders the edit document form.

func (*Handler) HandleHome

func (h *Handler) HandleHome(c *gin.Context)

HandleHome renders the admin home page.

func (*Handler) HandleListView

func (h *Handler) HandleListView(c *gin.Context)

HandleListView renders the document list view for a DocType.

func (*Handler) HandleLoginPage

func (h *Handler) HandleLoginPage(c *gin.Context)

HandleLoginPage renders the login form.

func (*Handler) HandleNewForm

func (h *Handler) HandleNewForm(c *gin.Context)

HandleNewForm renders the new document form.

func (*Handler) RegisterRoutes

func (h *Handler) RegisterRoutes(router *gin.Engine)

RegisterRoutes registers the admin UI routes on the full engine.

func (*Handler) RegisterRoutesOnGroup

func (h *Handler) RegisterRoutesOnGroup(desk *gin.RouterGroup)

RegisterRoutesOnGroup registers admin UI routes on an existing RouterGroup.

type PageData

type PageData struct {
	Title    string
	SiteName string
	DocTypes []*doctype.DocType
	DocType  *doctype.DocType
	DocName  string
	Data     any
	Error    string
	Message  string
	User     string
	UserRole string
}

PageData is passed to every rendered template.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL