1
0
mirror of https://github.com/raseels-repos/golang-saas-starter-kit.git synced 2025-08-08 22:36:41 +02:00

completed flash messages

This commit is contained in:
Lee Brown
2019-08-03 15:01:17 -08:00
parent 0344473c1e
commit 32cb554dfa
22 changed files with 653 additions and 244 deletions

View File

@@ -107,7 +107,26 @@
{{ end }}
</div>
{{ end }}
{{ define "top-error" }}
{{ define "app-flashes" }}
{{ if .flashes }}
{{ range $f := .flashes }}
<div class="alert alert-{{ $f.Type }}" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span> </button>
{{ if $f.Title }}<h3>{{ $f.Title }}</h3>{{end}}
{{ if $f.Text }}<p>{{ $f.Text }}</p>{{end}}
{{ if $f.Items }}
<ul>
{{ range $i := $f.Items }}
<li>{{ $i }}</li>
{{end}}
</ul>
{{ end }}
{{ if $f.Details }}
<p><small>{{ $f.Details }}</small></p>
{{ end }}
</div>
{{ end }}
{{ end }}
{{ if .error }}
{{ $errMsg := (ErrorMessage $._Ctx .error) }}
{{ $errDetails := (ErrorDetails $._Ctx .error) }}