go-bouquins/templates/book.html

79 lines
2.2 KiB
HTML
Raw Normal View History

2017-07-30 16:09:27 +00:00
{{ template "header.html" . }}
<div class="container" id="app">
2017-08-06 18:25:20 +00:00
{{ if .ID }}
2017-08-01 18:00:20 +00:00
<div class="page-header">
2017-08-06 18:25:20 +00:00
{{ if .HasCover }}
2017-08-01 18:00:20 +00:00
<div class="row">
2017-09-05 14:29:34 +00:00
<a href="#bookinfo">
<img src="{{ bookCover .BookFull }}" alt="Pas de couverture" title="Couverture" class="img-responsive img-rounded" width="400px"/>
</a>
2017-07-30 16:09:27 +00:00
</div>
2017-08-01 18:00:20 +00:00
{{ end }}
2017-09-05 14:29:34 +00:00
<div class="row" id="bookinfo">
2017-07-30 16:09:27 +00:00
<div class="col-xs-12 col-md-9">
<h1>
<span class="glyphicon glyphicon-book"></span>
2017-08-01 13:38:23 +00:00
{{ .Title }}
2017-07-30 16:09:27 +00:00
</h1>
2017-07-30 13:39:20 +00:00
</div>
2017-08-01 18:00:20 +00:00
{{ if gt (len .Data) 0 }}
2017-07-30 16:09:27 +00:00
<div class="col-xs-12 col-md-3 text-right">
2017-08-04 17:47:15 +00:00
{{ $book := .BookFull }}
2017-08-01 18:00:20 +00:00
{{ range .Data }}
2017-08-04 17:47:15 +00:00
<a href="{{ bookLink . $book }}" class="btn btn-success">
2017-07-30 16:09:27 +00:00
<span class="glyphicon glyphicon-download-alt"></span> Télécharger
2017-08-04 17:47:15 +00:00
{{ .Format }} ({{ humanSize .Size }})
2017-07-30 16:09:27 +00:00
</a>
2017-08-01 18:00:20 +00:00
{{ end }}
2017-07-30 13:39:20 +00:00
</div>
2017-08-01 18:00:20 +00:00
{{ end }}
2017-07-30 16:09:27 +00:00
</div>
</div>
2017-08-01 18:00:20 +00:00
<div class="row">
2017-07-30 16:09:27 +00:00
<h2>
2017-08-01 18:00:20 +00:00
<span class="glyphicon glyphicon-user"></span> Auteur{{ if gt (len .Authors) 1 }}s{{ end }}
2017-07-30 16:09:27 +00:00
</h2>
<ul>
2017-08-01 18:00:20 +00:00
{{ range .Authors }}
<li>
2017-08-06 18:25:20 +00:00
<a href="/authors/{{.ID}}">{{ .Name }}</a>
2017-07-30 16:09:27 +00:00
</li>
2017-08-01 18:00:20 +00:00
{{ end }}
2017-07-30 16:09:27 +00:00
</ul>
2017-07-30 13:39:20 +00:00
2017-08-01 18:00:20 +00:00
{{ if .Series }}
<h2>
2017-07-30 16:09:27 +00:00
<span class="glyphicon glyphicon-list"></span> Serie
</h2>
2017-08-01 18:00:20 +00:00
<div>
2017-08-06 18:25:20 +00:00
<a href="/series/{{ .Series.ID }}">{{ .Series.Name }}</a>
2017-08-01 18:00:20 +00:00
<span class="badge">{{ .SeriesIndex }}</span>
2017-07-30 16:09:27 +00:00
</div>
2017-08-01 18:00:20 +00:00
{{ end }}
2017-07-30 16:09:27 +00:00
<h2><span class="glyphicon glyphicon-globe"></span> Langue</h2>
2017-08-01 18:00:20 +00:00
<ul><li>{{ .Lang }}</li></ul>
2017-07-30 13:39:20 +00:00
2017-08-01 18:00:20 +00:00
{{ if gt (len .Tags) 0 }}
<h2>
2017-07-30 16:09:27 +00:00
<span class="glyphicon glyphicon-tags"></span> Tags
</h2>
<div v-if="book.tags">
2017-08-01 18:00:20 +00:00
{{ range .Tags }}
<span class="label label-info">{{ . }}</span>&nbsp;
{{ end }}
2017-07-30 13:39:20 +00:00
</div>
2017-08-01 18:00:20 +00:00
{{ end }}
2017-07-30 16:09:27 +00:00
<h2>Détails</h2>
<ul>
2017-08-01 13:38:23 +00:00
<li v-if="book.pubdate"><strong>Date de publication</strong> {{ .Pubdate }}</li>
<li v-if="book.publisher"><strong>Editeur</strong> {{ .Publisher }}</li>
2017-07-30 16:09:27 +00:00
</ul>
</div>
2017-08-01 18:00:20 +00:00
{{ else }}
<div class="alert alert-danger" role="alert">Aucun livre sélectionné</div>
{{ end }}
2017-07-30 16:09:27 +00:00
</div>
{{ template "footer.html" . }}