Skip to content

Commit

Permalink
Add the fields for error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ahukkanen committed May 7, 2024
1 parent da118a7 commit 26d0fe8
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/commands/decidim/plans/admin/update_sections.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def update_sections
handle: form_section.handle,
body: form_section.body_text,
help: form_section.help,
error_text: form_section.error_text,
information_label: form_section.information_label,
information: form_section.information,
mandatory: form_section.mandatory,
Expand Down
1 change: 1 addition & 0 deletions app/forms/decidim/plans/admin/section_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class SectionForm < Decidim::Form
translatable_attribute :body, String
translatable_attribute :body_rich, String
translatable_attribute :help, String
translatable_attribute :error_text, String
translatable_attribute :information_label, String
translatable_attribute :information, String
attribute :visible_form, Boolean, default: true
Expand Down
9 changes: 9 additions & 0 deletions app/views/decidim/plans/admin/sections/_section.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,15 @@
) %>
</div>

<div class="row column" data-section-type-inverse="content">
<%= form.translated(
:text_field,
:error_text,
tabs_id: id,
label: t(".error_text")
) %>
</div>

<div class="row column" data-section-type-inverse="content">
<%= form.translated(
:text_field,
Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ en:
attachments_input_type: Attachments input type
body: Body
down: Down
error_text: Text for invalid input
handle: Handle
help: Help
information: Information
Expand Down
1 change: 1 addition & 0 deletions config/locales/fi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ fi:
attachments_input_type: Liitteiden syöttökentän tyyppi
body: Runkoteksti
down: Alas
error_text: Virheellisen syötteen teksti
handle: Tunniste
help: Ohjeteksti
information: Tietoa-osio
Expand Down
1 change: 1 addition & 0 deletions config/locales/sv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ sv:
attachments_input_type: Inmatningsfält typ av bilaga
body: Brödtext
down: Ner
error_text: Text för ogiltig inmatning
handle: Identifierare
help: Hjälp
information: Information
Expand Down
7 changes: 7 additions & 0 deletions db/migrate/20240502083422_add_error_text_to_plan_sections.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

class AddErrorTextToPlanSections < ActiveRecord::Migration[6.1]
def change
add_column :decidim_plans_sections, :error_text, :jsonb
end
end

0 comments on commit 26d0fe8

Please sign in to comment.