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/book.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

74 lines
2.2 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{{template "header.html" .S}}
{{$user := .S.User}}
{{with .Book}}
<script>
function delBook(){
var div = document.getElementById('delete');
div.innerHTML =
'<div class="alert alert-error fade in"> \
<a class="close" data-dismiss="alert">×</a> \
<h4 class="alert-heading">Do you really want to delete it?</h4> \
<p>Remove a book is permanent, you won\'t be able to get it back</p> \
<a class="btn btn-danger" href="/delete/{{.Id}}">Remove it</a> \
<a class="btn" href="#" data-dismiss="alert">Cancel</a> \
</div>';
}
</script>
<div id="delete"></div>
<header class="row">
<div class="span8 offset4">
<h1>{{.Title}}</h1>
</div>
</header>
<div class="row">
{{if .Cover}}
<div class="span4">
<img src="/cover/{{.Cover}}" alt="{{.Title}}" class="pull-right" />
</div>
{{end}}
<div class="span8">
<div class="row"><p></p></div>
<div class="row">
<div class="span5">
<dl class="dl-horizontal">
{{if .Author}}<dt>Author</dt> <dd>{{range .Author}}<a href="/search/?q=author:{{.}}">{{.}}</a>, {{end}}</dd>{{end}}
{{if .Publisher}}<dt>Publisher</dt> <dd><a href="/search/?q=publisher:{{.Publisher}}">{{.Publisher}}</a></dd>{{end}}
{{if .Subject}}<dt>Tags</dt> <dd>{{range .Subject}}<a href="/search/?q=subject:{{.}}">{{.}}</a>, {{end}}</dd>{{end}}
{{if .Date}}<dt>Date</dt> <dd>{{.Date}}</dd>{{end}}
{{if .Lang}}<dt>Lang</dt> <dd>{{range .Lang}}<a href="/search/?q=lang:{{.}}">{{.}}</a> {{end}}</dd>{{end}}
</dl>
</div>
<div class="span3">
{{if $user}}
<div class="row">
<div class="btn-group pull-right">
<a href="/edit/{{.Id}}" class="btn btn-primary"><i class="icon-pencil"></i> Edit</a>
<a href="#" onClick="delBook();" class="btn btn-danger"><i class="icon-trash"></i> Delete</a>
</div>
</div>
<div class="row"><p></p></div>
{{end}}
<div class="row">
<div class="btn-group pull-right">
<a href="/books/{{.Path}}" class="btn btn-large btn-inverse"><i class="icon-download-alt icon-white"></i> download</a>
<a href="/read/{{.Id}}" class="btn btn-large btn-warning"><i class="icon-eye-open icon-white"></i> read it!</a>
</div>
</div>
</div>
</div>
<div class="row">
{{if .Description}}
<div class="span8">
<p>{{.Description}}</p>
</div>
{{end}}
</div>
</div>
</div>
{{end}}
{{template "footer.html"}}