views

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccountPassword

func AccountPassword(session *auth.Session, data AccountPasswordData) templ.Component

func CSRFField

func CSRFField() templ.Component

CSRFField renders the hidden form input every state-changing form must include. Pulls the value from ctx (set by the auth middleware) so callers never need to thread the token explicitly.

func FormError

func FormError(msg string) templ.Component

FormError renders a small "we couldn't process that" banner above forms.

func Home

func Home(session *auth.Session, groups []HomeData) templ.Component

Home is the post-login landing page. Lists every team the viewer belongs to, each with its projects + an action to create a new one. Replaces the step-3 placeholder that just said "you're signed in".

func Index

func Index() templ.Component

Index is the unauthenticated landing page. The brand string is asserted by internal/web/server_test.go and e2e/boot_test.go, so don't paraphrase it without updating those.

func InviteConfirm

func InviteConfirm(session *auth.Session, data InviteConfirmData) templ.Component

func InviteInvalid

func InviteInvalid(session *auth.Session) templ.Component

InviteInvalid is the 404 page for unknown / consumed / expired invite tokens. Status code is set by the handler before render.

func Layout

func Layout(title string, session *auth.Session) templ.Component

Layout is the shared HTML chrome for every server-rendered page. Holds the global hx-headers so every htmx-triggered request forwards X-CSRF-Token, and the minimal CSS that ships with v1.

Pass session=nil for anonymous pages (login, invite confirmation); the layout adapts the header nav.

func Login

func Login(emailValue, errMsg, invitePlaintext, inviteTeamName, next string) templ.Component

Login is the password form. invitePlaintext rides along when the user arrived via /login?invite=:t — the hidden field threads it through to POST /login, which consumes the invite after a successful auth.

next is the post-login redirect target (e.g. /oauth/authorize?…) used by the OAuth bounce. The handler validates it through safeRedirect before trusting it; the view just renders whatever non-empty value it gets.

There is no public signup. New users without an invite can't create an account from this page; new users with an invite get a "back to invite" link instead, which lands them on the invite page's inline signup form.

func OAuthConsent

func OAuthConsent(session *auth.Session, data OAuthConsentData) templ.Component

func ProjectQuery

func ProjectQuery(session *auth.Session, data ProjectQueryData) templ.Component

func ProjectShow

func ProjectShow(session *auth.Session, data ProjectShowData) templ.Component

func TeamShow

func TeamShow(session *auth.Session, data TeamShowData) templ.Component

Types

type AccountPasswordData

type AccountPasswordData struct {
	Forced bool
	ErrMsg string
}

AccountPasswordData drives the change-password form. Forced is true when the user got here because session.MustChangePassword is set (operator reset path) — the page renders an explanatory banner (TODO 3).

type HomeData

type HomeData struct {
	Team     db.Team
	Projects []db.Project
}

HomeData groups the per-team project list for the rebuilt home page (Issue 5). The handler runs Teams.List + Projects.ListForTeams and groups by team_id in Go before rendering.

type InviteConfirmData

type InviteConfirmData struct {
	TeamName      string
	PageTitle     string // "Join {TeamName}"; handler precomputes
	InviteToken   string // plaintext token (used in form action + login link)
	AlreadyMember bool
	AnonLoginURL  string // "/login?invite=:t" — for existing users
	Email         string // re-rendered on anon POST validation failure
	ErrMsg        string // re-rendered on anon POST validation failure
}

InviteConfirmData drives the GET /invites/:token confirmation page. AlreadyMember nudges the UX without changing the consume semantics — clicking the button still burns the invite and lands on the team page.

For anonymous viewers the page renders an inline signup form that POSTs back to /invites/:token; the handler creates the account, consumes the invite, and logs the user in atomically (see invites_handlers.postInvite anon branch). Email and ErrMsg are populated when re-rendering after a failed POST.

type OAuthConsentData

type OAuthConsentData struct {
	ClientID            string
	ClientName          string
	RedirectURI         string
	State               string
	Scope               string
	CodeChallenge       string
	CodeChallengeMethod string
	Projects            []db.Project
}

OAuthConsentData powers /oauth/authorize's consent page. Carries the client identity the user is being asked to authorize, the projects the viewer can grant access to, and the verbatim authorize-request params so a POST decision can hand them back unchanged.

type ProjectQueryData

type ProjectQueryData struct {
	Project   db.Project
	PageTitle string
	SQL       string
	Schema    query.Schema
	Result    query.Result
	ErrMsg    string
}

type ProjectShowData

type ProjectShowData struct {
	Project     db.Project
	PublicToken string
	ErrMsg      string
}

ProjectShowData carries the project detail view.

  • PublicToken is the plaintext mere_pub_… snippet token; non-secret, displayed verbatim on every visit so the user can copy it into client-side HTML. Auto-provisioned at project create.

/v1/* + /mcp bearer auth is served by OAuth (package internal/oauth), so this page no longer issues per-project secret tokens.

type TeamShowData

type TeamShowData struct {
	Team      db.Team
	Members   []db.ListMembersForTeamForUserRow
	NewInvite string // full URL ("https://host/invites/<plaintext>"); blank if none just issued
	ErrMsg    string
}

TeamShowData carries the bits the team-settings page needs. NewInvite is non-empty only on the render-on-POST response after creating an invite — the plaintext URL is shown exactly once (mirrors the token UX in Issue 3, applied to invites for symmetry).

Jump to

Keyboard shortcuts

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