Add completions
Some checks are pending
CI / scan_ruby (push) Waiting to run
CI / scan_js (push) Waiting to run
CI / lint (push) Waiting to run
CI / test (push) Waiting to run

This commit is contained in:
sto
2025-03-20 11:12:55 +01:00
parent 44507bb85c
commit a03907f756
20 changed files with 213 additions and 14 deletions

View File

@@ -0,0 +1,19 @@
= form_with model: completion, url: url, method: method do |form|
.row.mb-3
.col
.form-floating
= form.text_field :time_seconds, autocomplete: "off", class: "form-control"
= form.label :time_seconds, class: "required"
.row.mb-3
.col
.form-floating
= form.select :contestant_id, @contestants.map { |contestant| [contestant.name, contestant.id] }, {}, class: "form-select"
= form.label :contestant_id
.row.mb-3
.col
.form-floating
= form.select :puzzle_id, @puzzles.map { |puzzle| ["#{puzzle.name} - #{puzzle.brand}", puzzle.id] }, {}, class: "form-select"
= form.label :puzzle_id
.row
.col
= form.submit submit_text, class: "btn btn-primary"

View File

@@ -0,0 +1 @@
= render "form", contest: @contest, completion: @completion, submit_text: "Save", method: :patch, url: "/contests/#{@contest.id}/completions/#{@completion.id}"

View File

@@ -0,0 +1 @@
= render "form", completion: @completion, submit_text: "Create", method: :post, url: "/contests/#{@contest.id}/completions"