Made the elo system work. Colorized the leaderboard. Better data structure. Improved the HTML. Custom form system. Added Sessions

This commit is contained in:
Jonas Hahn
2025-08-25 14:56:59 +02:00
parent 4b4377a24e
commit f5e5d5632d
20 changed files with 492 additions and 289 deletions

View File

@@ -1,14 +1,15 @@
{{define "content"}}
<div class="card">
<h2>@{{.Viewed.Username}}</h2>
<p class="small">Joined {{fmtTime .Viewed.CreatedAt}}</p>
<p>Game score {{.Stats.Games}}/{{.Stats.Wins}}/{{.Stats.Losses}}</p>
<h2>@{{.User.Username}}</h2>
<p class="small">Joined {{fmtTime .User.CreatedAt}}</p>
<p>Game score {{.User.GameCount}}/{{.User.WinCount}}/{{.User.LossCount}}</p>
<p>Current Elo {{.User.Elo}}</p>
{{if .Own}}
<hr>
<h3>Update your profile</h3>
<form method="POST" action="/me">
<label class="label">Username</label>
<input class="input" name="username" value="{{.Viewed.Username}}" required>
<input class="input" name="username" value="{{.User.Username}}" required>
<div style="height:8px"></div>
<button class="btn btn-primary">Save</button>
</form>