Add comments to submissions
This commit is contained in:
parent
8d126fbe7a
commit
8bcff3c826
8 changed files with 97 additions and 30 deletions
|
@ -148,6 +148,7 @@ func saveHandler(h handler) {
|
|||
type newBook struct {
|
||||
TitleFound int
|
||||
AuthorFound int
|
||||
Comment string
|
||||
B database.Book
|
||||
}
|
||||
type newData struct {
|
||||
|
@ -194,6 +195,10 @@ func newHandler(h handler) {
|
|||
data.Books[i].B = b
|
||||
_, data.Books[i].TitleFound, _ = h.db.GetBooks("title:"+b.Title, 1, 0)
|
||||
_, data.Books[i].AuthorFound, _ = h.db.GetBooks("author:"+strings.Join(b.Authors, " author:"), 1, 0)
|
||||
data.Books[i].Comment, err = h.db.GetComment(b.ID)
|
||||
if err != nil {
|
||||
log.Error("Error getting comment for ", b.Title, " (", b.ID, "): ", err)
|
||||
}
|
||||
}
|
||||
data.Page = page + 1
|
||||
if num > (page+1)*newItemsPage {
|
||||
|
|
Reference in a new issue