Refactor project structure and update configurations. Now first working version

- Updated `.air.conf` for Nix compatibility and simplified build commands.
- Enhanced `.gitignore` to include `tmp` directory.
- Improved `README.md` with clearer instructions and added language details.
- Refined CSS styles for better UI consistency and added alert styles.
- Upgraded `flake.nix` to use Go 1.24 and improved shell environment setup.
- Modified authentication logic in `auth.go` for better user handling.
- Updated `main.go` to dynamically set the listening port and improved logging.
- Added new `routes.go` file for handling game entry and history.
- Enhanced user models and added statistics tracking in `models.go`.
- Improved template rendering and added user feedback messages in HTML templates.
- Removed obsolete build error logs and binaries.
This commit is contained in:
Jonas Hahn
2025-08-24 12:08:14 +02:00
parent c9a3196ccb
commit 4b4377a24e
19 changed files with 376 additions and 278 deletions

View File

@@ -5,12 +5,14 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{block "title" .}}QRank{{end}}</title>
<title>QRank</title>
<!-- Also apple support -->
<link rel="icon" type="image/png" href="/assets/favicon.ico">
<link rel="apple-touch-icon" href="/assets/favicon.ico">
<link rel="shortcut icon" href="/assets/favicon.ico">
<!-- Only one stylesheet for now -->
<link rel="stylesheet" href="/assets/styles.css">
</head>
@@ -18,12 +20,14 @@
<div class="header">
<div class="container">
<div class="row" style="justify-content:space-between;align-items:center">
<div><strong><a href="/" style="text-decoration:none;color:#111">QRank</a></strong></div>
<div><strong><a href="/" style="text-decoration:none;color:#111">{{block "title" .}}QRank{{end}}</a></strong></div>
<!-- Navigation menu -->
<div class="nav">
{{if .CurrentUser}}
<a href="/enter">Enter scores</a>
<a href="/history">History</a>
<a href="/leaderboard">Leaderboard</a>
{{if .CurrentUser}}
<a href="/me">@{{.CurrentUser.Username}}</a>
{{else}}
<a href="/login">Log in</a>
@@ -33,6 +37,17 @@
</div>
</div>
<div class="container">
<!-- Information messages for the user -->
{{if .Error}}
<div class="alert alert-error">{{.Error}}</div>
{{end}}
{{if .Success}}
<div class="alert alert-success">{{.Success}}</div>
{{end}}
{{if .Message}}
<div class="alert alert-info">{{.Message}}</div>
{{end}}
<!-- This is shorthand for a define along with a template -->
{{block "content" .}}{{end}}
</div>