Implement edit-player. Optimizations.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user