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

79 lines
2.4 KiB
HTML

{{template "header.html" .S}}
{{with .Book}}
<div class="row">
{{if .Cover}}
<div class="span4">
<img src="/cover/{{.Cover}}" alt="{{.Title}}" class="pull-right" />
</div>
{{end}}
<div class="span8">
<form class="form-horizontal" method="POST" action="/save/{{.Id}}">
<fieldset>
<div class="control-group">
<label class="control-label" for="title">Title</label>
<div class="controls">
<input class="input-xlarge" type="text" id="title" value="{{.Title}}" name="title">
</div>
</div>
</fieldset>
<fieldset>
<div class="control-group">
<label class="control-label" for="author">Author</label>
<div class="controls">
{{range .Author}}
<input class="input-xlarge" type="text" id="author" value="{{.}}" name="author">
{{end}}
<input class="input-xlarge" type="text" id="author" placeholder="Add author" name="author">
</div>
</div>
<div class="control-group">
<label class="control-label" for="publisher">Publisher</label>
<div class="controls">
<input class="input-xlarge" type="text" id="publisher" value="{{.Publisher}}" name="publisher">
</div>
</div>
<div class="control-group">
<label class="control-label" for="tags">Tags</label>
<div class="controls">
{{range .Subject}}
<input class="input-xlarge" type="text" id="tags" value="{{.}}" name="subject">
{{end}}
<input class="input-xlarge" type="text" id="tags" placeholder="Add tags" name="subject">
</div>
</div>
<div class="control-group">
<label class="control-label" for="date">Date</label>
<div class="controls">
<input class="input-xlarge" type="text" id="date" value="{{.Date}}" name="date">
</div>
</div>
<div class="control-group">
<label class="control-label" for="langs">Langs</label>
<div class="controls">
{{range .Lang}}
<input class="input-xlarge" type="text" id="langs" value="{{.}}" name="lang">
{{end}}
<input class="input-xlarge" type="text" id="langs" placeholder="Add langs" name="lang">
</div>
</div>
</fieldset>
<fieldset>
<div class="control-group">
<label class="control-label" for="description">Description</label>
<div class="controls">
<textarea class="input-xlarge" id="description" rows="5" name="description">{{.Description}}</textarea>
</div>
</div>
<div class="form-actions">
<button type="submit" class="btn btn-primary">Save</button>
<a href="/book/{{.Id}}" class="btn">Cancel</a>
</div>
</fieldset>
</form>
</div>
</div>
{{end}}
{{template "footer.html"}}