go-bouquins/templates/author.html

62 lines
1.9 KiB
HTML
Raw Normal View History

2017-07-30 16:09:27 +00:00
{{ template "header.html" . }}
<div class="container" id="app">
2017-08-03 18:36:46 +00:00
{{ if .Id }}
<div class="page-header">
2017-07-30 16:09:27 +00:00
<h1>
<span class="glyphicon glyphicon-user"></span>
2017-08-03 18:36:46 +00:00
{{ .Name }}
2017-07-30 16:09:27 +00:00
</h1>
</div>
<ul class="nav nav-pills">
<li role="presentation" :class="{ active: tab == 'books' }"><a href="#" @click="showBooks">Livres</a></li>
2017-08-03 18:36:46 +00:00
{{/* if gt (len .Series) 0 */}}
<li role="presentation" :class="{ active: tab == 'series' }"><a href="#" @click="showSeries">Series</a></li>
{{/* end */}}
{{/* if gt (len .Authors) 0 */}}
<li role="presentation" :class="{ active: tab == 'authors' }"><a href="#" @click="showAuthors">Co-auteurs</a></li>
{{/* end */}}
2017-07-30 16:09:27 +00:00
</ul>
<div class="panel panel-default" :class="{ hidden: tab != 'books' }">
<div class="panel-body">
2017-08-03 18:36:46 +00:00
{{ range .Books }}
<ul class="list-unstyled">
2017-07-30 16:09:27 +00:00
<li><span class="glyphicon glyphicon-book"></span>
2017-08-03 18:36:46 +00:00
<a href="/books/{{ .Id }}">{{ .Title }}</a>
2017-07-30 16:09:27 +00:00
</li>
2017-07-30 13:39:20 +00:00
</ul>
2017-08-03 18:36:46 +00:00
{{ end }}
2017-07-30 13:39:20 +00:00
</div>
2017-07-30 16:09:27 +00:00
</div>
<div class="panel panel-default" :class="{ hidden: tab != 'series' }">
<div class="panel-body">
2017-08-03 18:36:46 +00:00
{{ range .Books }}
{{/* FIXME unicity */}}
{{ with .Series }}
<ul class="list-unstyled">
2017-07-30 16:09:27 +00:00
<li><span class="glyphicon glyphicon-list"></span>
2017-08-03 18:36:46 +00:00
<a href="/series/{{ .Id }}">{{ .Name }}</a>
2017-07-30 16:09:27 +00:00
</li>
</ul>
2017-08-03 18:36:46 +00:00
{{ end }}
{{ end }}
2017-07-30 16:09:27 +00:00
</div>
</div>
<div class="panel panel-default" :class="{ hidden: tab != 'authors' }">
<div class="panel-body">
2017-08-03 18:36:46 +00:00
{{ range .Books }}
{{ range .Authors }}
<ul class="list-unstyled">
2017-07-30 16:09:27 +00:00
<li> <span class="glyphicon glyphicon-user"></span>
2017-08-03 18:36:46 +00:00
<a href="/authors/{{ .Id }}">{{ .Name }}</a>
2017-07-30 16:09:27 +00:00
</li>
</ul>
2017-08-03 18:36:46 +00:00
{{ end }}
{{ end }}
2017-07-30 16:09:27 +00:00
</div>
</div>
2017-08-03 18:36:46 +00:00
{{ else }}
<div class="alert alert-danger" role="alert">Aucun auteur sélectionné</div>
{{ end }}
2017-07-30 16:09:27 +00:00
</div>
{{ template "footer.html" . }}