diff --git a/app/views/account/show.html.erb b/app/views/account/show.html.erb index 5fe455a6f..3e42cc588 100644 --- a/app/views/account/show.html.erb +++ b/app/views/account/show.html.erb @@ -32,12 +32,12 @@
<% if @account.organization? %> <%= f.fields_for :organization do |fo| %> - <%= fo.text_field :name, autofocus: true, placeholder: t("account.show.organization_name_label") %> + <%= fo.text_field :name, autofocus: true, maxlength: Organization::NAME_LENGTH[:maximum], placeholder: t("account.show.organization_name_label") %> <% end %> <%= f.text_field :phone_number, placeholder: t("account.show.phone_number_label") %> <% else %> - <%= f.text_field :username, placeholder: t("account.show.username_label") %> + <%= f.text_field :username, maxlength: User::USERNAME_LENGTH[:maximum], placeholder: t("account.show.username_label") %> <% end %>
diff --git a/app/views/comments/_form.html.erb b/app/views/comments/_form.html.erb index 5c9f4eab2..7efe50110 100644 --- a/app/views/comments/_form.html.erb +++ b/app/views/comments/_form.html.erb @@ -2,7 +2,7 @@
> <%= form_for [commentable, Comment.new], remote: true do |f| %> <%= label_tag "comment-body-#{css_id}", t("comments.form.leave_comment") %> - <%= f.text_area :body, id: "comment-body-#{css_id}", label: false %> + <%= f.text_area :body, id: "comment-body-#{css_id}", maxlength: Comment::BODY_LENGTH[:maximum], label: false %> <%= f.hidden_field :commentable_type, value: commentable.class.name %> <%= f.hidden_field :commentable_id, value: commentable.id %> <%= f.hidden_field :parent_id, value: parent_id %> diff --git a/app/views/debates/_form.html.erb b/app/views/debates/_form.html.erb index e9d750c8a..c320b33ca 100644 --- a/app/views/debates/_form.html.erb +++ b/app/views/debates/_form.html.erb @@ -4,12 +4,12 @@
<%= f.label :title, t("debates.form.debate_title") %> - <%= f.text_field :title, maxlength: Debate::TITLE_LENGTH, placeholder: t("debates.form.debate_title"), label: false %> + <%= f.text_field :title, maxlength: Debate::TITLE_LENGTH[:maximum], placeholder: t("debates.form.debate_title"), label: false %>
<%= f.label :description, t("debates.form.debate_text") %> - <%= f.cktext_area :description, ckeditor: { language: I18n.locale }, label: false %> + <%= f.cktext_area :description, maxlength: Debate::DESCRIPTION_LENGTH[:maximum], ckeditor: { language: I18n.locale }, label: false %>
diff --git a/app/views/organizations/registrations/new.html.erb b/app/views/organizations/registrations/new.html.erb index ce7f5a0d2..7aa23187d 100644 --- a/app/views/organizations/registrations/new.html.erb +++ b/app/views/organizations/registrations/new.html.erb @@ -6,7 +6,7 @@
<%= f.fields_for :organization do |fo| %> - <%= fo.text_field :name, autofocus: true, placeholder: t("devise_views.organizations.registrations.new.organization_name_label") %> + <%= fo.text_field :name, autofocus: true, maxlength: Organization::NAME_LENGTH[:maximum], placeholder: t("devise_views.organizations.registrations.new.organization_name_label") %> <% end %> <%= f.email_field :email, placeholder: t("devise_views.organizations.registrations.new.email_label") %> diff --git a/app/views/users/registrations/new.html.erb b/app/views/users/registrations/new.html.erb index cf3d82c6a..913ae4e01 100644 --- a/app/views/users/registrations/new.html.erb +++ b/app/views/users/registrations/new.html.erb @@ -15,7 +15,7 @@ <%= f.label t("devise_views.users.registrations.new.username_label") %> <%= t("devise_views.users.registrations.new.username_note") %> - <%= f.text_field :username, placeholder: t("devise_views.users.registrations.new.username_label"), label: false %> + <%= f.text_field :username, maxlength: User::USERNAME_LENGTH[:maximum], placeholder: t("devise_views.users.registrations.new.username_label"), label: false %> <%= f.email_field :email, placeholder: t("devise_views.users.registrations.new.email_label") %>