From f17bfc260a6105d275e776139c681b89bef81911 Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Wed, 15 Jul 2020 12:18:45 +0100 Subject: [PATCH 01/22] created a new component equity select --- .../components/select/EquitySelect.vue | 33 +++++++++++++++++++ app/views/layouts/cms/_equity.html.erb | 8 +++++ 2 files changed, 41 insertions(+) create mode 100644 app/javascript/components/select/EquitySelect.vue diff --git a/app/javascript/components/select/EquitySelect.vue b/app/javascript/components/select/EquitySelect.vue new file mode 100644 index 000000000..d27b00371 --- /dev/null +++ b/app/javascript/components/select/EquitySelect.vue @@ -0,0 +1,33 @@ + + + \ No newline at end of file diff --git a/app/views/layouts/cms/_equity.html.erb b/app/views/layouts/cms/_equity.html.erb index b81e6b721..9d9a8b877 100644 --- a/app/views/layouts/cms/_equity.html.erb +++ b/app/views/layouts/cms/_equity.html.erb @@ -1,5 +1,13 @@ <%= render partial: "./layouts/partials/hero-basic", locals: { title: @cms_page.label, classes: "#{@cms_page.slug} bg-image-overlay--white" } %> +
+ + +
+ +
<%= cms_fragment_render("content") %>
From daa91c8834b0a6647bd56bd4ce924ade16d19fcb Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Wed, 15 Jul 2020 12:44:27 +0100 Subject: [PATCH 02/22] created a helper method for populating the component and it now renders correctly --- app/helpers/equity_helper.rb | 22 +++++++++++++++++++ .../components/select/EquitySelect.vue | 6 ++--- app/javascript/vue.js | 2 ++ app/views/layouts/cms/_equity.html.erb | 3 +-- 4 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 app/helpers/equity_helper.rb diff --git a/app/helpers/equity_helper.rb b/app/helpers/equity_helper.rb new file mode 100644 index 000000000..558eb7f87 --- /dev/null +++ b/app/helpers/equity_helper.rb @@ -0,0 +1,22 @@ +module EquityHelper + # To be updated once the PA pages are actually fleshed out + def options + @options = [] + + @cms_page.children.first.children.published.each do |child| + object = {} + + object[:title] = child.label + object[:text] = cms_fragment_content(:text, child) + # object[:url] = cms_fragment_content(:url, child) + object[:url] = child.full_path + + if(cms_fragment_content(:image, child).try(:file) && cms_fragment_content(:image, child).file.url(:dropdownImage)) + object[:image] = cms_fragment_content(:image, child).file.url(:dropdownImage) + end + + @options.push(object) + + end + end +end \ No newline at end of file diff --git a/app/javascript/components/select/EquitySelect.vue b/app/javascript/components/select/EquitySelect.vue index d27b00371..dfb2aa9b0 100644 --- a/app/javascript/components/select/EquitySelect.vue +++ b/app/javascript/components/select/EquitySelect.vue @@ -1,13 +1,13 @@