Optimizacije — SQLite WAL, template keš, gzip kompresija, build skript

This commit is contained in:
2026-06-03 21:18:12 +02:00
parent 2401f6d5ec
commit 974d76360a
46 changed files with 1470 additions and 579 deletions
+1 -19
View File
@@ -1,8 +1,6 @@
package handler
import (
"html/template"
"log"
"net/http"
"strconv"
@@ -77,23 +75,7 @@ func (h *Handler) Magacin(w http.ResponseWriter, r *http.Request) {
Obrisan: r.URL.Query().Get("obrisan") == "1",
}
tmpl, err := template.ParseFiles(
"web/templates/teme/podrazumevana/base.html",
"web/templates/komponente/sidebar.html",
"web/templates/komponente/topbar.html",
"web/templates/stranice/magacin.html",
)
if err != nil {
log.Printf("greška pri učitavanju šablona: %v", err)
http.Error(w, "Greška pri učitavanju stranice", http.StatusInternalServerError)
return
}
if err := tmpl.ExecuteTemplate(w, "base", podaci); err != nil {
log.Printf("greška pri renderovanju: %v", err)
http.Error(w, "Greška pri prikazu stranice", http.StatusInternalServerError)
return
}
h.renderujTemplate(w, "magacin", podaci)
}
// ObrisiArtikal briše artikal po ID-u