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

78 lines
2.2 KiB
HTML

{{ template "header.html" . }}
<div class="container" id="app">
{{ if .ID }}
<div class="border-bottom mb-3">
{{ if .HasCover }}
<div class="row">
<a href="#bookinfo">
<img src="{{ bookCover .BookFull }}" alt="Pas de couverture" title="Couverture" class="img-fluid rounded" width="400px"/>
</a>
</div>
{{ end }}
<div class="row" id="bookinfo">
<div class="col-xs-12 col-md-8">
<h1> <i class="fas fa-book"></i> {{ .Title }} </h1>
</div>
{{ if gt (len .Data) 0 }}
<div class="col-xs-12 col-md-4 text-right">
{{ $book := .BookFull }}
{{ range .Data }}
<a href="{{ bookLink . $book }}" class="btn btn-success">
<i class="fas fa-download"></i> Télécharger
{{ .Format }} ({{ humanSize .Size }})
</a>
{{ end }}
</div>
{{ end }}
</div>
</div>
<div class="row">
<div class="col">
<h2>
<i class="fas fa-user"></i> Auteur{{ if gt (len .Authors) 1 }}s{{ end }}
</h2>
<ul class="mb-2">
{{ range .Authors }}
<li>
<a href="/authors/{{.ID}}">{{ .Name }}</a>
</li>
{{ end }}
</ul>
{{ if .Series }}
<h2>
<i class="fas fa-list"></i> Serie
</h2>
<div class="mb-2 ml-4">
<a href="/series/{{ .Series.ID }}">{{ .Series.Name }}</a>
<span class="badge badge-pill badge-secondary">{{ .SeriesIndex }}</span>
</div>
{{ end }}
<h2> <i class="fas fa-language"></i> Langue</h2>
<ul><li>{{ .Lang }}</li></ul>
{{ if gt (len .Tags) 0 }}
<h2>
<i class="fas fa-tags"></i> Tags
</h2>
<div v-if="book.tags" class="mb-2 ml-4">
{{ range .Tags }}
<span class="badge badge-info">{{ . }}</span>&nbsp;
{{ end }}
</div>
{{ end }}
<h2><i class="fas fa-info-circle"></i> Détails</h2>
<ul class="mb-2">
<li v-if="book.pubdate"><strong>Date de publication</strong> {{ .Pubdate }}</li>
<li v-if="book.publisher"><strong>Editeur</strong> {{ .Publisher }}</li>
</ul>
</div>
</div>
{{ else }}
<div class="alert alert-danger" role="alert">Aucun livre sélectionné</div>
{{ end }}
</div>
{{ template "footer.html" . }}