Allow setting widget title URL
This commit is contained in:
parent
4dbb5975c0
commit
514cf2b81c
8 changed files with 36 additions and 5 deletions
|
|
@ -119,6 +119,7 @@ const (
|
|||
type widgetBase struct {
|
||||
Type string `yaml:"type"`
|
||||
Title string `yaml:"title"`
|
||||
TitleURL string `yaml:"title-url"`
|
||||
CSSClass string `yaml:"css-class"`
|
||||
CustomCacheDuration DurationField `yaml:"cache"`
|
||||
ContentAvailable bool `yaml:"-"`
|
||||
|
|
@ -186,6 +187,14 @@ func (w *widgetBase) withTitle(title string) *widgetBase {
|
|||
return w
|
||||
}
|
||||
|
||||
func (w *widgetBase) withTitleURL(titleURL string) *widgetBase {
|
||||
if w.TitleURL == "" {
|
||||
w.TitleURL = titleURL
|
||||
}
|
||||
|
||||
return w
|
||||
}
|
||||
|
||||
func (w *widgetBase) withCacheDuration(duration time.Duration) *widgetBase {
|
||||
w.cacheType = cacheTypeDuration
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue