Implement edit-player. Optimizations.

This commit is contained in:
MaxJa4
2024-01-16 20:54:49 +01:00
parent fc084108ac
commit 94e0c178f0
14 changed files with 100 additions and 35 deletions

View File

@@ -46,7 +46,7 @@ func GetPlayersByClanHTML(c *gin.Context) {
var htmlOptions string
for _, player := range players {
htmlOptions += fmt.Sprintf(playerItem, player.Name, player.ID)
htmlOptions += fmt.Sprintf(playerItem, player.Name, player.ID, player.ID)
}
c.Header("Content-Type", "text/html")
@@ -124,13 +124,13 @@ func UpdatePlayerByID(c *gin.Context) {
}
}
msg := "Updating player '" + player.Name + "'#" + strconv.FormatUint(uint64(player.ID), 10)
msg := "Updating player '" + player.Name + "' #" + strconv.FormatUint(uint64(player.ID), 10)
if player.Name != input.Name {
msg += " (new: '" + input.Name + "')"
}
msg += " with clan #" + utils.UintToString(player.ClanID)
if player.ClanID != input.ClanID {
msg += " (new: ä" + utils.UintToString(input.ClanID) + ")"
msg += " (new: #" + utils.UintToString(input.ClanID) + ")"
}
_, err := fmt.Fprintf(utils.GinWriter, msg+"\n")
if err != nil {