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:
@@ -1,31 +1,41 @@
|
||||
{{define "title"}}Enter scores - QRank{{end}}
|
||||
{{define "title"}}QRank{{end}}
|
||||
{{define "content"}}
|
||||
<div class="card">
|
||||
<h2>Enter a game</h2>
|
||||
{{if .Table}}<p class="small">Table: <span class="badge">{{.Table.Name}}</span></p>{{end}}
|
||||
<form method="POST" action="{{.PostAction}}">
|
||||
|
||||
{{if .Table}}
|
||||
<p class="small">Table: <span class="badge">{{.Table.Name}}</span></p>
|
||||
{{end}}
|
||||
|
||||
<form method="POST" action="/enter">
|
||||
<div class="row">
|
||||
<div style="flex:1;min-width:280px">
|
||||
<div style="flex:1;min-width:180px">
|
||||
<h3>Team A</h3>
|
||||
<label class="label">Player A1</label>
|
||||
<input class="input" name="a1" value="{{.CurrentUser.Username}}">
|
||||
<input class="input" name="a1" {{if .a1}}value="{{.a1}}"{{else}}value="{{.CurrentUser.Username}}"{{end}} placeholder="username or email">
|
||||
<div style="height:6px"></div>
|
||||
<label class="label">Player A2 (optional)</label>
|
||||
<input class="input" name="a2" placeholder="username or email">
|
||||
<input class="input" name="a2" {{if .a2}}value="{{.a2}}"{{end}} placeholder="username or email">
|
||||
<div style="height:12px"></div>
|
||||
<label class="label">Score A</label>
|
||||
<input class="input" type="number" name="scoreA" value="10" min="0" required>
|
||||
<input class="input" type="number" name="scoreA" {{if .scoreA}}value="{{.scoreA}}"{{else}}value="0"{{end}} min="0" max="10" required>
|
||||
</div>
|
||||
<div style="flex:1;min-width:280px">
|
||||
|
||||
<div style="flex:1;min-width:180px">
|
||||
<h3>Team B</h3>
|
||||
<label class="label">Player B1</label>
|
||||
<input class="input" name="b1" placeholder="username or email">
|
||||
<input class="input" name="b1" {{if .b1}}value="{{.b1}}"{{end}} placeholder="username or email">
|
||||
<div style="height:6px"></div>
|
||||
<label class="label">Player B2 (optional)</label>
|
||||
<input class="input" name="b2" placeholder="username or email">
|
||||
<input class="input" name="b2" {{if .b2}}value="{{.b2}}"{{end}} placeholder="username or email">
|
||||
<div style="height:12px"></div>
|
||||
<label class="label">Score B</label>
|
||||
<input class="input" type="number" name="scoreB" value="8" min="0" required>
|
||||
<input class="input" type="number" name="scoreB" {{if .scoreB}}value="{{.scoreB}}"{{else}}value="0"{{end}} min="0" max="10" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="height:12px"></div>
|
||||
<button class="btn btn-primary" type="submit">Submit result</button>
|
||||
</form>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
||||
Reference in New Issue
Block a user