2022-06-22 18:32:18 +00:00
|
|
|
{{- $context := .context }}
|
|
|
|
{{- $tabs := .tabs | default slice }}
|
2022-06-23 11:24:54 +00:00
|
|
|
{{- $groupid := .groupid | default "default" }}
|
2022-06-22 18:32:18 +00:00
|
|
|
{{- with $context }}
|
2023-01-29 15:45:42 +00:00
|
|
|
<div class="tab-panel" data-tab-group="{{ $groupid }}">
|
2022-06-22 18:32:18 +00:00
|
|
|
<div class="tab-nav">
|
|
|
|
{{- range $idx, $tab := $tabs }}
|
|
|
|
<button
|
|
|
|
data-tab-item="{{ .name }}"
|
2023-02-08 20:59:28 +00:00
|
|
|
class="tab-nav-button{{ cond (eq $idx 0) " active" ""}}"
|
2022-06-23 11:24:54 +00:00
|
|
|
onclick="switchTab('{{ $groupid }}','{{ .name }}')"
|
2023-01-29 15:45:42 +00:00
|
|
|
>
|
|
|
|
<span>{{ .name }}</span></button>
|
2022-06-22 18:32:18 +00:00
|
|
|
{{- end }}
|
|
|
|
</div>
|
|
|
|
<div class="tab-content">
|
|
|
|
{{- range $idx, $tab := $tabs }}
|
2023-01-29 15:45:42 +00:00
|
|
|
<div
|
|
|
|
data-tab-item="{{ .name }}"
|
2023-02-08 20:59:28 +00:00
|
|
|
class="tab-content-text{{ cond (eq $idx 0) " active" ""}}"
|
2023-01-29 15:45:42 +00:00
|
|
|
>
|
2022-06-22 18:32:18 +00:00
|
|
|
{{ .content | safeHTML }}
|
|
|
|
</div>
|
|
|
|
{{- end }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{- end }}
|