-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
There was an issue in which multiple forms were being created and this make image uploading failed. This fixes the issue by making sure only one form is created.
- Loading branch information
Showing
18 changed files
with
145 additions
and
161 deletions.
There are no files selected for viewing
55 changes: 27 additions & 28 deletions
55
app/components/mcm/banner_component/banner_component.html+admin.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,30 @@ | ||
- render "mcm/component_form", component: @component do |component_form| | ||
- component_form.fields_for :metadata, @component.metadata do |metadata_form| | ||
.row | ||
.col-6= metadata_form.text_field :title, required: true | ||
.col-6= metadata_form.select :title_color, available_text_colors, required: true | ||
- @component_form.fields_for :metadata, @component.metadata do |metadata_form| | ||
.row | ||
.col-6= metadata_form.text_field :title, required: true | ||
.col-6= metadata_form.select :title_color, available_text_colors, required: true | ||
|
||
= metadata_form.label :content | ||
= metadata_form.hidden_field :content, required: true | ||
%trix-editor{ input: 'components_page_metadata_content' } | ||
= metadata_form.label :content | ||
= metadata_form.hidden_field :content, required: true | ||
%trix-editor{ input: 'components_page_metadata_content' } | ||
|
||
.row.mt-3 | ||
.col-6 | ||
= metadata_form.select :content_color, available_text_colors | ||
.col-6 | ||
= metadata_form.select :content_alignment, text_alignments, required: true | ||
.row | ||
.col-6 | ||
= metadata_form.text_field :cta, required: true, label: 'CTA' | ||
.col-6 | ||
= metadata_form.text_field :cta_url, required: true, label: 'URL' | ||
.row | ||
.col-6 | ||
= metadata_form.select :button_color, available_button_colors | ||
.row.mt-3 | ||
.col-6 | ||
= metadata_form.select :content_color, available_text_colors | ||
.col-6 | ||
= metadata_form.select :content_alignment, text_alignments, required: true | ||
.row | ||
.col-6 | ||
= metadata_form.text_field :cta, required: true, label: 'CTA' | ||
.col-6 | ||
= metadata_form.text_field :cta_url, required: true, label: 'URL' | ||
.row | ||
.col-6 | ||
= metadata_form.select :button_color, available_button_colors | ||
|
||
- 2.times { @component.assets.build } if @component.assets.empty? | ||
- component_form.fields_for :assets do |assets_form| | ||
= assets_form.hidden_field :position, value: assets_form.index + 1 | ||
= render Mcm::ImageComponent.new(form: assets_form, | ||
styles: image_preview_styles(variant_for(assets_form.index)), | ||
variant: variant_for(assets_form.index), | ||
label: t("custom_pages.components.banner.image_#{assets_form.index + 1}")) | ||
- 2.times { @component.assets.build } if @component.assets.empty? | ||
- @component_form.fields_for :assets do |assets_form| | ||
= assets_form.hidden_field :position, value: assets_form.index + 1 | ||
= render Mcm::ImageComponent.new(form: assets_form, | ||
styles: image_preview_styles(variant_for(assets_form.index)), | ||
variant: variant_for(assets_form.index), | ||
label: t("custom_pages.components.banner.image_#{assets_form.index + 1}")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 13 additions & 14 deletions
27
app/components/mcm/columns_component/columns_component.html+admin.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
- render "mcm/component_form", component: @component do |component_form| | ||
- component_form.fields_for :metadata, @component.metadata do |metadata_form| | ||
= metadata_form.text_field :section_title, help: t('custom_pages.messages.leave_empty') | ||
.row | ||
.col-6 | ||
= metadata_form.select :section_title_alignment, text_alignments, required: true | ||
.col-6 | ||
= metadata_form.select :section_title_color, available_text_colors, required: true | ||
- @component_form.fields_for :metadata, @component.metadata do |metadata_form| | ||
= metadata_form.text_field :section_title, help: t('custom_pages.messages.leave_empty') | ||
.row | ||
.col-6 | ||
= metadata_form.select :section_title_alignment, text_alignments, required: true | ||
.col-6 | ||
= metadata_form.select :section_title_color, available_text_colors, required: true | ||
|
||
.row | ||
.col-6 | ||
= metadata_form.text_field :background_color, label: t('custom_pages.components.background_color'), help: '#ffffff' | ||
.col-6 | ||
= metadata_form.number_field :height, label: t('custom_pages.components.height.label'), help: t('custom_pages.components.height.help') | ||
= metadata_form.check_box :full_width, label: t('custom_pages.components.full_width'), custom: :switch | ||
.row | ||
.col-6 | ||
= metadata_form.text_field :background_color, label: t('custom_pages.components.background_color'), help: '#ffffff' | ||
.col-6 | ||
= metadata_form.number_field :height, label: t('custom_pages.components.height.label'), help: t('custom_pages.components.height.help') | ||
= metadata_form.check_box :full_width, label: t('custom_pages.components.full_width'), custom: :switch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 3 additions & 4 deletions
7
app/components/mcm/hero_image_component/hero_image_component.html+admin.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
- render "mcm/component_form", component: @component do |component_form| | ||
- @component.assets.first_or_initialize | ||
- component_form.fields_for :assets do |assets_form| | ||
= render Mcm::ImageComponent.new(form: assets_form, variant: :desktop, styles: image_preview_styles) | ||
- @component.assets.first_or_initialize | ||
- @component_form.fields_for :assets do |assets_form| | ||
= render Mcm::ImageComponent.new(form: assets_form, variant: :desktop, styles: image_preview_styles) |
65 changes: 32 additions & 33 deletions
65
..._image_title_content_cta_component/hero_image_title_content_cta_component.html+admin.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,35 @@ | ||
- render "mcm/component_form", component: @component do |component_form| | ||
- @component.assets.first_or_initialize | ||
- component_form.fields_for :assets do |assets_form| | ||
= render Mcm::ImageComponent.new(form: assets_form, styles: image_preview_styles) | ||
- @component.assets.first_or_initialize | ||
- @component_form.fields_for :assets do |assets_form| | ||
= render Mcm::ImageComponent.new(form: assets_form, styles: image_preview_styles) | ||
|
||
- component_form.fields_for :metadata, @component.metadata do |metadata_form| | ||
.row | ||
.col-6 | ||
= metadata_form.text_field :title, required: true | ||
.col-6 | ||
= metadata_form.select :title_color, available_text_colors, required: true | ||
- @component_form.fields_for :metadata, @component.metadata do |metadata_form| | ||
.row | ||
.col-6 | ||
= metadata_form.text_field :title, required: true | ||
.col-6 | ||
= metadata_form.select :title_color, available_text_colors, required: true | ||
|
||
= metadata_form.label :content | ||
= metadata_form.hidden_field :content, required: true | ||
%trix-editor{ input: 'components_page_metadata_content' } | ||
= metadata_form.label :content | ||
= metadata_form.hidden_field :content, required: true | ||
%trix-editor{ input: 'components_page_metadata_content' } | ||
|
||
.row.mt-3 | ||
.col-6 | ||
= metadata_form.select :content_alignment, text_alignments, required: true | ||
.col-6 | ||
= metadata_form.select :content_vertical_alignment, vertical_alignment_options, required: true | ||
.row | ||
.col-6 | ||
= metadata_form.select :content_color, available_text_colors, required: true | ||
.col-6 | ||
= metadata_form.select :content_horizontal_alignment, horizontal_alignment_options, required: true | ||
.row | ||
.col-6 | ||
= metadata_form.text_field :cta | ||
.col-6 | ||
= metadata_form.text_field :cta_url | ||
.row | ||
.col-6 | ||
= metadata_form.select :button_color, available_button_colors | ||
.col-6 | ||
= metadata_form.select :button_alignment, text_alignments, required: true | ||
.row.mt-3 | ||
.col-6 | ||
= metadata_form.select :content_alignment, text_alignments, required: true | ||
.col-6 | ||
= metadata_form.select :content_vertical_alignment, vertical_alignment_options, required: true | ||
.row | ||
.col-6 | ||
= metadata_form.select :content_color, available_text_colors, required: true | ||
.col-6 | ||
= metadata_form.select :content_horizontal_alignment, horizontal_alignment_options, required: true | ||
.row | ||
.col-6 | ||
= metadata_form.text_field :cta | ||
.col-6 | ||
= metadata_form.text_field :cta_url | ||
.row | ||
.col-6 | ||
= metadata_form.select :button_color, available_button_colors | ||
.col-6 | ||
= metadata_form.select :button_alignment, text_alignments, required: true |
7 changes: 3 additions & 4 deletions
7
app/components/mcm/hero_slider_component/hero_slider_component.html+admin.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
- render "mcm/component_form", component: @component do |component_form| | ||
- component_form.fields_for :metadata, @component.metadata do |metadata_form| | ||
= metadata_form.number_field :height, required: true | ||
= metadata_form.check_box :full_width, label: t('custom_pages.components.full_width'), custom: :switch | ||
- @component_form.fields_for :metadata, @component.metadata do |metadata_form| | ||
= metadata_form.number_field :height, required: true | ||
= metadata_form.check_box :full_width, label: t('custom_pages.components.full_width'), custom: :switch |
2 changes: 1 addition & 1 deletion
2
app/components/mcm/hero_slider_component/hero_slider_component.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 22 additions & 23 deletions
45
...age_title_description_cta_component/image_title_description_cta_component.html+admin.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,23 @@ | ||
- render "mcm/component_form", component: @component do |component_form| | ||
- @component.assets.first_or_initialize | ||
- component_form.fields_for :assets do |assets_form| | ||
= render Mcm::ImageComponent.new(form: assets_form, styles: image_preview_styles, variant: :small) | ||
- @component.assets.first_or_initialize | ||
- @component_form.fields_for :assets do |assets_form| | ||
= render Mcm::ImageComponent.new(form: assets_form, styles: image_preview_styles, variant: :small) | ||
|
||
- component_form.fields_for :metadata, @component.metadata do |metadata_form| | ||
= metadata_form.text_field :title, required: true, help: 'Always centered' | ||
= metadata_form.select :title_color, available_text_colors, required: true | ||
= metadata_form.text_area :content, required: true | ||
.row | ||
.col-6 | ||
= metadata_form.select :content_color, available_text_colors, required: true | ||
.col-6 | ||
= metadata_form.select :content_alignment, text_alignments, required: true | ||
.row | ||
.col-6 | ||
= metadata_form.text_field :cta, label: "Call to Action" | ||
.col-6 | ||
= metadata_form.text_field :cta_url, label: "Call to Action URL" | ||
.row | ||
.col-6 | ||
= metadata_form.select :button_color, available_button_colors | ||
.col-6 | ||
= metadata_form.select :button_alignment, text_alignments, required: true | ||
- @component_form.fields_for :metadata, @component.metadata do |metadata_form| | ||
= metadata_form.text_field :title, required: true, help: 'Always centered' | ||
= metadata_form.select :title_color, available_text_colors, required: true | ||
= metadata_form.text_area :content, required: true | ||
.row | ||
.col-6 | ||
= metadata_form.select :content_color, available_text_colors, required: true | ||
.col-6 | ||
= metadata_form.select :content_alignment, text_alignments, required: true | ||
.row | ||
.col-6 | ||
= metadata_form.text_field :cta, label: "Call to Action" | ||
.col-6 | ||
= metadata_form.text_field :cta_url, label: "Call to Action URL" | ||
.row | ||
.col-6 | ||
= metadata_form.select :button_color, available_button_colors | ||
.col-6 | ||
= metadata_form.select :button_alignment, text_alignments, required: true |
9 changes: 4 additions & 5 deletions
9
app/components/mcm/rich_text_component/rich_text_component.html+admin.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
- render "mcm/component_form", component: @component do |component_form| | ||
- component_form.fields_for :metadata, @component.metadata do |metadata_form| | ||
%trix-editor{ input: 'components_page_metadata_body' } | ||
= metadata_form.hidden_field :body | ||
= metadata_form.select :content_color, available_text_colors, required: true | ||
- @component_form.fields_for :metadata, @component.metadata do |metadata_form| | ||
%trix-editor{ input: 'components_page_metadata_body' } | ||
= metadata_form.hidden_field :body | ||
= metadata_form.select :content_color, available_text_colors, required: true |
13 changes: 6 additions & 7 deletions
13
app/components/mcm/square_image_component/square_image_component.html+admin.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
- render "mcm/component_form", component: @component do |component_form| | ||
- component_form.fields_for :metadata, @component.metadata do |metadata_form| | ||
= metadata_form.select :vertical_alignment, vertical_alignment_options, required: true | ||
= metadata_form.select :horizontal_alignment, horizontal_alignment_options, required: true | ||
- @component_form.fields_for :metadata, @component.metadata do |metadata_form| | ||
= metadata_form.select :vertical_alignment, vertical_alignment_options, required: true | ||
= metadata_form.select :horizontal_alignment, horizontal_alignment_options, required: true | ||
|
||
- @component.assets.first_or_initialize | ||
- component_form.fields_for :assets do |assets_form| | ||
= render Mcm::ImageComponent.new(form: assets_form, styles: image_preview_styles, variant: :small) | ||
- @component.assets.first_or_initialize | ||
- @component_form.fields_for :assets do |assets_form| | ||
= render Mcm::ImageComponent.new(form: assets_form, styles: image_preview_styles, variant: :small) |
47 changes: 23 additions & 24 deletions
47
app/components/mcm/title_content_cta_component/title_content_cta_component.html+admin.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,25 @@ | ||
- render "mcm/component_form", component: @component do |component_form| | ||
- component_form.fields_for :metadata, @component.metadata do |metadata_form| | ||
= metadata_form.text_field :title, required: true | ||
.row | ||
.col-6 | ||
= metadata_form.select :title_alignment, text_alignments, required: true | ||
.col-6 | ||
= metadata_form.select :title_color, available_text_colors, required: true | ||
- @component_form.fields_for :metadata, @component.metadata do |metadata_form| | ||
= metadata_form.text_field :title, required: true | ||
.row | ||
.col-6 | ||
= metadata_form.select :title_alignment, text_alignments, required: true | ||
.col-6 | ||
= metadata_form.select :title_color, available_text_colors, required: true | ||
|
||
= metadata_form.hidden_field :content, required: true | ||
%trix-editor{ input: 'components_page_metadata_content' } | ||
= metadata_form.hidden_field :content, required: true | ||
%trix-editor{ input: 'components_page_metadata_content' } | ||
|
||
.row.mt-3 | ||
.col-6 | ||
= metadata_form.select :content_alignment, text_alignments, required: true | ||
.col-6 | ||
= metadata_form.select :content_color, available_text_colors, required: true | ||
.row | ||
.col-6 | ||
= metadata_form.text_field :cta_title, label: t('.cta.title') | ||
= metadata_form.text_field :cta_url, label: t('.cta.url') | ||
= metadata_form.select :button_color, available_button_colors, label: t('.cta.button') | ||
= metadata_form.select :button_alignment, text_alignments, required: true | ||
.col-6 | ||
= metadata_form.select :content_vertical_alignment, vertical_alignment_options, required: true, label: t('.position.vertical') | ||
= metadata_form.select :content_horizontal_alignment, horizontal_alignment_options, required: true, label: t('.position.horizontal') | ||
.row.mt-3 | ||
.col-6 | ||
= metadata_form.select :content_alignment, text_alignments, required: true | ||
.col-6 | ||
= metadata_form.select :content_color, available_text_colors, required: true | ||
.row | ||
.col-6 | ||
= metadata_form.text_field :cta_title, label: t('.cta.title') | ||
= metadata_form.text_field :cta_url, label: t('.cta.url') | ||
= metadata_form.select :button_color, available_button_colors, label: t('.cta.button') | ||
= metadata_form.select :button_alignment, text_alignments, required: true | ||
.col-6 | ||
= metadata_form.select :content_vertical_alignment, vertical_alignment_options, required: true, label: t('.position.vertical') | ||
= metadata_form.select :content_horizontal_alignment, horizontal_alignment_options, required: true, label: t('.position.horizontal') |
7 changes: 3 additions & 4 deletions
7
app/components/mcm/youtube_video_component/youtube_video_component.html+admin.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
- render "mcm/component_form", component: @component do |component_form| | ||
- component_form.fields_for :metadata, @component.metadata do |metadata_form| | ||
= metadata_form.number_field :height, required: true | ||
= metadata_form.text_field :youtube_video_id, placeholder: 'vlDzyIIMYma', help: 'Youtube video id', required: true | ||
- @component_form.fields_for :metadata, @component.metadata do |metadata_form| | ||
= metadata_form.number_field :height, required: true | ||
= metadata_form.text_field :youtube_video_id, placeholder: 'vlDzyIIMYma', help: 'Youtube video id', required: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters