~ethanmad/bouts.app

c714549c — Ethan Madison 28 days ago master
controllers/seeding: Add number of games to output

This commit will include the number of bouts or matches to the generated seeding
file.

Signed-off-by: Ethan Madison <ethan@ethanmad.com>
54a5c4a2 — Ethan Madison 28 days ago
models/seeding: Add NumGames to Seeding

This commit adds the NumGames field to the Seeding struct, which
represents the number of bouts (including byes) or matches in which a fencer or
squad, respectively, has participated. This may be useful for
eligibility purposes.

Signed-off-by: Ethan Madison <ethan@ethanmad.com>
35d00c5c — Ethan Madison 1 year, 17 days ago
scripts/deploy: Add command to stop service

This commit adds an additional systemctl command which will stop the
relevant bouts.app service before copying the server binary. This is
necessary because the server binary is in use while the service is
running, and it cannot be changed while in use. As a result, the server binary
could be out of date with the database, assets, and views.

Instead of restarting the caddy service (and momentarily taking down
everything served by caddy), we can use `caddy reload` to reload the
Caddyfile in place.

Deploying should now be graceful.

Signed-off-by: Ethan Madison <ethan@ethanmad.com>
cff3c051 — Ethan Madison 1 year, 17 days ago
email: Add more descriptive reset email subject

This commit adds "bouts.app" into the subject line for password reset
emails so that users can more easily recognize our emails.

Signed-off-by: Ethan Madison <ethan@ethanmad.com>
Add 'domain' field to README config.json
8d4da04e — Ethan Madison 1 year, 17 days ago
controllers/users: Fix password reset views paths

A couple of forgotten slashes broke the app on remote with 404 but the app still
worked on localhost. This fixes the 404 error.
56d86144 — Ethan Madison 1 year, 17 days ago
Update dependencies to latest minor/patch versions

Performed by `go get -u ./...`

Signed-off-by: Ethan Madison <ethan@ethanmad.com>
b96d6bee — Ethan Madison 1 year, 20 days ago
go.mod: Update dependencies and go version

Signed-off-by: Ethan Madison <ethan@ethanmad.com>
f714b9a4 — Ethan Madison 1 year, 20 days ago
Caddyfile: add mfc.bouts.app
Added views, controllers, and models for PW resets.
NOTE: formatting for views/users/forgot_pw.gohtml must be fixed.
NOTE: config.json on server must add domain and mailgun fields.
Add total bout record to fencer Show page

Accomplished by pulling all bouts (setting byes) and filtering
the bouts with byes set in the controller.
9de76f3b — Ethan Madison 1 year, 3 months ago
views: add draw support to Squads using record fn

I modified the record function inside NewView to take draws as a third
parameter, and assigned draws a weight of ½ of a win (standard for win%
calculations).

I had to change both referrers to the record function: Show view for
Squads and Fencers. For the Fencer view, we use a constant of 0 for
draws since bouts between actual fencers cannot end in a draw.

Signed-off-by: Ethan Madison <ethan@ethanmad.com>
16cdf227 — Ethan Madison 1 year, 3 months ago
controllers/squads: add draw support to Show

Still need to add support in the view.

Related to issue #16.

Signed-off-by: Ethan Madison <ethan@ethanmad.com>
bd54edda — Ethan Madison 1 year, 3 months ago
models/squads: add Draws field on Squad

Matches can result in Draws due to byes.

Related to issue #16.

Signed-off-by: Ethan Madison <ethan@ethanmad.com>
cf8ba0aa — Ethan Madison 1 year, 3 months ago
models/matches: Add SquadIsLoser on Match

In combination with SquadIsWinner, we can use SquadIsLoser to tally
match wins, losses, and draws for a squad.

Related to ticket #16.

Signed-off-by: Ethan Madison <ethan@ethanmad.com>
feec2e6d — Ethan Madison 1 year, 3 months ago
models/matches: add support for byes to matches

This commit corrects calculation of score by tallyScores in matches
contaning missing fencers (or "bye bouts"). To do this, I use a new
method on MatchDB, BoutsByIDWithByes, to get the needed context to
supply the Bout.Winner method.

Related to ticket #16.

Signed-off-by: Ethan Madison <ethan@ethanmad.com>
4a377211 — Ethan Madison 1 year, 3 months ago
models/bouts: add support for byes to bouts

This commit adds ByeLeft and ByeRight fields to the Bout struct. Using
these fields, we can allow tie-score matches in byes and calculate
the "winner" of a bout (only applies toward the match, not for a fencer)
when a fencer is missing.

Related to ticket #16.

Signed-off-by: Ethan Madison <ethan@ethanmad.com>
c701f1d6 — Ethan Madison 1 year, 3 months ago
models/fencers: exclude bouts with byes from BoutsByID{,s}

These two methods get used in seeding calculations, where we want to
ignore bouts with fewer than two fencers.

Gorm v2 allows chaining Where and Or rather than writing in plain SQL,
so we should consider updating after finishing this ticket.

Related to ticket #16.

Signed-off-by: Ethan Madison <ethan@ethanmad.com>
e81a3fde — Ethan Madison 1 year, 3 months ago
controllers/matches: include bye fencers in Edit

Use the new FencersByIDWithByes method I just wrote to include bye
fencers in the Edit screen so that matches support missing fencers.

Related to ticket #16.

Signed-off-by: Ethan Madison <ethan@ethanmad.com>
bdc7bbbc — Ethan Madison 1 year, 3 months ago
models/squads: add FencersByIDWithByes on SquadDB

FencersByIDWithByes can be used by the Match controller to render bye fencers
as well as actual fencers.

Related to ticket #16.

Signed-off-by: Ethan Madison <ethan@ethanmad.com>
Next