go-bouquins/templates/book.html
2017-08-01 20:00:20 +02:00

76 lines
2.0 KiB
HTML

{{ template "header.html" . }}
<div class="container" id="app">
{{ if .Id }}
<div class="page-header">
{{ if .Has_cover }}
<div class="row">
<img :src="bookCover(book)" alt="Pas de couverture" title="Couverture" class="img-responsive img-rounded"/>
</div>
{{ end }}
<div class="row">
<div class="col-xs-12 col-md-9">
<h1>
<span class="glyphicon glyphicon-book"></span>
{{ .Title }}
</h1>
</div>
{{ if gt (len .Data) 0 }}
<div class="col-xs-12 col-md-3 text-right">
{{ range .Data }}
<a :href="bookLink(book, data)" class="btn btn-success">
<span class="glyphicon glyphicon-download-alt"></span> Télécharger
{{ .Format }} ({{ .Size }})
</a>
{{ end }}
</div>
{{ end }}
</div>
</div>
<div class="row">
<h2>
<span class="glyphicon glyphicon-user"></span> Auteur{{ if gt (len .Authors) 1 }}s{{ end }}
</h2>
<ul>
{{ range .Authors }}
<li>
<a href="/authors/{{.Id}}">{{ .Name }}</a>
</li>
{{ end }}
</ul>
{{ if .Series }}
<h2>
<span class="glyphicon glyphicon-list"></span> Serie
</h2>
<div>
<a href="/series/{{ .Series.Id }}">{{ .Series.Name }}</a>
<span class="badge">{{ .SeriesIndex }}</span>
</div>
{{ end }}
<h2><span class="glyphicon glyphicon-globe"></span> Langue</h2>
<ul><li>{{ .Lang }}</li></ul>
{{ if gt (len .Tags) 0 }}
<h2>
<span class="glyphicon glyphicon-tags"></span> Tags
</h2>
<div v-if="book.tags">
{{ range .Tags }}
<span class="label label-info">{{ . }}</span>&nbsp;
{{ end }}
</div>
{{ end }}
<h2>Détails</h2>
<ul>
<li v-if="book.pubdate"><strong>Date de publication</strong> {{ .Pubdate }}</li>
<li v-if="book.publisher"><strong>Editeur</strong> {{ .Publisher }}</li>
</ul>
</div>
{{ else }}
<div class="alert alert-danger" role="alert">Aucun livre sélectionné</div>
{{ end }}
</div>
{{ template "footer.html" . }}