forked from goffee/core
Badge
This commit is contained in:
parent
05bd3a01ee
commit
a904773bab
2 changed files with 14 additions and 0 deletions
7
template/components/content_badge.go
Normal file
7
template/components/content_badge.go
Normal file
|
@ -0,0 +1,7 @@
|
|||
package components
|
||||
|
||||
type ContentBadge struct {
|
||||
Text string
|
||||
TypeClass string // type primary, secondary, success, danger, warning, info, light, dark, (default secondary)
|
||||
IsOutline bool
|
||||
}
|
7
template/components/content_badge.html
Normal file
7
template/components/content_badge.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
{{define "content_badge"}}
|
||||
<span class="badge {{if eq .IsOutline true}}
|
||||
border border-{{.TypeClass}} bg-{{.TypeClass}}-subtle text-{{.TypeClass}}-emphasis
|
||||
{{else}}
|
||||
text-bg-{{if .TypeClass}}{{.TypeClass}}{{else}}secondary{{end}}
|
||||
{{end}} rounded-pill ">{{.Text}}</span>
|
||||
{{end}}
|
Loading…
Reference in a new issue