43 lines
2.0 KiB
HTML
43 lines
2.0 KiB
HTML
{{ template "header.html" . }}
|
|
<div class="container" id="index">
|
|
<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">
|
|
<paginate v-on:next="updatePage(1)" v-on:prev="updatePage(-1)" :page="page" :more="more"></paginate>
|
|
<results :results="results" :cols="cols" :sort_by="sort_by" :order_desc="order_desc"></results>
|
|
<paginate :page="page"></paginate>
|
|
</div>
|
|
</div>
|
|
<script type="text/x-template" id="results-template">
|
|
<table class="table table-striped" v-if="results.length > 0">
|
|
<tbody>
|
|
<tr>
|
|
<th v-for="col in cols">
|
|
<template v-if="col.sortable">
|
|
<a href="#" @click="sortBy(col.sortId)">{{ "{{" }}col.name{{ "}}" }}</a>
|
|
<span v-if="sort_by == col.id" :class="['glyphicon', { 'glyphicon-chevron-up': order_desc , 'glyphicon-chevron-down': !order_desc}]"></span>
|
|
</template>
|
|
<template v-else>{{ "{{" }}col.name{{ "}}" }}</template>
|
|
</th>
|
|
</tr>
|
|
<tr v-for="item in results">
|
|
<td is="result-cell" :col="col" :item="item" v-for="col in cols"></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</script>
|
|
<script type="text/x-template" id="paginate-template">
|
|
<nav aria-label="Pages" v-if="page > 0">
|
|
<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" v-bind:class="{ disabled: !more }"><a href="#" @click="nextPage">Suivants <span aria-hidden="true">→</span></a></li>
|
|
</ul>
|
|
</nav>
|
|
</script>
|
|
{{ template "footer.html" . }}
|