components: buttons, dropdown, href, nav
This commit is contained in:
parent
bfde0cc445
commit
7073cd1c21
9 changed files with 106 additions and 19 deletions
16
template/components/form_dropdown.html
Normal file
16
template/components/form_dropdown.html
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{{define "form_dropdown_item"}}
|
||||
<li><a class="dropdown-item {{if eq .IsActive true}}active{{end}} {{if eq .IsDisabled true}}disabled{{end}}" href="{{.Link}}">{{.Text}}</a></li>
|
||||
{{end}}
|
||||
|
||||
{{define "form_dropdown"}}
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-{{.TypeClass}} dropdown-toggle {{if eq .IsDisabled true}}disabled{{end}}" type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
{{.Label}}
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
{{ range .Items}}
|
||||
{{template "form_dropdown_item" .}}
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
{{end}}
|
||||
Loading…
Add table
Add a link
Reference in a new issue