go-bouquins/assets/html/index.html
2017-07-30 20:17:18 +02:00

121 lines
5.2 KiB
HTML

<!DOCTYPE html>
<html lang="fr">
<head>
<title>Bouquins</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta charset="utf-8" />
<link rel="stylesheet" href="/css/bootstrap.min.css">
<link rel="preload" href="/js/index.min.js" as="script">
<link rel="preload" href="/js/vue.min.js" as="script">
<link rel="prefetch" href="/js/index.min.js">
<link rel="prefetch" href="/js/vue.min.js">
</head>
<body>
<nav class="navbar navbar-inverse" id="nav">
<div class="container">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Accueil</a></li>
<li><a href="search.html">Recherche</a></li>
<li><a href="#">A propos</a></li>
</ul>
<form class="navbar-form navbar-right" role="search" method="get" action="search.html">
<div class="form-group">
<input name="q" type="text" class="form-control" placeholder="Recherche">
</div>
</form>
</div>
</nav>
<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" v-if="books.length > 0 || authors.length > 0 || series.length > 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">&larr;</span> Précédents</a></li>
<li class="next"><a href="#" @click="nextPage">Suivants <span aria-hidden="true">&rarr;</span></a></li>
</ul>
</nav>
<table class="table table-striped" v-if="series.length > 0">
<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">
<td>
<span class="glyphicon glyphicon-list"></span>
<a :href="'series.html?id='+serie.id">{{ serie.name }}</a>
</td>
<td>{{ serie.count }}</td>
<td>
<template v-for="author in serie.authors">
<span class="glyphicon glyphicon-user"></span>
<a :href="'author.html?id='+author.id">{{ author.name }}</a>&nbsp;
</template>
</td>
</tr>
</table>
<table class="table table-striped" v-if="authors.length > 0">
<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>
<a :href="'author.html?id='+author.id">{{ author.name }}</a>
</td>
<td>{{ author.count }}</td>
</tr>
</table>
<table class="table table-striped" v-if="books.length > 0">
<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>
<tr v-for="book in books">
<td><span class="glyphicon glyphicon-book"></span>
<a :href="'book.html?id='+book.id">{{ book.title }}</a></td>
<td>
<template v-for="author in book.authors">
<span class="glyphicon glyphicon-user"></span>
<a :href="'author.html?id='+author.id">{{ author.name }}</a>
</template>
</td>
<td>
<template v-if="book.series">
<span class="glyphicon glyphicon-list"></span>
<a :href="'series.html?id='+book.series.id">{{ book.series.name }}</a>
<span class="badge">{{ book.series ? book.series.idx : '' }}</span>
</template>
</td>
</tr>
</table>
<nav aria-label="Pages">
<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>
<li class="next"><a href="#" @click="nextPage">Suivants <span aria-hidden="true">&rarr;</span></a></li>
</ul>
</nav>
</div>
</div>
<script src="js/vue.min.js"></script>
<script src="js/index.min.js"></script>
</body>
</html>