1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-19 13:19:43 +02:00

[WIP] theme selector

This commit is contained in:
Harvey Kandola 2018-11-24 16:13:21 +00:00
parent a7e52809dc
commit 11e164496b
74 changed files with 363 additions and 38 deletions

View file

@ -63,6 +63,7 @@ func (h *Handler) Meta(w http.ResponseWriter, r *http.Request) {
data.ConversionEndpoint = org.ConversionEndpoint
data.Storage = h.Runtime.StoreProvider.Type()
data.Location = h.Runtime.Flags.Location // reserved
data.Theme = org.Theme
// Strip secrets
data.AuthConfig = auth.StripAuthSecrets(h.Runtime, org.AuthProvider, org.AuthConfig)
@ -277,3 +278,20 @@ type sitemapItem struct {
type searchStatus struct {
Entries int `json:"entries"`
}
// Themes returns list of installed UI themes.
func (h *Handler) Themes(w http.ResponseWriter, r *http.Request) {
type theme struct {
Name string `json:"names"`
Primary string `json:"primary"`
}
th := []theme{}
th = append(th, theme{Name: "Default", Primary: "#280A42"})
th = append(th, theme{Name: "Blue", Primary: "#176091"})
th = append(th, theme{Name: "Deep Orange", Primary: "#BF360C"})
th = append(th, theme{Name: "Teal", Primary: "#00695C"})
response.WriteJSON(w, th)
}