Shiny forms
This commit is contained in:
@@ -8,6 +8,8 @@ class CompletionsController < ApplicationController
|
||||
|
||||
def edit
|
||||
authorize @contest
|
||||
|
||||
@pieces_radio = "remaining"
|
||||
end
|
||||
|
||||
def new
|
||||
|
||||
@@ -68,12 +68,12 @@
|
||||
input.btn-check type="radio" name="completed_radio" id="completed_radio_yes" value="yes" checked=""
|
||||
- else
|
||||
input.btn-check type="radio" name="completed_radio" id="completed_radio_yes" value="yes"
|
||||
label.btn.btn-secondary for="completed_radio_yes" = t("completions.form.completed_yes")
|
||||
label.btn.btn-light for="completed_radio_yes" = t("completions.form.completed_yes")
|
||||
- if @completion.completed == false
|
||||
input.btn-check type="radio" name="completed_radio" id="completed_radio_no" value="no" checked=""
|
||||
- else
|
||||
input.btn-check type="radio" name="completed_radio" id="completed_radio_no" value="no"
|
||||
label.ms-2.btn.btn-secondary for="completed_radio_no" = t("completions.form.completed_no")
|
||||
label.ms-2.btn.btn-light for="completed_radio_no" = t("completions.form.completed_no")
|
||||
|
||||
javascript:
|
||||
savetime = "";
|
||||
@@ -167,12 +167,12 @@
|
||||
input.btn-check type="radio" name="pieces_radio" id="pieces_radio_assembled" value="assembled" checked=""
|
||||
- else
|
||||
input.btn-check type="radio" name="pieces_radio" id="pieces_radio_assembled" value="assembled"
|
||||
label.btn.btn-secondary for="pieces_radio_assembled" = t("completions.form.pieces_radio_assembled")
|
||||
label.btn.btn-light for="pieces_radio_assembled" = t("completions.form.pieces_radio_assembled")
|
||||
- if @pieces_radio == "remaining"
|
||||
input.btn-check type="radio" name="pieces_radio" id="pieces_radio_remaining" value="remaining" checked=""
|
||||
- else
|
||||
input.btn-check type="radio" name="pieces_radio" id="pieces_radio_remaining" value="remaining"
|
||||
label.ms-2.btn.btn-secondary for="pieces_radio_remaining" = t("completions.form.pieces_radio_remaining")
|
||||
label.ms-2.btn.btn-light for="pieces_radio_remaining" = t("completions.form.pieces_radio_remaining")
|
||||
|
||||
/ Remaining_pieces_field
|
||||
.form-floating.mt-3 id="remaining_pieces_field" style="display: #{@pieces_radio != nil ? "" : "none"};"
|
||||
|
||||
Reference in New Issue
Block a user