summaryrefslogtreecommitdiff
path: root/internal/handlers/tabs.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/handlers/tabs.go')
-rw-r--r--internal/handlers/tabs.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/handlers/tabs.go b/internal/handlers/tabs.go
index 74dfbe8..ffdabb0 100644
--- a/internal/handlers/tabs.go
+++ b/internal/handlers/tabs.go
@@ -4,6 +4,7 @@ import (
"html/template"
"log"
"net/http"
+ "path/filepath"
"sort"
"strings"
"time"
@@ -31,15 +32,15 @@ type TabsHandler struct {
}
// NewTabsHandler creates a new TabsHandler instance
-func NewTabsHandler(store *store.Store) *TabsHandler {
+func NewTabsHandler(store *store.Store, templateDir string) *TabsHandler {
// Parse templates including partials
- tmpl, err := template.ParseGlob("web/templates/*.html")
+ tmpl, err := template.ParseGlob(filepath.Join(templateDir, "*.html"))
if err != nil {
log.Printf("Warning: failed to parse templates: %v", err)
}
// Also parse partials
- tmpl, err = tmpl.ParseGlob("web/templates/partials/*.html")
+ tmpl, err = tmpl.ParseGlob(filepath.Join(templateDir, "partials", "*.html"))
if err != nil {
log.Printf("Warning: failed to parse partial templates: %v", err)
}