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

44 lines
1.8 KiB
HTML

{{ template "header.html" . }}
<div class="container" id="app">
<div class="page-header" v-if="author.id">
<h1>
<span class="glyphicon glyphicon-user"></span>
{{ .Author.Name }}
</h1>
</div>
<div class="alert alert-danger" role="alert" v-else>Aucun livre sélectionné</div>
<ul class="nav nav-pills">
<li role="presentation" :class="{ active: tab == 'books' }"><a href="#" @click="showBooks">Livres</a></li>
<li v-if="author.series && author.series.length > 0" role="presentation" :class="{ active: tab == 'series' }"><a href="#" @click="showSeries">Series</a></li>
<li v-if="author.authors && author.authors.length > 0"role="presentation" :class="{ active: tab == 'authors' }"><a href="#" @click="showAuthors">Co-auteurs</a></li>
</ul>
<div class="panel panel-default" :class="{ hidden: tab != 'books' }">
<div class="panel-body">
<ul v-for="book in author.books" class="list-unstyled">
<li><span class="glyphicon glyphicon-book"></span>
<a :href="'book.html?id='+book.id">{{ .Book.Title }}</a>
</li>
</ul>
</div>
</div>
<div class="panel panel-default" :class="{ hidden: tab != 'series' }">
<div class="panel-body">
<ul v-for="series in author.series" class="list-unstyled">
<li><span class="glyphicon glyphicon-list"></span>
<a :href="'series.html?id='+series.id">{{ .Series.Name }}</a>
</li>
</ul>
</div>
</div>
<div class="panel panel-default" :class="{ hidden: tab != 'authors' }">
<div class="panel-body">
<ul v-for="coauthor in author.authors" class="list-unstyled">
<li> <span class="glyphicon glyphicon-user"></span>
<a :href="'author.html?id='+coauthor.id">{{ .Coauthor.Name }}</a>
</li>
</ul>
</div>
</div>
</div>
{{ template "footer.html" . }}