diff --git a/kontor-gin/Containerfile b/kontor-gin/Containerfile
index e64f5b7..65160b3 100644
--- a/kontor-gin/Containerfile
+++ b/kontor-gin/Containerfile
@@ -22,6 +22,6 @@ RUN apk add --no-cache ca-certificates tzdata curl
COPY --from=builder /app/kontor-gin /app/kontor-gin
COPY --from=builder /app/templates /app/templates
COPY --from=builder /app/assets /app/assets
-ENV DB_HOST=postgres DB_USER=kontor DB_PASSWORD=kontor DB_NAME=kontor DB_PORT=5432 GIN_MODE=release
+ENV GIN_MODE=release
# Set the entrypoint command
ENTRYPOINT ["/app/kontor-gin"]
diff --git a/kontor-gin/assets/assets.go b/kontor-gin/assets/assets.go
index 5950723..c147543 100644
--- a/kontor-gin/assets/assets.go
+++ b/kontor-gin/assets/assets.go
@@ -4,5 +4,5 @@ import (
"embed"
)
-//go:embed style/*
+//go:embed style/* icons/*
var StaticFiles embed.FS
diff --git a/kontor-gin/assets/cross.png b/kontor-gin/assets/icons/cross.png
similarity index 100%
rename from kontor-gin/assets/cross.png
rename to kontor-gin/assets/icons/cross.png
diff --git a/kontor-gin/assets/logo.png b/kontor-gin/assets/icons/logo.png
similarity index 100%
rename from kontor-gin/assets/logo.png
rename to kontor-gin/assets/icons/logo.png
diff --git a/kontor-gin/assets/tick.png b/kontor-gin/assets/icons/tick.png
similarity index 100%
rename from kontor-gin/assets/tick.png
rename to kontor-gin/assets/icons/tick.png
diff --git a/kontor-gin/assets/main.css b/kontor-gin/assets/main.css
deleted file mode 100644
index 8b5c0c3..0000000
--- a/kontor-gin/assets/main.css
+++ /dev/null
@@ -1,172 +0,0 @@
-* {
- box-sizing: border-box;
-}
-
-body {
- font-family: Arial;
- padding: 10px;
- background: lightgrey;
-}
-
-/* Header/Blog Title */
-.header {
- padding: 30px;
- text-align: center;
- background-color: lightblue;
-}
-
-.header h1 {
- font-size: 50px;
-}
-
-/* Style the top navigation bar */
-.topnav {
- overflow: hidden;
- background-color: darkgrey;
-}
-
-/* Style the topnav links */
-.topnav a {
- float: left;
- display: block;
- color: #f2f2f2;
- text-align: center;
- padding: 14px 16px;
- text-decoration: none;
-}
-
-/* Change color on hover */
-.topnav a:hover {
- background-color: #ddd;
- color: black;
-}
-
-.subnav {
- overflow: hidden;
- background-color: grey;
-}
-
-.subnav a {
- float: left;
- display: block;
- color: #f2f2f2;
- text-align: center;
- padding: 14px 16px;
- text-decoration: none;
-}
-
-.form-inline {
- display: flex;
- flex-flow: row wrap;
- align-items: center;
- padding-top: 10px;
- padding-left: 20px;
-}
-
-.form-inline label {
- margin: 5px 10px 5px 0;
-}
-
-.form-inline input {
- padding-right: 50px;
- margin-right: 10px;
-}
-
-.form-inline button {
- padding: 10px 20px;
- background-color: dodgerblue;
- border: 1px solid #ddd;
- color: white;
- border-radius: 10px;
-}
-
-.form-inline button:hover {
- background-color: royalblue;
-}
-
-.pill-nav a {
- display: inline-block;
- color: white;
- background-color: dodgerblue;
- text-align: center;
- padding: 10px;
- text-decoration: none;
- border-radius: 10px;
- margin-left: 20px;
-}
-
-/* Change the color of links on mouse-over */
-.pill-nav a:hover {
- background-color: royalblue;
- color: white;
-}
-
-/* Add a color to the active/current link */
-.pill-nav a.active {
- background-color: royalblue;
- color: white;
-}
-
-.maincolumn {
- float:left;
- width: 100%;
-}
-/* Create two unequal columns that floats next to each other */
-/* Left column */
-.leftcolumn {
- float: left;
- width: 75%;
-}
-
-/* Right column */
-.rightcolumn {
- float: left;
- width: 25%;
- background-color: #f1f1f1;
- padding-left: 20px;
-}
-
-/* Fake image */
-.fakeimg {
- background-color: #aaa;
- width: 100%;
- padding: 20px;
-}
-
-/* Add a card effect for articles */
-.card {
- background-color: white;
- padding: 20px;
- margin-top: 20px;
-}
-
-/* Clear floats after the columns */
-.row::after {
- content: "";
- display: table;
- clear: both;
-}
-
-/* Footer */
-.footer {
- padding: 20px;
- text-align: center;
- background: #ddd;
- margin-top: 20px;
-}
-
-/* Responsive layout - when the screen is less than 800px wide, make the two columns stack on top of each other instead of next to each other */
-@media screen and (max-width: 800px) {
- .leftcolumn, .rightcolumn {
- width: 100%;
- padding: 0;
- }
-}
-
-/* Responsive layout - when the screen is less than 400px wide, make the navigation links stack on top of each other instead of next to each other */
-@media screen and (max-width: 400px) {
- .topnav a {
- float: none;
- width: 100%;
- }
-}
diff --git a/kontor-gin/cmd/kontor-gin/main.go b/kontor-gin/cmd/kontor-gin/main.go
index c2afa42..67dfdfe 100644
--- a/kontor-gin/cmd/kontor-gin/main.go
+++ b/kontor-gin/cmd/kontor-gin/main.go
@@ -15,11 +15,23 @@ import (
"github.com/gin-contrib/sessions/cookie"
gin_slog "github.com/gin-contrib/slog"
"github.com/gin-gonic/gin"
+ "github.com/spf13/viper"
)
func main() {
slog.Info("Kontor started")
+ viper.SetDefault("db.host", "localhost")
+ viper.SetDefault("db.port", 5432)
+ viper.SetDefault("db.name", "kontor")
+ viper.SetDefault("db.user", "kontor")
+ viper.SetDefault("db.password", "kontor")
+ viper.SetDefault("port", 8550)
+
+ if err := globals.InitConfig(); err != nil {
+ slog.Info("Failed to initialize config", "error", err)
+ }
+
// Set Gin mode based on environment
// Production mode disables debug output
if os.Getenv("GIN_MODE") == "release" {
@@ -57,21 +69,11 @@ func main() {
routes.SetupMediaRoutes(api)
routes.SetupComicRoutes(api)
- // Setup public Webapp routes
- routes.PublicRoutes(router)
-
- // Setup protected Webapp routes
- protected := router.Group("/auth")
- protected.Use(middleware.AuthRequired)
- routes.ProtectedRoutes(router)
-
- comics := router.Group("/comics")
- comics.Use(middleware.AuthRequired)
+ // Setup Webapp routes
+ routes.AuthRoutes(router)
routes.ComicRoutes(router)
-
- media := router.Group("/media")
- media.Use(middleware.AuthRequired)
routes.MediaRoutes(router)
+ routes.PublicRoutes(router)
// Start server
port := os.Getenv("PORT")
diff --git a/kontor-gin/cmd/kontor/main.go b/kontor-gin/cmd/kontor/main.go
index b86be82..9e85c16 100644
--- a/kontor-gin/cmd/kontor/main.go
+++ b/kontor-gin/cmd/kontor/main.go
@@ -2,7 +2,7 @@ package main
import (
// "kontor-api-gin/pkg/handler"
- "fmt"
+
"html/template"
"kontor-api-gin/assets"
"kontor-api-gin/pkg/globals"
@@ -13,8 +13,6 @@ import (
"log"
"log/slog"
"net/http"
- "os"
- "strings"
"strconv"
"github.com/gin-contrib/sessions"
@@ -24,29 +22,6 @@ import (
"github.com/spf13/viper"
)
-func initConfig() error {
- viper.SetConfigName("kontor-gin")
- viper.SetConfigType("yaml")
- viper.AddConfigPath(".")
- viper.AddConfigPath("$HOME/.config")
- viper.AddConfigPath("/etc/kontor")
- viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
- viper.AutomaticEnv()
-
- // Read the config file
- if err := viper.ReadInConfig(); err != nil {
- // Handle the case where config file is not found
- if _, ok := err.(viper.ConfigFileNotFoundError); ok {
- slog.Info("No config file found, using defaults")
- return nil
- }
- return fmt.Errorf("error reading config file: %w", err)
- }
-
- slog.Info("initConfig", "Using config file: ", viper.ConfigFileUsed())
- return nil
-}
-
func main() {
slog.Info("Kontor started")
@@ -56,14 +31,15 @@ func main() {
viper.SetDefault("db.user", "kontor")
viper.SetDefault("db.password", "kontor")
viper.SetDefault("port", 8550)
+ viper.SetDefault("gin.mode", "release")
- if err := initConfig(); err != nil {
- log.Fatalf("Failed to initialize config: %v", err)
- }
+ if err := globals.InitConfig(); err != nil {
+ log.Fatalf("Failed to initialize config: %v", err)
+ }
// Set Gin mode based on environment
// Production mode disables debug output
- if os.Getenv("GIN_MODE") == "release" {
+ if viper.GetString("gin.mode") == "release" {
gin.SetMode(gin.ReleaseMode)
}
@@ -100,21 +76,11 @@ func main() {
routes.SetupMediaRoutes(api)
routes.SetupComicRoutes(api)
- // Setup public Webapp routes
- routes.PublicRoutes(router)
-
- // Setup protected Webapp routes
- protected := router.Group("/auth")
- protected.Use(middleware.AuthRequired)
- routes.ProtectedRoutes(router)
-
- comics := router.Group("/comics")
- comics.Use(middleware.AuthRequired)
+ // Setup Webapp routes
+ routes.AuthRoutes(router)
routes.ComicRoutes(router)
-
- media := router.Group("/media")
- media.Use(middleware.AuthRequired)
routes.MediaRoutes(router)
+ routes.PublicRoutes(router)
// Start server
port := viper.GetInt("port")
diff --git a/kontor-gin/pkg/controllers/auth.go b/kontor-gin/pkg/controllers/auth.go
index dd70a8e..0b02873 100644
--- a/kontor-gin/pkg/controllers/auth.go
+++ b/kontor-gin/pkg/controllers/auth.go
@@ -17,20 +17,20 @@ func LoginGetHandler(c *gin.Context) {
logger := slog.Get(c)
logger.Info("LoginGetHandler", globals.UserKey, user)
if user != nil {
- c.HTML(http.StatusBadRequest, "login.html", gin.H{
+ c.HTML(http.StatusBadRequest, "login", gin.H{
"title": "Kontor Gin",
"version": "0.4.0",
"login": globals.LoginUrl,
- "content": "Please logout first",
+ "message": "Please logout first",
"user": user,
})
return
}
- c.HTML(http.StatusOK, "login.html", gin.H{
+ c.HTML(http.StatusOK, "login", gin.H{
"title": "Kontor Gin",
"version": "0.4.0",
"login": globals.LoginUrl,
- "content": "",
+ "message": "",
"user": user,
})
}
@@ -41,11 +41,11 @@ func LoginPostHandler(c *gin.Context) {
logger := slog.Get(c)
logger.Info("LoginPostHandler", "user", user)
if user != nil {
- c.HTML(http.StatusBadRequest, "login.html", gin.H{
+ c.HTML(http.StatusBadRequest, "login", gin.H{
"title": "Kontor Gin",
"version": "0.4.0",
"login": globals.LoginUrl,
- "content": "Please logout first",
+ "message": "Please logout first",
})
return
}
@@ -54,30 +54,30 @@ func LoginPostHandler(c *gin.Context) {
password := c.PostForm("password")
if helpers.EmptyUserPass(username, password) {
- c.HTML(http.StatusBadRequest, "login.html", gin.H{
+ c.HTML(http.StatusBadRequest, "login", gin.H{
"title": "Kontor Gin",
"version": "0.4.0",
"login": globals.LoginUrl,
- "content": "Parameters can't be empty",
+ "message": "Parameters can't be empty",
})
}
if !helpers.CheckUserPass(username, password) {
- c.HTML(http.StatusUnauthorized, "login.html", gin.H{
+ c.HTML(http.StatusUnauthorized, "login", gin.H{
"title": "Kontor Gin",
"version": "0.4.0",
"login": globals.LoginUrl,
- "content": "Incorrect username or password",
+ "message": "Incorrect username or password",
})
}
session.Set(globals.UserKey, username)
if err := session.Save(); err != nil {
- c.HTML(http.StatusInternalServerError, "login.html", gin.H{
+ c.HTML(http.StatusInternalServerError, "login", gin.H{
"title": "Kontor Gin",
"version": "0.4.0",
"login": globals.LoginUrl,
- "content": "Failed to save session",
+ "message": "Failed to save session",
})
return
}
diff --git a/kontor-gin/pkg/controllers/comic.go b/kontor-gin/pkg/controllers/comic.go
index abb35b5..05eb619 100644
--- a/kontor-gin/pkg/controllers/comic.go
+++ b/kontor-gin/pkg/controllers/comic.go
@@ -18,11 +18,11 @@ func ListComicsGetHandler(c *gin.Context) {
var comics []schema.Comic
result := schema.DB.Find(&comics)
- logger.Info("found Comics", "count", result.RowsAffected)
- c.HTML(http.StatusOK, "comics.html", gin.H{
+ logger.Info("ListComicsGetHandler", "count", result.RowsAffected)
+ c.HTML(http.StatusOK, "comics", gin.H{
"title": "Kontor Comics",
"version": "0.4.0",
- "content": "Media Files...",
+ "message": "Comics...",
"comics": comics,
"user": user,
})
diff --git a/kontor-gin/pkg/controllers/comic_api.go b/kontor-gin/pkg/controllers/comic_api.go
index 2c8520e..b38e30f 100644
--- a/kontor-gin/pkg/controllers/comic_api.go
+++ b/kontor-gin/pkg/controllers/comic_api.go
@@ -69,7 +69,7 @@ func ListComicStoryArcs(c *gin.Context) {
logger := slog.Get(c)
result := schema.DB.Find(&items)
- logger.Info("found Comic StoryArcs", "count", result.RowsAffected)
+ logger.Info("ListComicStoryArcs", "count", result.RowsAffected)
c.JSON(http.StatusOK, items)
}
diff --git a/kontor-gin/pkg/controllers/handlers.go b/kontor-gin/pkg/controllers/handlers.go
index 1d1c8b9..eef3a8a 100644
--- a/kontor-gin/pkg/controllers/handlers.go
+++ b/kontor-gin/pkg/controllers/handlers.go
@@ -14,10 +14,10 @@ func IndexGetHandler(c *gin.Context) {
user := session.Get(globals.UserKey)
logger := slog.Get(c)
logger.Info("IndexGetHandler", globals.UserKey, user)
- c.HTML(http.StatusOK, "home.html", gin.H{
+ c.HTML(http.StatusOK, "home", gin.H{
"title": "Kontor Gin",
"version": "0.4.0",
- "content": "This is an index page...",
+ "message": "This is an index page...",
"login": globals.LoginUrl,
"logout": globals.LogoutUrl,
"user": user,
diff --git a/kontor-gin/pkg/controllers/media.go b/kontor-gin/pkg/controllers/media.go
index 0806658..0cf2773 100644
--- a/kontor-gin/pkg/controllers/media.go
+++ b/kontor-gin/pkg/controllers/media.go
@@ -3,7 +3,6 @@ package controllers
import (
"kontor-api-gin/pkg/globals"
"kontor-api-gin/pkg/schema"
- "log"
"net/http"
"github.com/gin-contrib/sessions"
@@ -13,11 +12,12 @@ import (
func ListMediaFiles(c *gin.Context) {
var files []schema.MediaFile
+ logger := slog.Get(c)
// query := schema.DB.Model(&schema.MediaFile{})
// result := query.Find(&files)
result := schema.DB.Find(&files)
- log.Printf("found %d MediaFiles", result.RowsAffected)
+ logger.Info("ListMediaFiles", "count", result.RowsAffected)
c.JSON(http.StatusOK, gin.H{
"message": "All MediaFiles",
"files": files,
@@ -26,9 +26,10 @@ func ListMediaFiles(c *gin.Context) {
func ListMediaLoFis(c *gin.Context) {
var lofis []schema.MediaLoFi
+ logger := slog.Get(c)
result := schema.DB.Find(&lofis)
- log.Printf("found %d MediaLoFis", result.RowsAffected)
+ logger.Info("ListMediaLoFis", "count", result.RowsAffected)
c.JSON(http.StatusOK, lofis)
}
@@ -41,10 +42,10 @@ func ListMediaActorsGetHandler(c *gin.Context) {
result := schema.DB.Find(&actors)
logger.Info("ListMediaActorsGetHandler", "count", result.RowsAffected)
- c.HTML(http.StatusOK, "mediaactors.html", gin.H{
+ c.HTML(http.StatusOK, "mediaactors", gin.H{
"title": "Kontor Gin",
"version": "0.4.0",
- "content": "Media Actors...",
+ "message": "Media Actors...",
"actors": actors,
"login": globals.LoginUrl,
"logout": globals.LogoutUrl,
@@ -61,10 +62,10 @@ func ListMediaFilesGetHandler(c *gin.Context) {
result := schema.DB.Find(&files)
logger.Info("ListMediaFilesGetHandler", "count", result.RowsAffected)
- c.HTML(http.StatusOK, "mediafiles.html", gin.H{
+ c.HTML(http.StatusOK, "mediafiles", gin.H{
"title": "Kontor Gin",
"version": "0.4.0",
- "content": "Media Files...",
+ "message": "Media Files...",
"files": files,
"login": globals.LoginUrl,
"logout": globals.LogoutUrl,
@@ -82,10 +83,11 @@ func ListMediaLoFisGetHandler(c *gin.Context) {
result := schema.DB.Find(&lofis)
logger.Info("ListMediaLoFisGetHandler", "count", result.RowsAffected)
- c.HTML(http.StatusOK, "media_lofi.html", gin.H{
+ logger.Info("ListMediaLoFisGetHandler", "medialofi", lofis[0])
+ c.HTML(http.StatusOK, "lofi", gin.H{
"title": "Kontor Gin",
"version": "0.4.0",
- "content": "Media LoFis...",
+ "message": "Media LoFis...",
"lofis": lofis,
"login": globals.LoginUrl,
"logout": globals.LogoutUrl,
diff --git a/kontor-gin/pkg/globals/config.go b/kontor-gin/pkg/globals/config.go
new file mode 100644
index 0000000..f71a6b1
--- /dev/null
+++ b/kontor-gin/pkg/globals/config.go
@@ -0,0 +1,32 @@
+package globals
+
+import (
+ "fmt"
+ "log/slog"
+ "strings"
+
+ "github.com/spf13/viper"
+)
+
+func InitConfig() error {
+ viper.SetConfigName("kontor-gin")
+ viper.SetConfigType("yaml")
+ viper.AddConfigPath(".")
+ viper.AddConfigPath("$HOME/.config")
+ viper.AddConfigPath("/etc/kontor")
+ viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
+ viper.AutomaticEnv()
+
+ // Read the config file
+ if err := viper.ReadInConfig(); err != nil {
+ // Handle the case where config file is not found
+ if _, ok := err.(viper.ConfigFileNotFoundError); ok {
+ slog.Info("No config file found, using defaults")
+ return nil
+ }
+ return fmt.Errorf("error reading config file: %w", err)
+ }
+
+ slog.Info("initConfig", "Using config file: ", viper.ConfigFileUsed())
+ return nil
+}
diff --git a/kontor-gin/pkg/globals/globals.go b/kontor-gin/pkg/globals/globals.go
index 3fa65fb..010100d 100644
--- a/kontor-gin/pkg/globals/globals.go
+++ b/kontor-gin/pkg/globals/globals.go
@@ -6,6 +6,6 @@ const UserKey = "user"
const Version = "0.4.0"
-const LoginUrl = "/auth/login"
+const LoginUrl = "/login"
const LogoutUrl = "/auth/logout"
diff --git a/kontor-gin/pkg/routes/webapp.go b/kontor-gin/pkg/routes/webapp.go
index 40127f7..86171ec 100644
--- a/kontor-gin/pkg/routes/webapp.go
+++ b/kontor-gin/pkg/routes/webapp.go
@@ -27,7 +27,7 @@ func MediaRoutes(g *gin.Engine) {
media.GET("/lofis", controllers.ListMediaLoFisGetHandler)
}
-func ProtectedRoutes(g *gin.Engine) {
+func AuthRoutes(g *gin.Engine) {
auth := g.Group("/auth")
auth.Use(middleware.AuthRequired)
auth.GET("/logout", controllers.LogoutGetHandler)
diff --git a/kontor-gin/pkg/schema/media.go b/kontor-gin/pkg/schema/media.go
index b4e2b40..465b7fe 100644
--- a/kontor-gin/pkg/schema/media.go
+++ b/kontor-gin/pkg/schema/media.go
@@ -1,13 +1,18 @@
package schema
-type MediaLoFi struct {
- Base
+import "time"
- WebLink string `gorm:"uniqueIndex" json:"url"`
- Review bool `json:"review"`
- ShouldDownload bool `json:"should_download"`
- Title string `gorm:"size:300" json:"title"`
- FileName string `json:"file_name"`
+type MediaLoFi struct {
+ ID string `gorm:"type:string;primary_key;"`
+ Created_Date time.Time `json:"created_date"`
+ Last_Modified_date time.Time `json:"last_modified_date"`
+ Deleted_Date *time.Time `json:"deleted_date"`
+ Version int `gorm:"default:0" json:"version"`
+ Url string `gorm:"uniqueIndex" json:"url"`
+ Review bool `json:"review"`
+ ShouldDownload bool `json:"should_download"`
+ Title string `gorm:"size:300" json:"title"`
+ FileName string `json:"file_name"`
}
func (media_lofi *MediaLoFi) TableName() string {
diff --git a/kontor-gin/templates/layouts/footer.html b/kontor-gin/templates/layouts/footer.html
new file mode 100644
index 0000000..905b05c
--- /dev/null
+++ b/kontor-gin/templates/layouts/footer.html
@@ -0,0 +1,3 @@
+{{ define "footer" }}
+
+{{ end }}
diff --git a/kontor-gin/templates/layouts/head.html b/kontor-gin/templates/layouts/head.html
new file mode 100644
index 0000000..6aacaa5
--- /dev/null
+++ b/kontor-gin/templates/layouts/head.html
@@ -0,0 +1,13 @@
+{{ define "head" }}
+
+
+
+
+
+
+
+
+
+ {{ .title }}
+
+{{ end }}
diff --git a/kontor-gin/templates/layouts/navbar.html b/kontor-gin/templates/layouts/navbar.html
index a6c2c73..9b28a55 100644
--- a/kontor-gin/templates/layouts/navbar.html
+++ b/kontor-gin/templates/layouts/navbar.html
@@ -1,13 +1,40 @@
{{ define "navbar" }}
-
-
Kontor
-
Comics
-
Media
-
Lofi
- {{ if .user }}
-
Logout
- {{ else }}
-
Login
- {{ end }}
+
{{ end }}
diff --git a/kontor-gin/templates/pages/comics.html b/kontor-gin/templates/pages/comics.html
index 28829b8..3a59b33 100644
--- a/kontor-gin/templates/pages/comics.html
+++ b/kontor-gin/templates/pages/comics.html
@@ -1,52 +1,59 @@
-{{ define "comics.html" }}
-{{ template "main" . }}
-{{ end }}
+{{ define "comics" }}
+
+
+ {{ template "head" . }}
-{{ define "content" }}
-
-
-
-
-
- | Title |
- Publisher |
- Completed |
- Actions |
-
-
- {{ range .comics }}
-
- | {{.Title}} |
- {{ if .Publisher }}
- {{.Publisher.Name}} |
- {{ else }}
- Publisher not set |
- {{ end }}
-
- {{ if .Completed }}
-
- {{ else }}
-
+
+ {{ template "navbar" . }}
+
+
+
+
+
+
+ | Title |
+ Publisher |
+ Completed |
+ Actions |
+
+
+
+ {{ range .comics }}
+
+ | {{.Title}} |
+ {{ if .Publisher }}
+ {{.Publisher.Name}} |
+ {{ else }}
+ Publisher not set |
+ {{ end }}
+
+ {{ if .Completed }}
+
+ {{ else }}
+
+ {{ end }}
+ |
+ Edit |
+ Delete |
+
{{ end }}
-
- Edit |
- Delete |
-
- {{ end }}
-
-
-
-
+ |
+
+
+
+ {{ template "footer" . }}
+
+
{{ end }}
diff --git a/kontor-gin/templates/pages/home.html b/kontor-gin/templates/pages/home.html
index e27dd85..ab9df1e 100644
--- a/kontor-gin/templates/pages/home.html
+++ b/kontor-gin/templates/pages/home.html
@@ -1,7 +1,12 @@
-{{ define "home.html" }}
-{{ template "main" . }}
-{{ end }}
+{{ define "home" }}
+
+
+ {{ template "head" . }}
-{{ define "content" }}
-
{{ .content }}
+
+ {{ template "navbar" . }}
+
{{ .message }}
+ {{ template "footer" . }}
+
+
{{ end }}
diff --git a/kontor-gin/templates/pages/lofi.html b/kontor-gin/templates/pages/lofi.html
index b0dc02c..d0f5490 100644
--- a/kontor-gin/templates/pages/lofi.html
+++ b/kontor-gin/templates/pages/lofi.html
@@ -1,52 +1,62 @@
-{{ define "media_lofi.html" }}
-{{ template "main" . }}
-{{ end }}
+{{ define "lofi" }}
+
+
+ {{ template "head" . }}
-{{ define "content" }}
-
-
-
-
-
- | Title |
- Publisher |
- Completed |
- Actions |
-
-
- {{ range .comics }}
-
- | {{.Title}} |
- {{ if .WebLink }}
- {{.Title}} |
- {{ else }}
- WebLink not set |
- {{ end }}
-
- {{ if .Review }}
-
- {{ else }}
-
- {{ end }}
- |
- Edit |
- Delete |
-
- {{ end }}
-
-
-
-
+
+ {{ template "navbar" . }}
+
+
Media Lofi
+
+
+
+
+
+
+
+ | Title |
+ Weblink |
+ Review |
+ Actions |
+
+
+
+ {{ range .lofis }}
+
+ | {{.Title}} |
+ {{ if .Url }}
+ {{.Url}} |
+ {{ else }}
+ WebLink not set |
+ {{ end }}
+
+ {{ if .Review }}
+
+ {{ else }}
+
+ {{ end }}
+ |
+ Edit |
+ Delete |
+
+ {{ end }}
+
+
+
+
+ {{ template "footer" . }}
+
+
{{ end }}
diff --git a/kontor-gin/templates/pages/login.html b/kontor-gin/templates/pages/login.html
index b596105..b0a9cc2 100644
--- a/kontor-gin/templates/pages/login.html
+++ b/kontor-gin/templates/pages/login.html
@@ -1,34 +1,36 @@
-{{ define "login.html" }}
-{{ template "main" . }}
-{{ end }}
+{{ define "login" }}
+
+
+ {{ template "head" . }}
-{{ define "content" }}
-