Added edit page to books
This commit is contained in:
parent
e68f41445e
commit
a0d4acdf89
5 changed files with 176 additions and 9 deletions
79
templates/edit.html
Normal file
79
templates/edit.html
Normal file
|
@ -0,0 +1,79 @@
|
|||
{{template "header.html" .S}}
|
||||
|
||||
{{with .Book}}
|
||||
<div class="row">
|
||||
{{if .Cover}}
|
||||
<div class="span4">
|
||||
<img src="{{.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 style="height:28px;" 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 style="height:28px;" class="input-xlarge" type="text" id="author" value="{{.}}" name="author">
|
||||
{{end}}
|
||||
<input style="height:28px;" 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 style="height:28px;" 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 style="height:28px;" class="input-xlarge" type="text" id="tags" value="{{.}}" name="subject">
|
||||
{{end}}
|
||||
<input style="height:28px;" 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 style="height:28px;" 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 style="height:28px;" class="input-xlarge" type="text" id="langs" value="{{.}}" name="lang">
|
||||
{{end}}
|
||||
<input style="height:28px;" 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/{{.Title}}" class="btn">Cancel</a>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{template "footer.html"}}
|
Reference in a new issue