Allow setting custom CSS classes for individual widgets
This commit is contained in:
parent
b327e59ab1
commit
4dbb5975c0
3 changed files with 9 additions and 2 deletions
|
|
@ -1,4 +1,4 @@
|
|||
<div class="widget widget-type-{{ .GetType }}">
|
||||
<div class="widget widget-type-{{ .GetType }}{{ if ne "" .CSSClass }} {{ .CSSClass }}{{ end }}">
|
||||
<div class="widget-header">
|
||||
<div class="uppercase">{{ .Title }}</div>
|
||||
{{ if and .Error .ContentAvailable }}
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
<div class="notice-icon notice-icon-minor" title="{{ .Notice }}"></div>
|
||||
{{ end }}
|
||||
</div>
|
||||
<div class="widget-content {{ if .ContentAvailable }}{{ block "widget-content-classes" . }}{{ end }}{{ end }}">
|
||||
<div class="widget-content{{ if .ContentAvailable }} {{ block "widget-content-classes" . }}{{ end }}{{ end }}">
|
||||
{{ if .ContentAvailable }}
|
||||
{{ block "widget-content" . }}{{ end }}
|
||||
{{ else }}
|
||||
|
|
|
|||
|
|
@ -119,6 +119,7 @@ const (
|
|||
type widgetBase struct {
|
||||
Type string `yaml:"type"`
|
||||
Title string `yaml:"title"`
|
||||
CSSClass string `yaml:"css-class"`
|
||||
CustomCacheDuration DurationField `yaml:"cache"`
|
||||
ContentAvailable bool `yaml:"-"`
|
||||
Error error `yaml:"-"`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue