Version bump
This commit is contained in:
+3
-1
@@ -35,6 +35,7 @@ type Config struct {
|
||||
AdminUsername string
|
||||
AdminPassword string
|
||||
UploadDir string
|
||||
Version string
|
||||
}
|
||||
|
||||
type Server struct {
|
||||
@@ -56,6 +57,7 @@ type pageData struct {
|
||||
Error string
|
||||
Success string
|
||||
CurrentPath string
|
||||
Version string
|
||||
}
|
||||
|
||||
func New(cfg Config, st *store.Store) (*Server, error) {
|
||||
@@ -493,7 +495,7 @@ func (s *Server) adminData(r *http.Request, tab string) (pageData, error) {
|
||||
if err != nil {
|
||||
return pageData{}, err
|
||||
}
|
||||
data := pageData{Title: "Admin", Admin: true, AdminTab: tab, Content: content, Success: r.URL.Query().Get("ok"), Error: r.URL.Query().Get("err")}
|
||||
data := pageData{Title: "Admin", Admin: true, AdminTab: tab, Content: content, Success: r.URL.Query().Get("ok"), Error: r.URL.Query().Get("err"), Version: s.cfg.Version}
|
||||
if tab == "projects" {
|
||||
projects, err := s.store.Projects(r.Context(), false)
|
||||
if err != nil {
|
||||
|
||||
@@ -32,6 +32,7 @@ func newTestServer(t *testing.T) *Server {
|
||||
AdminUsername: "admin",
|
||||
AdminPassword: "changeme",
|
||||
UploadDir: filepath.Join(dir, "uploads"),
|
||||
Version: "test-version",
|
||||
}, st)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -119,7 +120,7 @@ func TestAdminTabs(t *testing.T) {
|
||||
t.Fatalf("%s returned %d", test.path, rec.Code)
|
||||
}
|
||||
body, _ := io.ReadAll(rec.Result().Body)
|
||||
if !strings.Contains(string(body), test.want) || !strings.Contains(string(body), "<!doctype html>") {
|
||||
if !strings.Contains(string(body), test.want) || !strings.Contains(string(body), "<!doctype html>") || !strings.Contains(string(body), "Version test-version") {
|
||||
t.Fatalf("%s did not render full tab page: %s", test.path, body)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user