{ selectedEntry.Question }
{ selectedEntry.Category.Name } - { selectedEntry.Category.Theme }
package component import ( "bytes" "context" "fmt" "forge.cadoles.com/wpetit/kouiz/internal/http/form" common "forge.cadoles.com/wpetit/kouiz/internal/http/handler/webui/common/component" "forge.cadoles.com/wpetit/kouiz/internal/store" "github.com/pkg/errors" "github.com/yuin/goldmark" "log/slog" "slices" "strconv" "time" ) type QuizPageVModel struct { Player *store.Player CurrentTurn *store.QuizTurn PlayDelay time.Duration } func NewSelectEntryForm() *form.Form { return form.New( form.NewField( "entry", form.Attrs{}, form.NonEmpty("Ce champ ne doit pas être vide."), ), ) } func NewAnswerForm() *form.Form { return form.New( form.NewField( "answer", form.Attrs{}, form.NonEmpty("Ce champ ne doit pas être vide."), ), ) } templ QuizPage(vmodel QuizPageVModel) { @common.AppPage(common.WithPageOptions( common.WithTitle(fmt.Sprintf("Tour #%d", vmodel.CurrentTurn.ID)), )) {
Vous avez déjà joué ce tour ci !
Le prochain tour commencera dans { vmodel.CurrentTurn.EndedAt.Sub(time.Now().UTC()).Round(time.Second).String() }.
{ selectedEntry.Question }
{ selectedEntry.Category.Name } - { selectedEntry.Category.Theme }