{{define "message"}}
{{ if len .messageContent}}
{{ $messageClass := ""}}
{{if eq .messageType "success"}} {{ $messageClass = "alert-success"}}
{{else if eq .messageType "failure"}} {{ $messageClass = "alert-failure"}}
{{ end }}
<div class="{{ $messageClass }}">
  <p><i class="bi bi-check-circle"></i> {{.messageContent}}</p>
  <ul>
  {{ range $field, $fieldMessage := .messageFieldErrors }}
    <li>{{ $fieldMessage }}</li>
  {{ end }}
  </ul>
</div>
{{ end }}
{{ end }}
