BrainMinder/assets/templates/partials/message.tmpl

17 lines
595 B
Cheetah
Raw Normal View History

2024-08-22 10:13:16 +02:00
{{define "message"}}
{{ if len .messageContent}}
{{ $messageClass := ""}}
{{if eq .messageType "success"}} {{ $messageClass = "alert-success"}}
{{else if eq .messageType "failure"}} {{ $messageClass = "alert-failure"}}
{{ end }}
<div _="init add .show to #message then wait 5s then remove .show from #message" class="w3-panel {{ $messageClass }} w3-padding-4 w3-round-large">
<p><i class="bi bi-check-circle w3-large"></i> {{.messageContent}}</p>
<ul>
{{ range $field, $fieldMessage := .messageFieldErrors }}
<li>{{ $fieldMessage }}</li>
{{ end }}
</ul>
</div>
{{ end }}
{{ end }}