go-bouquins/templates/author.html
Meutel 8f0c1799dc
All checks were successful
continuous-integration/drone/push Build is passing
Bootstrap 4
2019-09-12 19:15:26 +02:00

61 lines
1.9 KiB
HTML

{{ template "header.html" . }}
<div class="container" id="author">
{{ if .ID }}
<div class="border-bottom mb-3">
<h1>
<i class="fas fa-user"></i>
{{ .Name }}
</h1>
</div>
<ul class="nav nav-pills">
<li role="presentation" class="nav-item"><a href="#" class="nav-link" :class="{ active: tab == 'books' }" @click="showBooks">Livres</a></li>
{{ if gt (len .Series) 0 }}
<li role="presentation" class="nav-item"><a href="#" class="nav-link" :class="{ active: tab == 'series' }" @click="showSeries">Series</a></li>
{{ end }}
{{ if gt (len .CoAuthors) 0 }}
<li role="presentation" class="nav-item"><a href="#" @click="showAuthors" class="nav-link" :class="{ active: tab == 'authors' }">Co-auteurs</a></li>
{{ end }}
</ul>
<div class="card card-default" :hidden="tab != 'books'">
<div class="card-body">
{{ range .Books }}
<ul class="list-unstyled">
<li> <i class="fas fa-book"></i>
<a href="/books/{{ .ID }}">{{ .Title }}</a>
</li>
</ul>
{{ end }}
</div>
</div>
{{ if gt (len .Series) 0 }}
<div class="card card-default" :hidden="tab != 'series'">
<div class="card-body">
{{ range .Series }}
<ul class="list-unstyled">
<li><i class="fas fa-list"></i>
<a href="/series/{{ .ID }}">{{ .Name }}</a>
</li>
</ul>
{{ end }}
</div>
</div>
{{ end }}
{{ if gt (len .CoAuthors) 0 }}
<div class="card card-default" :class="tab != 'authors'">
<div class="card-body">
{{ range .CoAuthors }}
<ul class="list-unstyled">
<li><i class="fas fa-user"></i>
<a href="/authors/{{ .ID }}">{{ .Name }}</a>
</li>
</ul>
{{ end }}
</div>
</div>
{{ end }}
{{ else }}
<div class="alert alert-danger" role="alert">Aucun auteur sélectionné</div>
{{ end }}
</div>
{{ template "footer.html" . }}