-
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.
- Loading branch information
Showing
39 changed files
with
512 additions
and
221 deletions.
There are no files selected for viewing
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
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
55 changes: 28 additions & 27 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,30 +1,31 @@ | ||
- @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 | ||
- 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 | ||
|
||
= 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_form.object.assets.build } if @component_form.object.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
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: 14 additions & 13 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,14 +1,15 @@ | ||
- @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 | ||
- 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 | ||
|
||
.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 |
30 changes: 6 additions & 24 deletions
30
app/components/mcm/columns_component/columns_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,8 @@ | ||
.py-5{ class: @component.full_width? ? 'container-fluid' : 'container' } | ||
%section{ class: @component.full_width? ? "container-fluid" : "container", style: "background:#{background_color}" } | ||
- if @component.metadata.section_title.present? | ||
%h2{ class: title_classes } | ||
= @component.section_title | ||
.row.align-content-center.d-flex{ id: "row-#{@component.id}" } | ||
- @component.children.active.each do |component| | ||
.col-12.col-md.align-items-center.d-flex.flex-wrap | ||
- begin | ||
= render component.view_component | ||
- rescue ActionView::Template::Error => e | ||
- Rails.logger.error(e) | ||
.container | ||
%h4= t('custom_pages.messages.something_went_wrong') | ||
= link_to t('custom_pages.actions.edit_component'), | ||
main_app.edit_admin_custom_page_component_component_path(@component.page, | ||
@component, component) | ||
- if @component.metadata.background_color.present? | ||
:css | ||
#section-#{@component.id} { | ||
background-color: #{@component.metadata.background_color}; | ||
} | ||
%h2{ class: title_classes }= @component.metadata.section_title | ||
|
||
:css | ||
#row-#{@component.id} { | ||
height: #{height}; | ||
} | ||
.d-flex.align-content-center{ style: "height:#{height}px" } | ||
- @component.children.active.each do |component| | ||
.d-flex.align-items-center.flex-wrap | ||
= render "mcm/child_component", component: component |
7 changes: 4 additions & 3 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,3 +1,4 @@ | ||
- @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) | ||
- 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) |
4 changes: 3 additions & 1 deletion
4
app/components/mcm/hero_image_component/hero_image_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
.p-0.w-100{ class: "image_hero_#{@component.assets.first.id}" } | ||
= render Mcm::ImageComponent.new(asset: @component.assets.first, class_name: "image_hero_#{@component.assets.first.id}", height: @component.parent.height) | ||
= render Mcm::ImageComponent.new(asset: @component.assets.first, | ||
class_name: "image_hero_#{@component.assets.first.id}", | ||
height: @component.parent.metadata.height) |
65 changes: 33 additions & 32 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,35 +1,36 @@ | ||
- @component.assets.first_or_initialize | ||
- @component_form.fields_for :assets do |assets_form| | ||
= render Mcm::ImageComponent.new(form: assets_form, styles: image_preview_styles) | ||
- 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_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 |
Oops, something went wrong.