add preview to Announcements

This commit is contained in:
Harvey Tindall
2021-05-03 18:35:27 +01:00
parent 2c6d08319b
commit c0f316d049
8 changed files with 84 additions and 32 deletions
+4 -2
View File
@@ -53,13 +53,15 @@ func (app *appContext) pushResources(gc *gin.Context, admin bool) {
gc.Header("Link", cssHeader)
}
type Page int
const (
AdminPage = iota + 1
AdminPage Page = iota + 1
FormPage
PWRPage
)
func (app *appContext) getLang(gc *gin.Context, page int, chosen string) string {
func (app *appContext) getLang(gc *gin.Context, page Page, chosen string) string {
lang := gc.Query("lang")
cookie, err := gc.Cookie("lang")
if lang != "" {