65 lines
2.6 KiB
HTML
65 lines
2.6 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>
|
|
<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">Authors</button>
|
|
</div>
|
|
<div class="table-responsive" v-if="books.length > 0 || authors.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">←</span> Précédents</a></li>
|
|
<li class="next"><a href="#" @click="nextPage">Suivants <span aria-hidden="true">→</span></a></li>
|
|
</ul>
|
|
</nav>
|
|
<table class="table table-striped" v-if="authors.length > 0">
|
|
<tr>
|
|
<th>Id</th>
|
|
<th>Nom</th>
|
|
</tr>
|
|
<tr v-for="author in authors">
|
|
<td>{{ author.id }}</td>
|
|
<td>{{ author.name }}</td>
|
|
</tr>
|
|
</table>
|
|
<table class="table table-striped" v-if="books.length > 0">
|
|
<tr>
|
|
<th>Titre</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>{{ author.name }}
|
|
</template>
|
|
</td>
|
|
<td>
|
|
<template v-if="book.series">
|
|
<span class="glyphicon glyphicon-list"></span>{{ book.series ? book.series.name : '' }}
|
|
<span class="badge">{{ book.series ? book.series.idx : '' }}</span>
|
|
</template>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<script src="js/vue.min.js"></script>
|
|
<script src="js/index.min.js"></script>
|
|
</body>
|
|
</html>
|