core/template/components/content_dropdown.html
2024-10-29 12:30:05 -05:00

16 lines
No EOL
663 B
HTML

{{define "content_dropdown_item"}}
<li><a {{ if .ID }}id="{{.ID}}"{{end}} class="dropdown-item {{if eq .IsActive true}}active{{end}} {{if eq .IsDisabled true}}disabled{{end}}" href="{{.Link}}">{{.Text}}</a></li>
{{end}}
{{define "content_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 "content_dropdown_item" .}}
{{end}}
</ul>
</div>
{{end}}