From fc084108acfa7255b268a3ce6a4d5cf02229a72a Mon Sep 17 00:00:00 2001 From: MaxJa4 <74194322+MaxJa4@users.noreply.github.com> Date: Tue, 16 Jan 2024 20:19:40 +0100 Subject: [PATCH] Optimize all modals (fetching). Implement add-player modal. --- controllers/player_controller.go | 2 +- isc_data.db | Bin 16384 -> 16384 bytes static/index.js | 22 +++++++++++- templates/components/header.html | 2 +- templates/components/home_clan_bar.html | 3 +- templates/components/opp_clan_bar.html | 3 +- templates/index.html | 5 +-- templates/modals/add_clan.html | 45 +++++++++++++++--------- templates/modals/add_player.html | 22 +++++------- templates/modals/delete_clan.html | 35 ++++++++++-------- templates/modals/delete_player.html | 45 +++++++++++------------- templates/modals/edit_clan.html | 39 ++++++++++++++------ templates/player_list_item.html | 2 +- 13 files changed, 134 insertions(+), 91 deletions(-) diff --git a/controllers/player_controller.go b/controllers/player_controller.go index 205cf0c..eb0f95e 100644 --- a/controllers/player_controller.go +++ b/controllers/player_controller.go @@ -33,7 +33,7 @@ func GetAllPlayers(c *gin.Context) { // GetPlayersByClanHTML GET /players_html func GetPlayersByClanHTML(c *gin.Context) { var players []models.Player - clanId := c.Request.URL.Query().Get("id") + clanId := c.Request.URL.Query().Get("clan_id") if err := models.DB.Where("clan_id = ?", utils.StringToUint(clanId)).Find(&players).Error; err != nil { return } diff --git a/isc_data.db b/isc_data.db index c2658a32984236dae5fe36bada2c9240cad09e17..ce19e86199a826b2198cd5b65b44a341120eeee7 100644 GIT binary patch delta 817 zcma)5F^kkd6rRCk&ARNo&F;l@%*`couA-=HGReZ)Se$sBAPBaG%SHqhVS<*s_X7@2 zw!A{*df_;*v#_{pEUlC+EG%to)Jl9WSrj{yH_XiUzBliiFJw03vl-v@`QD4w4Ze49 z{}pJ4Plqu$f+KPJ|K5Y`o%Z~l+L?AoHuI%p@*<6Ol9?O>7W|HsPF{>NGtSL;m=&>Oig$*KF34&hsR~U6vb^aZ~jxwVE1WRpDK+*?Qj@r6>+5L^OG zS{$DKS6}BcO7Wc{O*Hn;h~2qlvwmeloZy*pq+!8i5KtpblRQ(@61x{|CVfZ8R7XQc zF_PEG2O`!U(0y71)ZU{jqo|HTn?0wTm@}6~Ei?>bAcD40y?P delta 627 zcmaJ+yGlbr5S`Urycb<35tAUv=79u@prH8xixl|)1zQ(4Ya=P#t74Vp0|Jp$Hi|zW zgcMd57FLQsppA`{jg44|GdGEXi0or#XV08-rqvRymgr{0#!0p+Hu~EaSivWlzyaU@ zZ-1729<3Ys$LhB`vUj68P31ddHJzjSzH!!Zq+LjPu(-^B{H-Zy&Kze(TWuVGI4+fa z?JQThZkcC<(bl+yc@K(3pBq?$Dp6n#e1MPglJ9hLDE`e&5N05(&d!j95?f$jB(J%X zt&SM3{{1~wDi{)tEg3r(c#u{>#K98AHk~FfjSOQ6H`X>bJH_fj=!s`A zU0kG|#4I9lrv25mN~IEA_zLly2brWF)?G*?4srFnk}P { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.text(); + }) + .then(data => { + homeClanList.innerHTML = data; + oppClanList.innerHTML = data; + }) + .catch(error => { + console.error('There has been a problem with your fetch operation:', error); + }); +} diff --git a/templates/components/header.html b/templates/components/header.html index ec06537..95d120a 100644 --- a/templates/components/header.html +++ b/templates/components/header.html @@ -3,7 +3,7 @@ Infantry Skill Calculator - + diff --git a/templates/components/home_clan_bar.html b/templates/components/home_clan_bar.html index 7a71974..7324f84 100644 --- a/templates/components/home_clan_bar.html +++ b/templates/components/home_clan_bar.html @@ -6,7 +6,7 @@
- @@ -26,7 +26,6 @@ diff --git a/templates/components/opp_clan_bar.html b/templates/components/opp_clan_bar.html index ebff250..9bbf378 100644 --- a/templates/components/opp_clan_bar.html +++ b/templates/components/opp_clan_bar.html @@ -6,7 +6,7 @@
-