shared

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateAssetPath added in v0.2.0

func GenerateAssetPath(cfg *config.Config) func(string) string

GenerateAssetPath creates asset paths based on environment settings

func GetCSRFToken added in v0.2.0

func GetCSRFToken(c echo.Context) string

GetCSRFToken retrieves the CSRF token from context

func GetCurrentUser added in v0.2.0

func GetCurrentUser(c echo.Context) *user.User

GetCurrentUser extracts user data from context

func GetMessageIcon added in v0.1.5

func GetMessageIcon(msgType string) string

GetMessageIcon returns the appropriate Bootstrap icon class for the message type

Types

type Message added in v0.2.0

type Message struct {
	Type string
	Text string
}

Message represents a user-facing message

type PageData

type PageData struct {
	Title                string
	User                 *user.User
	Forms                []*model.Form
	Form                 *model.Form
	Submissions          []*model.FormSubmission
	CSRFToken            string
	IsDevelopment        bool
	AssetPath            func(string) string
	Content              templ.Component
	FormBuilderAssetPath string
	Message              *Message
	Description          string
	Config               *config.Config
	Session              *session.Session
	UserID               string
	Email                string
	Role                 string
	Error                string
	Success              string
	Data                 any
}

PageData contains common data used across all pages

func BuildPageData added in v0.2.0

func BuildPageData(cfg *config.Config, c echo.Context, title string) PageData

BuildPageData constructs PageData with extracted functions

Jump to

Keyboard shortcuts

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