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 c2658a3..ce19e86 100644 Binary files a/isc_data.db and b/isc_data.db differ diff --git a/static/index.js b/static/index.js index 513c65a..075d833 100644 --- a/static/index.js +++ b/static/index.js @@ -69,4 +69,24 @@ function getSelectedClan(event) { const clanList = document.querySelector(clanListId); return clanList.options[clanList.selectedIndex]; -} \ No newline at end of file +} + +function loadClans() { + const homeClanList = document.getElementById('home-clan'); + const oppClanList = document.getElementById('opponent-clan'); + + fetch('/clans_html') + .then(response => { + 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 @@
-