miniflux/model/theme.go

27 lines
604 B
Go
Raw Normal View History

2017-11-20 06:10:04 +01:00
// Copyright 2017 Frédéric Guillot. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
package model
2017-11-25 21:44:32 +01:00
import "github.com/miniflux/miniflux2/errors"
2017-11-20 06:10:04 +01:00
// GetThemes returns the list of available themes.
func GetThemes() map[string]string {
return map[string]string{
"default": "Default",
"black": "Black",
}
}
2017-11-25 21:44:32 +01:00
// ValidateTheme validates theme value.
func ValidateTheme(theme string) error {
for key := range GetThemes() {
if key == theme {
return nil
}
}
return errors.NewLocalizedError("Invalid theme.")
}