-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tree.go
51 lines (41 loc) · 1.13 KB
/
tree.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package components
import (
"html/template"
"github.com/MarErm27/GoAdmin/modules/menu"
"github.com/MarErm27/GoAdmin/template/types"
)
type TreeAttribute struct {
Name string
Tree []menu.Item
EditUrl string
DeleteUrl string
UrlPrefix string
OrderUrl string
types.Attribute
}
func (compo *TreeAttribute) SetTree(value []menu.Item) types.TreeAttribute {
compo.Tree = value
return compo
}
func (compo *TreeAttribute) SetEditUrl(value string) types.TreeAttribute {
compo.EditUrl = value
return compo
}
func (compo *TreeAttribute) SetUrlPrefix(value string) types.TreeAttribute {
compo.UrlPrefix = value
return compo
}
func (compo *TreeAttribute) SetDeleteUrl(value string) types.TreeAttribute {
compo.DeleteUrl = value
return compo
}
func (compo *TreeAttribute) SetOrderUrl(value string) types.TreeAttribute {
compo.OrderUrl = value
return compo
}
func (compo *TreeAttribute) GetContent() template.HTML {
return ComposeHtml(compo.TemplateList, compo.Separation, *compo, "tree")
}
func (compo *TreeAttribute) GetTreeHeader() template.HTML {
return ComposeHtml(compo.TemplateList, compo.Separation, *compo, "tree-header")
}