2022-05-11 21:38:20 +02:00
|
|
|
{{define "flash"}}
|
2022-06-01 17:31:21 +02:00
|
|
|
<div class="mt-8">
|
2022-05-11 21:38:20 +02:00
|
|
|
{{- range .Flashes -}}
|
|
|
|
{{- if eq .Type "error" -}}
|
|
|
|
{{template "flash_message" map "Title" "Erreur" "MessageClass" "is-danger" "Message" .Message }}
|
|
|
|
{{- else if eq .Type "warn" -}}
|
|
|
|
{{template "flash_message" map "Title" "Attention" "MessageClass" "is-warning" "Message" .Message }}
|
|
|
|
{{- else if eq .Type "success" -}}
|
|
|
|
{{template "flash_message" map "Title" "Succès" "MessageClass" "is-success" "Message" .Message }}
|
|
|
|
{{- else -}}
|
|
|
|
{{template "flash_message" map "Title" "Information" "MessageClass" "is-info" "Message" .Message }}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{define "flash_message" -}}
|
2022-06-01 17:31:21 +02:00
|
|
|
<div class="p-2 bg-cadoles items-center {{.MessageClass}} text-indigo-100 leading-none lg:rounded-full flex lg:inline-flex" role="alert">
|
|
|
|
<span class="font-semibold mr-2 text-left flex-auto">{{ .Message }}</span>
|
2022-05-11 21:38:20 +02:00
|
|
|
</div>
|
|
|
|
{{- end}}
|