Update interactive

This commit is contained in:
Eden Kirin
2024-01-21 14:32:32 +01:00
parent 26635bbff1
commit 728d37faba
12 changed files with 1280 additions and 251 deletions

View File

@ -2,61 +2,15 @@ package handlers
import (
"templ-tests/app/templates"
"templ-tests/app/types"
"github.com/gin-gonic/gin"
)
var catFacts []types.CatFact = []types.CatFact{
{
Breed: "Abyssinian",
Country: "Ethiopia",
Origin: "Natural/Standard",
Coat: "Short",
Pattern: "Ticked",
},
{
Breed: "Aegean",
Country: "Greece",
Origin: "Natural/Standard",
Coat: "Semi-long",
Pattern: "Bi- or tri-colored",
},
{
Breed: "American Curl",
Country: "United States",
Origin: "Mutation",
Coat: "Short/Long",
Pattern: "All",
},
{
Breed: "American Bobtail",
Country: "United States",
Origin: "Mutation",
Coat: "Short/Long",
Pattern: "All",
},
{
Breed: "American Shorthair",
Country: "United States",
Origin: "Natural",
Coat: "Short",
Pattern: "All but colorpoint",
},
{
Breed: "American Wirehair",
Country: "United States",
Origin: "Mutation",
Coat: "Rex",
Pattern: "All but colorpoint",
},
var pcAbout templates.PageContext = templates.PageContext{
Title: "Welcome to the demo - About",
ActivePage: "about",
}
func About(c *gin.Context) {
pc := templates.PageContext{
Title: "Welcome to the demo - About",
ActivePage: "about",
}
templates.About(pc, catFacts).Render(c, c.Writer)
templates.About(pcAbout).Render(c, c.Writer)
}