import sources from develop/0.1.0

This commit is contained in:
Thomas Peetz
2025-04-29 12:52:55 +02:00
committed by Thomas Peetz
parent c30bdd1cd5
commit 19a5623075
670 changed files with 35977 additions and 0 deletions
+24
View File
@@ -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")
}
}