2017-07-30 16:09:27 +00:00
|
|
|
{{ template "header.html" . }}
|
|
|
|
<div class="container" id="app">
|
|
|
|
<div class="jumbotron">
|
|
|
|
<h1>Bouquins</h1>
|
|
|
|
<p>Cette bibliothèque contient actuellement <strong>{{ .BooksCount }}</strong> livres et BD en format papier ou électronique.</p>
|
|
|
|
<button class="btn btn-primary" type="button" @click="showBooks">Livres</button>
|
|
|
|
<button class="btn btn-primary" type="button" @click="showAuthors">Auteurs</button>
|
|
|
|
<button class="btn btn-primary" type="button" @click="showSeries">Series</button>
|
|
|
|
</div>
|
|
|
|
<div class="table-responsive">
|
|
|
|
{{ if (ne (len .Books) 0) or (ne (len .Authors) 0) or (ne (len .Series) 0) }}
|
|
|
|
<nav aria-label="Pages">
|
|
|
|
<ul class="pager">
|
|
|
|
<li class="previous" v-bind:class="{ disabled: page <= 1 }"><a href="#" @click="prevPage"><span aria-hidden="true">←</span> Précédents</a></li>
|
|
|
|
<li class="next"><a href="#" @click="nextPage">Suivants <span aria-hidden="true">→</span></a></li>
|
|
|
|
</ul>
|
2017-07-30 13:39:20 +00:00
|
|
|
</nav>
|
2017-07-30 16:09:27 +00:00
|
|
|
{{ end }}
|
|
|
|
{{ if .Series }}
|
|
|
|
<table class="table table-striped">
|
|
|
|
<tr>
|
|
|
|
<th>
|
|
|
|
<a href="#" @click="sortBy('name')">Nom</a>
|
|
|
|
<span v-if="sort_by == 'name'" :class="['glyphicon', { 'glyphicon-chevron-up': order_desc , 'glyphicon-chevron-down': !order_desc}]"></span>
|
|
|
|
</th>
|
|
|
|
<th>Livre(s)</th>
|
|
|
|
<th>Auteur(s)</th>
|
|
|
|
</tr>
|
|
|
|
<tr v-for="serie in series">
|
|
|
|
{{ range .Series }}
|
|
|
|
<td>
|
|
|
|
<span class="glyphicon glyphicon-list"></span>
|
|
|
|
<a href="/series?id={{ .Id }}">{{ .Name }}</a>
|
|
|
|
</td>
|
|
|
|
<td>{{ .Count }}</td>
|
|
|
|
<td>
|
|
|
|
{{ range .Authors }}
|
|
|
|
<span class="glyphicon glyphicon-user"></span>
|
2017-07-30 18:14:20 +00:00
|
|
|
<a href="/authors?id={{ .Id }}">{{ .Name }}</a>
|
2017-07-30 16:09:27 +00:00
|
|
|
{{ end }}
|
|
|
|
</td>
|
2017-07-30 15:20:48 +00:00
|
|
|
{{ end }}
|
2017-07-30 16:09:27 +00:00
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
{{ end }}
|
|
|
|
{{ if .Authors }}
|
|
|
|
<table class="table table-striped">
|
|
|
|
<tr>
|
|
|
|
<th>
|
|
|
|
<a href="#" @click="sortBy('name')">Nom</a>
|
|
|
|
<span v-if="sort_by == 'name'" :class="['glyphicon', { 'glyphicon-chevron-up': order_desc , 'glyphicon-chevron-down': !order_desc}]"></span>
|
|
|
|
</th>
|
|
|
|
<th>Livre(s)</th>
|
|
|
|
</tr>
|
|
|
|
<tr v-for="author in authors">
|
|
|
|
<td>
|
|
|
|
<span class="glyphicon glyphicon-user"></span>
|
2017-07-30 18:14:20 +00:00
|
|
|
<a href="'author.html?id='+author.id">{{ .Author.Name }}</a>
|
2017-07-30 16:09:27 +00:00
|
|
|
</td>
|
|
|
|
<td>{{ .Author.Count }}</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
{{ end }}
|
2017-07-30 18:14:20 +00:00
|
|
|
{{ if ne (len .Books) 0 }}
|
2017-07-30 16:09:27 +00:00
|
|
|
<table class="table table-striped">
|
|
|
|
<tr>
|
|
|
|
<th>
|
|
|
|
<a href="#" @click="sortBy('title')">Nom</a>
|
|
|
|
<span v-if="sort_by == 'title'" :class="['glyphicon', { 'glyphicon-chevron-up': order_desc , 'glyphicon-chevron-down': !order_desc}]"></span>
|
|
|
|
</th>
|
|
|
|
<th>Auteur(s)</th>
|
|
|
|
<th>Serie</th>
|
|
|
|
</tr>
|
2017-07-30 18:14:20 +00:00
|
|
|
{{ range .Books }}
|
|
|
|
<tr>
|
2017-07-30 16:09:27 +00:00
|
|
|
<td><span class="glyphicon glyphicon-book"></span>
|
2017-07-30 18:14:20 +00:00
|
|
|
<a href="/books?id={{ .Id }}">{{ .Title }}</a></td>
|
2017-07-30 16:09:27 +00:00
|
|
|
<td>
|
2017-07-30 18:14:20 +00:00
|
|
|
{{ range .Authors }}
|
2017-07-30 16:09:27 +00:00
|
|
|
<span class="glyphicon glyphicon-user"></span>
|
2017-07-30 18:14:20 +00:00
|
|
|
<a href="/authors?id={{ .Id }}">{{ .Name }}</a>
|
|
|
|
{{ end }}
|
2017-07-30 16:09:27 +00:00
|
|
|
</td>
|
|
|
|
<td>
|
2017-07-30 18:14:20 +00:00
|
|
|
{{ if .Series }}
|
|
|
|
<span class="glyphicon glyphicon-list"></span>
|
|
|
|
<a href="/series?id={{ .Series.Id }}">{{ .Series.Name }}</a>
|
|
|
|
<span class="badge">{{ .Book.SeriesIndex }}</span>
|
|
|
|
{{ end }}
|
2017-07-30 16:09:27 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
2017-07-30 18:14:20 +00:00
|
|
|
{{ end }}
|
2017-07-30 16:09:27 +00:00
|
|
|
</table>
|
|
|
|
{{ end }}
|
|
|
|
{{ if (ne (len .Books) 0) or (ne (len .Authors) 0) or (ne (len .Series) 0) }}
|
|
|
|
<nav aria-label="Pages">
|
|
|
|
<ul class="pager">
|
|
|
|
<li class="previous" v-bind:class="{ disabled: page <= 1 }"><a href="#" @click="prevPage"><span aria-hidden="true">←</span> Précédents</a></li>
|
|
|
|
<li class="next"><a href="#" @click="nextPage">Suivants <span aria-hidden="true">→</span></a></li>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
{{ end }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{ template "footer.html" . }}
|