Initial commit
This commit is contained in:
31
internal/widget/bookmarks.go
Normal file
31
internal/widget/bookmarks.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package widget
|
||||
|
||||
import (
|
||||
"html/template"
|
||||
|
||||
"github.com/glanceapp/glance/internal/assets"
|
||||
)
|
||||
|
||||
type Bookmarks struct {
|
||||
widgetBase `yaml:",inline"`
|
||||
cachedHTML template.HTML `yaml:"-"`
|
||||
Groups []struct {
|
||||
Title string `yaml:"title"`
|
||||
Color *HSLColorField `yaml:"color"`
|
||||
Links []struct {
|
||||
Title string `yaml:"title"`
|
||||
URL string `yaml:"url"`
|
||||
} `yaml:"links"`
|
||||
} `yaml:"groups"`
|
||||
}
|
||||
|
||||
func (widget *Bookmarks) Initialize() error {
|
||||
widget.withTitle("Bookmarks").withError(nil)
|
||||
widget.cachedHTML = widget.render(widget, assets.BookmarksTemplate)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (widget *Bookmarks) Render() template.HTML {
|
||||
return widget.cachedHTML
|
||||
}
|
||||
Reference in New Issue
Block a user