import other kontor repos into directories
This commit is contained in:
committed by
Thomas Peetz
parent
28746adfbb
commit
b424e95e05
@@ -0,0 +1,24 @@
|
||||
package library
|
||||
|
||||
import (
|
||||
"gitlab.thpeetz.de/kontor/kontor-go/pkg/dao"
|
||||
"gitlab.thpeetz.de/kontor/kontor-go/pkg/util"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func showAuthorList(c *gin.Context) {
|
||||
var authorDao = AuthorDAO{Db: dao.KontorDb}
|
||||
if authors, err := authorDao.FindAll(); err == nil {
|
||||
util.Render(c, gin.H{"title": "Author List", "payload": authors}, "library/authors.html")
|
||||
}
|
||||
}
|
||||
|
||||
func showBookList(c *gin.Context) {
|
||||
var bookDao = BookDAO{Db: dao.KontorDb}
|
||||
if books, err := bookDao.FindAll(); err == nil {
|
||||
util.Render(c, gin.H{"title": "Book List", "payload": books}, "library/books.html")
|
||||
} else {
|
||||
util.Render(c, gin.H{"title": "Kontor", "payload": nil}, "kontor/index.html")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user