go-bouquins/templates/index.html

43 lines
1.9 KiB
HTML
Raw Normal View History

2017-07-30 16:09:27 +00:00
{{ template "header.html" . }}
2017-08-05 10:16:28 +00:00
<div class="container" id="index">
<div class="jumbotron">
2017-07-30 16:09:27 +00:00
<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">
2017-08-05 18:06:11 +00:00
<paginate :page="page" :more="more"></paginate>
2017-08-05 14:44:05 +00:00
<results :results="results" :cols="cols" :sort_by="sort_by" :order_desc="order_desc"></results>
2017-08-05 18:06:11 +00:00
<paginate :page="page" :more="more"></paginate>
2017-07-30 16:09:27 +00:00
</div>
</div>
2017-08-05 10:16:28 +00:00
<script type="text/x-template" id="results-template">
<table class="table table-striped" v-if="results.length > 0">
2017-08-05 14:44:05 +00:00
<tbody>
<tr>
<th v-for="col in cols">
2017-08-05 18:11:15 +00:00
<template v-if="col.sort">
<a href="#" @click="sortBy(col.sort)">{{ "{{" }}col.name{{ "}}" }}</a>
2017-08-05 14:44:05 +00:00
<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>
2017-08-05 10:16:28 +00:00
</table>
</script>
<script type="text/x-template" id="paginate-template">
2017-08-05 14:44:05 +00:00
<nav aria-label="Pages" v-if="page > 0">
2017-08-05 10:16:28 +00:00
<ul class="pager">
<li class="previous" v-bind:class="{ disabled: page <= 1 }"><a href="#" @click="prevPage"><span aria-hidden="true">&larr;</span> Précédents</a></li>
2017-08-05 17:40:58 +00:00
<li class="next" v-bind:class="{ disabled: !more }"><a href="#" @click="nextPage">Suivants <span aria-hidden="true">&rarr;</span></a></li>
2017-08-05 10:16:28 +00:00
</ul>
</nav>
</script>
2017-07-30 16:09:27 +00:00
{{ template "footer.html" . }}