Messages to completions conversion
Some checks failed
CI / scan_ruby (push) Failing after 15s
CI / scan_js (push) Successful in 11s
CI / lint (push) Successful in 14s
CI / test (push) Successful in 31s

This commit is contained in:
sto
2025-05-15 08:57:25 +02:00
parent e65d639ca6
commit c4902d85d5
16 changed files with 127 additions and 20 deletions

View File

@@ -1,9 +1,21 @@
= form_with model: completion, url: url, method: method do |form|
- if @message
.row.mb-3
.col
h4 = t("messages.singular").capitalize
.alert.alert-secondary
b
= @message.author
br
= @message.text
.row
.col
h4 = t("completions.singular").capitalize
.row.mb-3
.col
.form-floating
= form.text_field :time_seconds, autocomplete: "off", class: "form-control"
= form.label :time_seconds, class: "required"
= form.text_field :display_time_from_start, autocomplete: "off", class: "form-control"
= form.label :display_time_from_start, class: "required"
.row.mb-3
.col
.form-floating

View File

@@ -51,17 +51,21 @@
tr
th scope="col"
| Time
th scope="col"
| Author
th scope="col"
| Text
tbody
- @messages.each do |message|
tr.align-middle scope="row"
td
= message.time_seconds
= message.display_time
td
= message.author
td
= message.text
td
a.btn.btn-sm.btn-secondary href="" style="white-space: nowrap;"
a.btn.btn-sm.btn-secondary href=contest_message_convert_path(@contest, message) style="white-space: nowrap;"
| Add completion
td
= link_to "Delete", contest_message_path(@contest, message), data: { turbo_method: :delete }, class: "btn btn-sm btn-danger"