Skip to content

Commit

Permalink
Disables autocalculated cells
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniBitZesty committed Aug 8, 2023
1 parent 12ecfe7 commit dd64f48
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/views/qae_form/_matrix_question.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ table.matrix-question-table.govuk-table class="#{'auto-totals-column' if questio
= heading.label
tbody
- question.y_headings.each do |y_heading|
- disabled_row_input = y_heading.options[:row_class] == "auto-subtotals-row" || y_heading.options[:row_class] == "auto-totals-row" || y_heading.options[:row_class] == "auto-proportion-row"
tr.govuk-table__row class="#{y_heading.options[:row_class] ? y_heading.options[:row_class] : ''}"
td.govuk-table__header.row-heading scope="row"
= y_heading.label
- question.x_headings.each do |x_heading|
- disabled_col_input = x_heading.label == "Total (system calculated)"
td.govuk-form-group.govuk-table__cell
div
label.visuallyhidden-on-desktop.govuk-label for=question.input_name(suffix: "#{x_heading.key}_#{y_heading.key}")
= "#{y_heading.label} numbers for #{x_heading.label}"
input.js-trigger-autosave.matrix-question-input.govuk-input type="number" data-required-row-parent=question.required_row_parent min="0" step="1" name=question.input_name(suffix: "#{x_heading.key}_#{y_heading.key}") value=question.input_value(suffix: "#{x_heading.key}_#{y_heading.key}") id=question.input_name(suffix: "#{x_heading.key}_#{y_heading.key}") autocomplete="off" *possible_read_only_ops aria-describedby=(@form_answer.validator_errors && @form_answer.validator_errors[question.hash_key] ? "error_for_#{question.key}" : nil )
input.js-trigger-autosave.matrix-question-input.govuk-input type="number" disabled=(disabled_row_input || disabled_col_input) data-required-row-parent=question.required_row_parent min="0" step="1" name=question.input_name(suffix: "#{x_heading.key}_#{y_heading.key}") value=question.input_value(suffix: "#{x_heading.key}_#{y_heading.key}") id=question.input_name(suffix: "#{x_heading.key}_#{y_heading.key}") autocomplete="off" *possible_read_only_ops aria-describedby=(@form_answer.validator_errors && @form_answer.validator_errors[question.hash_key] ? "error_for_#{question.key}" : nil )
span.govuk-error-message aria-live="polite"
- if @form_answer.validator_errors && @form_answer.validator_errors["#{question.hash_key}_#{x_heading.key}_#{y_heading.key}"].present?
| Required
Expand Down

0 comments on commit dd64f48

Please sign in to comment.