Add ISBN to the metadata editor

This commit is contained in:
Las Zenow 2017-01-31 10:45:28 +00:00
parent 0f627dcd53
commit fcf9b1eb8d
2 changed files with 9 additions and 0 deletions

View file

@ -9,6 +9,7 @@ import (
"github.com/gorilla/mux"
"gitlab.com/trantor/trantor/lib/database"
"gitlab.com/trantor/trantor/lib/parser"
)
const (
@ -94,6 +95,7 @@ func saveHandler(h handler) {
description := h.r.FormValue("description")
author := cleanEmptyStr(h.r.Form["author"])
subject := cleanEmptyStr(h.r.Form["subject"])
isbn := parser.ISBN(h.r.FormValue("isbn")) // XXX: check for errors
lang := cleanEmptyStr(h.r.Form["lang"])
book := map[string]interface{}{"title": title,
"publisher": publisher,
@ -101,6 +103,7 @@ func saveHandler(h handler) {
"description": description,
"author": author,
"subject": subject,
"isbn": isbn,
"lang": lang}
err := h.db.UpdateBook(id, book)
if err != nil {

View file

@ -43,6 +43,12 @@
<input class="input-xlarge" type="text" id="tags" placeholder="Add tags" name="subject">
</div>
</div>
<div class="control-group">
<label class="control-label" for="tags">ISBN</label>
<div class="controls">
<input class="input-xlarge" type="text" id="tags" value="{{.Isbn}}" name="isbn">
</div>
</div>
<div class="control-group">
<label class="control-label" for="date">Date</label>
<div class="controls">