Displaying most viewed and downloaded books on the front page

This commit is contained in:
Las Zenow 2012-10-24 23:22:39 +02:00
parent d87351d946
commit cd9b518284
3 changed files with 69 additions and 1 deletions

View file

@ -2,7 +2,7 @@
<div class="row">
<div class="span8">
<p>Last books added:</p>
<h4>Last books added:</h4>
</div>
<div class="span4">
<p class="pull-right">{{.Count}} books</p>
@ -24,6 +24,46 @@
{{end}}
</ul>
<div class="row">
<div class="span8">
<h4>Most visited books:</h4>
</div>
</div>
<ul class="row thumbnails">
{{with .VisitedBooks}}
{{range .}}
<li class="span2">
<div class="thumbnail centered" style="border:none;">
<a href="/book/{{.Id}}">
{{if .CoverSmall}}<div class="down"><img class="img-rounded" src="{{.CoverSmall}}" alt="{{.Title}}" /></div>{{end}}
<p><strong>{{.Title}}</strong></p>
</a>
</div>
</li>
{{end}}
{{end}}
</ul>
<div class="row">
<div class="span8">
<h4>Most downloaded books:</h4>
</div>
</div>
<ul class="row thumbnails">
{{with .DownloadedBooks}}
{{range .}}
<li class="span2">
<div class="thumbnail centered" style="border:none;">
<a href="/book/{{.Id}}">
{{if .CoverSmall}}<div class="down"><img class="img-rounded" src="{{.CoverSmall}}" alt="{{.Title}}" /></div>{{end}}
<p><strong>{{.Title}}</strong></p>
</a>
</div>
</li>
{{end}}
{{end}}
</ul>
<div class="row">
<p class="centered">{{range .Tags}}<a class="label" href="/search/?q=subject:{{.}}">{{.}}</a> {{end}}</p>
</div>