product

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

Index

Constants

View Source
const DefaultPageSize = 20

DefaultPageSize is used when no valid per_page query param is supplied.

Variables

View Source
var PageSizes = []int{20, 50, 100}

PageSizes are the selectable "items per page" options for the products list.

Functions

func Form

func Form(
	data layout.AppLayoutData,
	p *model.Product,
	recipe *dto.RecipeDTO,
	cogs int64,
	cogsAvailable bool,
	errMsg string,
	categorySuggestions []string,
	productCategories []model.Category,
) templ.Component

func Index

func Index(props IndexProps) templ.Component

func Recipe

func Recipe(
	data layout.AppLayoutData,
	product model.Product,
	recipe dto.RecipeDTO,
	ingredients []model.Product,
) templ.Component

Types

type IndexProps

type IndexProps struct {
	Data           layout.AppLayoutData
	Products       []model.Product
	ActiveType     string
	ActiveCategory string
	// Categories lists the company's categories, used as the filter
	// dropdown's options.
	Categories []model.Category
	Search     string
	Page       int
	PerPage    int
	TotalItems int
	// Created, when non-empty, is the name of a product just created —
	// triggers a success toast confirming the save.
	Created string
}

IndexProps holds the data needed to render the products list page.

Jump to

Keyboard shortcuts

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