mirror of
https://github.com/Theodor-Springmann-Stiftung/musenalm.git
synced 2026-02-04 02:25:30 +00:00
+better site editor, redirect to view on saving
This commit is contained in:
@@ -226,9 +226,10 @@ func (p *AlmanachEditPage) POSTSave(engine *templating.Engine, app core.App) Han
|
||||
}
|
||||
|
||||
return e.JSON(http.StatusOK, map[string]any{
|
||||
"success": true,
|
||||
"message": "Änderungen gespeichert.",
|
||||
"updated": updatedInfo,
|
||||
"success": true,
|
||||
"message": "Änderungen gespeichert.",
|
||||
"updated": updatedInfo,
|
||||
"redirect": fmt.Sprintf("/almanach/%s/", id),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package controllers
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
|
||||
"github.com/Theodor-Springmann-Stiftung/musenalm/app"
|
||||
@@ -164,7 +163,7 @@ func (p *AlmanachNewPage) POSTSave(engine *templating.Engine, app core.App) Hand
|
||||
|
||||
redirect := "/"
|
||||
if entry != nil {
|
||||
redirect = "/almanach/" + strconv.Itoa(entry.MusenalmID()) + "/edit?saved_message=" + url.QueryEscape("Änderungen gespeichert.")
|
||||
redirect = "/almanach/" + strconv.Itoa(entry.MusenalmID()) + "/"
|
||||
}
|
||||
|
||||
return e.JSON(http.StatusOK, map[string]any{
|
||||
|
||||
@@ -3,7 +3,6 @@ package controllers
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
@@ -232,7 +231,7 @@ func (p *OrtEditPage) POST(engine *templating.Engine, app core.App) HandleFunc {
|
||||
}
|
||||
}(app, place.Id, nameChanged)
|
||||
|
||||
redirect := fmt.Sprintf("/ort/%s/edit?saved_message=%s", id, url.QueryEscape("Änderungen gespeichert."))
|
||||
redirect := fmt.Sprintf("/ort/%s/", id)
|
||||
return e.Redirect(http.StatusSeeOther, redirect)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package controllers
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
@@ -143,11 +142,7 @@ func (p *OrtNewPage) POST(engine *templating.Engine, app core.App) HandleFunc {
|
||||
}
|
||||
}(app, createdPlace.Id)
|
||||
|
||||
redirect := fmt.Sprintf(
|
||||
"/ort/%s/edit?saved_message=%s",
|
||||
createdPlace.Id,
|
||||
url.QueryEscape("Änderungen gespeichert."),
|
||||
)
|
||||
redirect := fmt.Sprintf("/ort/%s/", createdPlace.Id)
|
||||
return e.Redirect(http.StatusSeeOther, redirect)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package controllers
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
@@ -344,7 +343,7 @@ func (p *PersonEditPage) POST(engine *templating.Engine, app core.App) HandleFun
|
||||
}
|
||||
}(app, agent.Id, nameChanged)
|
||||
|
||||
redirect := fmt.Sprintf("/person/%s/edit?saved_message=%s", id, url.QueryEscape("Änderungen gespeichert."))
|
||||
redirect := fmt.Sprintf("/person/%s", id)
|
||||
return e.Redirect(http.StatusSeeOther, redirect)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package controllers
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
@@ -147,11 +146,7 @@ func (p *PersonNewPage) POST(engine *templating.Engine, app core.App) HandleFunc
|
||||
}
|
||||
}(app, createdAgent.Id)
|
||||
|
||||
redirect := fmt.Sprintf(
|
||||
"/person/%s/edit?saved_message=%s",
|
||||
createdAgent.Id,
|
||||
url.QueryEscape("Änderungen gespeichert."),
|
||||
)
|
||||
redirect := fmt.Sprintf("/person/%s", createdAgent.Id)
|
||||
return e.Redirect(http.StatusSeeOther, redirect)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package controllers
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
@@ -444,7 +443,7 @@ func (p *ReiheEditPage) POST(engine *templating.Engine, app core.App) HandleFunc
|
||||
}
|
||||
}(app, series.Id, titleChanged)
|
||||
|
||||
redirect := fmt.Sprintf("/reihe/%s/edit?saved_message=%s", id, url.QueryEscape("Änderungen gespeichert."))
|
||||
redirect := fmt.Sprintf("/reihe/%s/", id)
|
||||
return e.Redirect(http.StatusSeeOther, redirect)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package controllers
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
@@ -147,11 +146,7 @@ func (p *ReiheNewPage) POST(engine *templating.Engine, app core.App) HandleFunc
|
||||
}
|
||||
}(app, createdSeries.Id)
|
||||
|
||||
redirect := fmt.Sprintf(
|
||||
"/reihe/%d/edit?saved_message=%s",
|
||||
createdSeries.MusenalmID(),
|
||||
url.QueryEscape("Änderungen gespeichert."),
|
||||
)
|
||||
redirect := fmt.Sprintf("/reihe/%d/", createdSeries.MusenalmID())
|
||||
return e.Redirect(http.StatusSeeOther, redirect)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user