{* SPDX-FileCopyrightText: © 2021 Olivier Meunier SPDX-License-Identifier: AGPL-3.0-only *} {{- block icon(name, src, class="svgicon", svgClass="w-4", w="24", h, attrs=attrList()) -}} {{- if !src -}}{{ src="img/icons.svg" }}{{- end -}} {{- end -}} {{- block message(type="info", icon="o-info", removable=false, delay=0, class="", attrs=attrList()) -}} {{- if !icon -}}{{- icon := "o-info" -}}{{- end -}} {{- if type == "success" -}} {{- icon = "o-check-on" -}} {{- else if type == "error" -}} {{- icon = "o-error" -}} {{- end -}} {{- if removable || delay > 0 -}} {{- attrs.Set("data-controller", "remover") -}} {{- end -}} {{- attrs.Set("data-remover-delay-value", delay) -}}
{{- if icon != "" -}}
{{- yield icon(name=icon) -}}
{{- end -}}
{{- yield content -}}
{{- if removable -}}
{{- end -}}
{{- end -}} {{- block flashes() -}} {{- if len(flashes) > 0 -}}
{{- range flashes -}} {{- if !hasPrefix(.Type, "_") -}} {{- attrs := attrList("role", "status") -}} {{- if .Type == "error" -}} {{- attrs.Set("role", "alert") -}} {{- end -}}
{{- yield message(type=.Type, delay=5, removable=true, attrs=attrs) content -}} {{ .Message }} {{- end -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}} {{- block spinner() -}} {{ yield icon(name="o-spinner", svgClass="animate-spin stroke-current")}} {{- end -}} {{- block quickAccessMenu(items=slice()) -}} {{- if items -}} {{- end -}} {{- end -}} {{- block mainMenuItem(name, path, icon, current=false) -}}
  • {{ yield icon(name=icon) }} {{ name }}
  • {{- end -}} {{- block sideMenuTitle() -}}

    {{- yield content -}}

    {{- end -}} {{- block sideMenuItem(name, path, icon, current=false, nbItems=nil) -}}
  • {{- yield icon(name=icon) }} {{ name }} {{- if nbItems -}} {{ nbItems }} {{- end -}}
  • {{- end -}} {{- block breadcrumbs() -}} {{- if isset(.Breadcrumbs) -}} {{- end -}} {{- end -}}