23 lines
905 B
Cheetah
23 lines
905 B
Cheetah
|
{{define "flash"}}
|
||
|
<div class="flash has-margin-top-small">
|
||
|
{{- 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" -}}
|
||
|
<div class="message {{.MessageClass}}">
|
||
|
<div class="message-body">
|
||
|
<span class="has-text-weight-bold">{{.Title}}</span> {{.Message}}
|
||
|
</div>
|
||
|
</div>
|
||
|
{{- end}}
|