initial commit from original sev version

This commit is contained in:
Bartal Læarsson
2026-06-25 12:03:26 +01:00
commit 9c157cc5a0
31 changed files with 468875 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
package handlers
import (
"net/http"
"time"
"abuse_registration_poc/internal/models"
)
func (h *Handler) Index(writer http.ResponseWriter, request *http.Request) {
_, _, nextReset := h.store.Snapshot()
data := struct {
Version string
NextReset string
Locations []string
Categories []string
Genders []string
Statuses []string
}{
Version: h.version,
NextReset: nextReset.Format(time.RFC3339),
Locations: models.FaroeLocations,
Categories: models.AbuseCategories,
Genders: models.Genders,
Statuses: models.Statuses,
}
writer.Header().Set("Content-Type", "text/html; charset=utf-8")
if err := h.index.ExecuteTemplate(writer, "index.html", data); err != nil {
http.Error(writer, err.Error(), http.StatusInternalServerError)
}
}