This repository has been archived on 2025-03-01. You can view files and clone it, but cannot push or open issues or pull requests.
trantor/templates/index.html
Las Zenow 93bd567f8d Change the paths stored on the database
The paths in the database now are relative of the config BOOKS_PATH and COVER_PATH

For updating the database this query should be use:
for (var i = db.books.find(); i.hasNext(); ) {
        var book = i.next();
        db.books.update({_id: book["_id"]}, {$set: {path: book["path"].slice(6), cover: book["cover"].slice(7), coversmall: book["coversmall"].slice(7)}});
}
2012-10-28 20:21:46 +01:00

71 lines
1.6 KiB
HTML

{{template "header.html" .S}}
<div class="row">
<div class="span8">
<h4>Last books added:</h4>
</div>
<div class="span4">
<p class="pull-right">{{.Count}} books</p>
</div>
</div>
<ul class="row thumbnails">
{{with .Books}}
{{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="/cover/{{.CoverSmall}}" alt="{{.Title}}" /></div>{{end}}
<p><strong>{{.Title}}</strong></p>
</a>
</div>
</li>
{{end}}
{{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="/cover/{{.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="/cover/{{.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>
{{template "footer.html"}}