From 8d43f3828adad16409c9cec9f7ae31413125a6f4 Mon Sep 17 00:00:00 2001 From: Sebastiaan de Schaetzen Date: Thu, 29 May 2025 13:51:38 +0200 Subject: [PATCH] Stuff now works better on IE2 --- backend/allowance_planner.db3.backup.3 | Bin 20480 -> 20480 bytes backend/web.go | 17 +++++++++++------ backend/web.gohtml | 8 +++++--- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/backend/allowance_planner.db3.backup.3 b/backend/allowance_planner.db3.backup.3 index b7a3e07efe5659750b9e90bca8d0238b13edb321..380cafd58d06ed547fc988be1d29f3fda77d7c53 100644 GIT binary patch delta 521 zcmaiv!D|yi7{$MDvLWg2PQJDwtYNceR#CeULW>7aqEZkMgo1y7#AFf|H`$uqJ@nSJ z;MJBniqN|!>0jX8;>n}Of>1Bwp4HiHdUkGac<=YVw||2BCwSzdaopK%8PI7%Q6vt;~cf0X=*Art26H@3z5V@8@65-q^B%um$s8FFn3KyzrJh4|<+tKbC z6Tu}xltU2`5*GwWh!f%hJ#g%WUJzA;s(Jv#k*eu|Q+c!T+WDxGo+_fgNp`(& z{%>a9`_0TD&d#aVPWZ7BORcaWV^JZ4gfTKB1R=zL%YrK{`q@kk_@r=YpS_Af#?O{L z?@MB4Hwd4}eUjbqbUQ3a00|%gB!C2v01`j~NB{{uAOh=-VHZb6==-N*c_vUY2wEN4 zTvSp2$vpo0-0b|En4f*|#GL5Yd(KhM5m5Z9@SCx!sZgwhenW<4r_&P$E|EK;?EJmSIiByuT9WM`7L(onJIb%sV-Z4H zy%9WTOf0s7Ry*9)zPvVM+Qnj#uICdNv5c0ZQSQP#W3xz(o{?{$lL$TZHjTgkOgn79@ZKkN^@u0!RP}AOR$R1dsp{KmthM|4x82iwsfY zmG;t7pbYxbdj)Ed5o(-LDpIPUf@Q~edmggjLm9T|b!@={yO8^r@Z0=P{wx2PU*O;I zulc9^L%zxb{uV#UXL*H>@<+K1Zdi~25D$s^*6K>yaLrW8Uxl%Z zuA~hYz8Oezt>j;T4&iG79Y$h!ToKBr37<}Xa+h7?v7!FfNA!SsJs*+s&XC^(p{>u{=jxcZ?H4JL7S$NsM z4(C{6H~>H{o`hdE{NvyJ17gu5R?jQ#@a2{awAcB7O^~}!AJPtt+5K*6;4pb@^4j$6 zN>U0pet>ECTzhR9OnZ&r9KXrrXTM3%-=#$e#$@vl#Iw5pbAK>$r;>m2F%w1@g0?2p zZN${n!qfsIzhAVW)f_E?a+re4Q%U!4tR%-5bdaUEG-zbbd51T17=Xcd33%`VK+z!8s3WT+>%a>D1x942 HN`Cqey07IF diff --git a/backend/web.go b/backend/web.go index e9c5687..d8188e1 100644 --- a/backend/web.go +++ b/backend/web.go @@ -28,8 +28,13 @@ func loadWebEndpoints(router *gin.Engine) { } func redirectToPage(c *gin.Context, page string) { + redirectToPageStatus(c, page, http.StatusSeeOther) +} + +func redirectToPageStatus(c *gin.Context, page string, status int) { scheme := c.Request.URL.Scheme - c.Redirect(http.StatusSeeOther, scheme+domain+page) + target := scheme + domain + page + c.Redirect(status, target) } func renderLogin(c *gin.Context) { @@ -75,7 +80,7 @@ func renderCreateTask(c *gin.Context) { return } - c.Redirect(http.StatusFound, "/") + redirectToPageStatus(c, "/", http.StatusFound) } func renderCompleteTask(c *gin.Context) { @@ -92,7 +97,7 @@ func renderCompleteTask(c *gin.Context) { return } - c.Redirect(http.StatusFound, "/") + redirectToPageStatus(c, "/", http.StatusFound) } func renderCreateAllowance(c *gin.Context) { @@ -129,7 +134,7 @@ func renderCreateAllowance(c *gin.Context) { return } - c.Redirect(http.StatusFound, "/") + redirectToPageStatus(c, "/", http.StatusFound) } func renderCompleteAllowance(c *gin.Context) { @@ -151,7 +156,7 @@ func renderCompleteAllowance(c *gin.Context) { return } - c.Redirect(http.StatusFound, "/") + redirectToPageStatus(c, "/", http.StatusFound) } func getCurrentUser(c *gin.Context) *int { @@ -180,7 +185,7 @@ func getCurrentUser(c *gin.Context) *int { func unsetUserCookie(c *gin.Context) { c.SetCookie("user", "", -1, "/", "localhost", false, true) - c.Redirect(http.StatusFound, "/") + redirectToPageStatus(c, "/", http.StatusFound) } func renderNoUser(c *gin.Context) { diff --git a/backend/web.gohtml b/backend/web.gohtml index 1ed49ee..cd23150 100644 --- a/backend/web.gohtml +++ b/backend/web.gohtml @@ -3,9 +3,11 @@ Allowance Planner 2000 @@ -27,7 +29,7 @@ {{if ne .CurrentUser 0}}

Allowances

- +
@@ -43,7 +45,7 @@ - + {{range .Allowances}} {{if eq .ID 0}} @@ -103,7 +105,7 @@ - +
Name