package web import ( "net/http" "time" "gitea.mynodes.xyz/ilker/llmgw/internal/store" ) type imagesData struct { Nav Nav Contexts []ChatContext Context string User store.User Models []ChatModel CSRF string Version string Now string } // Images renders the page that makes pictures, for one signed-in person. // Its models are those that make them, as the chat's are those that write. func Images(user store.User, models []ChatModel, contexts []ChatContext, current, version string) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { noStore(w) render(w, r, "images", imagesData{ Nav: navFrom(r, "images"), Contexts: contexts, Context: current, User: user, Models: models, CSRF: csrfFor(r), Version: version, Now: time.Now().UTC().Format(time.RFC3339), }) } } // SetImages has the menu offer the pictures page while some model makes // them. Asked on every page, so it must be cheap: the catalog, not a request. func (p *AccountPages) SetImages(available func() bool) { p.images = available }