Use previously extracted model constants in form maxlength
attributes (#32113)
This commit is contained in:
parent
04dd3a9eb6
commit
e02e88bff4
5 changed files with 10 additions and 8 deletions
|
@ -25,7 +25,7 @@
|
|||
.fields-group
|
||||
= f.input :site_short_description,
|
||||
as: :text,
|
||||
input_html: { rows: 2, maxlength: 200 },
|
||||
input_html: { rows: 2, maxlength: Form::AdminSettings::DESCRIPTION_LIMIT },
|
||||
wrapper: :with_block_label
|
||||
|
||||
.fields-row
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
= f.simple_fields_for :account do |ff|
|
||||
= ff.input :username,
|
||||
append: "@#{site_hostname}",
|
||||
input_html: { 'aria-label': t('simple_form.labels.defaults.username'), autocomplete: 'off', placeholder: t('simple_form.labels.defaults.username'), pattern: '[a-zA-Z0-9_]+', maxlength: 30 },
|
||||
input_html: { 'aria-label': t('simple_form.labels.defaults.username'), autocomplete: 'off', placeholder: t('simple_form.labels.defaults.username'), pattern: '[a-zA-Z0-9_]+', maxlength: Account::USERNAME_LENGTH_LIMIT },
|
||||
label: false,
|
||||
required: true,
|
||||
wrapper: :with_label
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
|
||||
= simple_form_for(@appeal, url: disputes_strike_appeal_path(@strike)) do |f|
|
||||
.fields-group
|
||||
= f.input :text, wrapper: :with_label, input_html: { maxlength: 500 }
|
||||
= f.input :text, wrapper: :with_label, input_html: { maxlength: Appeal::TEXT_LENGTH_LIMIT }
|
||||
|
||||
.actions
|
||||
= f.button :button, t('disputes.strikes.appeals.submit'), type: :submit
|
||||
|
|
|
@ -15,10 +15,10 @@
|
|||
.fields-row
|
||||
.fields-row__column.fields-row__column-6
|
||||
.fields-group
|
||||
= f.input :display_name, wrapper: :with_block_label, input_html: { maxlength: 30, data: { default: @account.username } }
|
||||
= f.input :display_name, wrapper: :with_block_label, input_html: { maxlength: Account::DISPLAY_NAME_LENGTH_LIMIT, data: { default: @account.username } }
|
||||
|
||||
.fields-group
|
||||
= f.input :note, wrapper: :with_block_label, input_html: { maxlength: 500 }
|
||||
= f.input :note, wrapper: :with_block_label, input_html: { maxlength: Account::NOTE_LENGTH_LIMIT }
|
||||
|
||||
.fields-row__column.fields-group.fields-row__column-6
|
||||
.input.with_block_label
|
||||
|
@ -27,8 +27,8 @@
|
|||
|
||||
= f.simple_fields_for :fields do |fields_f|
|
||||
.row
|
||||
= fields_f.input :name, placeholder: t('simple_form.labels.account.fields.name'), input_html: { maxlength: 255 }
|
||||
= fields_f.input :value, placeholder: t('simple_form.labels.account.fields.value'), input_html: { maxlength: 255 }
|
||||
= fields_f.input :name, placeholder: t('simple_form.labels.account.fields.name'), input_html: { maxlength: Account::Field::MAX_CHARACTERS_LOCAL }
|
||||
= fields_f.input :value, placeholder: t('simple_form.labels.account.fields.value'), input_html: { maxlength: Account::Field::MAX_CHARACTERS_LOCAL }
|
||||
|
||||
.fields-row
|
||||
.fields-row__column.fields-row__column-6
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue