From bb2dc8a8effea568b6ba2ee91904511612ae1828 Mon Sep 17 00:00:00 2001 From: Camille Villa <5402927+camillevilla@users.noreply.github.com> Date: Tue, 3 Sep 2024 18:20:40 -0700 Subject: [PATCH] Remove hardcoded content from homepage view --- app/models/homepage_feature.rb | 2 +- app/views/home/index.html.erb | 145 +++++++-------------------------- 2 files changed, 32 insertions(+), 115 deletions(-) diff --git a/app/models/homepage_feature.rb b/app/models/homepage_feature.rb index 4b92f7e14..f0bd42cfc 100644 --- a/app/models/homepage_feature.rb +++ b/app/models/homepage_feature.rb @@ -19,7 +19,7 @@ def image_s3_presigned_url(style = nil) end def self.column_size(item_count = 3) - if item_count >= 3 + if item_count == nil || item_count >= 3 'three-column-layout' else # update this later to deal with incoming designs 'two-column-layout' diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index ca263306f..0fda4cfc7 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -91,130 +91,47 @@
- <% fallback_content? = @homepage.blank? && (controller.action_name != 'preview') %>
- <% if fallback_content? %> -

Featured Innovations

-
-
- <%= image_tag("homepage/innovation-CREW.jpg", alt: "Two people preparing vegetables at a cutting board",class: "homepage-featured-image") %> -

CREW: Carbohydrate Reduction Empowering Wellness (formerly Therapeutic Carbohydrate Reduction (TCR) Aspire)

-

- CREW is a 16-week lifestyle program that uses goal setting and whole health coaching to support Veterans with Type 2 Diabetes and other metabolic health conditions. -

- View Innovation -
-
- <%= image_tag("homepage/innovation-PRIDE.jpg", alt: "Rainbow flag and trans flag patterned identification tags encircled by a stethoscope", class: "homepage-featured-image") %> -

PRIDE In All Who Served

-

- PRIDE In All Who Served is a health promotion group for LGBTQIA+ Veterans that fosters support and improves health literacy. Veterans have praised the program for significantly enhancing their well-being and communication with healthcare providers. -

- View Innovation -
-
- <%= image_tag("homepage/innovation-Close-to-Me.jpg", alt: "Doctor and patient discuss cancer test results", class: "homepage-featured-image") %> -

Close to Me Cancer Care

-

- Close to Me Cancer Care, sponsored by the VHA National Oncology Program Office, provides anti-cancer therapy services at Community Based Outpatients Clinics (CBOCs) to increase access points to care for Veterans. -

- View Innovation -
-
- <% else %> -

<%= @homepage&.section_title_one %>

-
- <% column_classes = HomepageFeature.column_size(@section_one_features.count) %> - <% @section_one_features.each_with_index do |hf, index| %> -
- <%= image_tag "#{hf&.image_s3_presigned_url}", alt: hf&.image_alt_text, class: 'homepage-featured-image' if hf.featured_image.exists? %> - <%= tag.h3 hf.title, id: "section-1-feature-#{index + 1}-title", class: 'feature-title' if hf.title.present? %> - <%= tag.p hf.description, class: 'usa-prose-body margin-bottom-5' if hf.description.present? %> - <%= link_to hf&.cta_text, hf.url, class: 'usa-link', 'aria-describedby': "section-1-feature-#{index + 1}-title" if hf.url.present? %> -
- <% end %> +

<%= @homepage&.section_title_one %>

+
+ <% column_classes = HomepageFeature.column_size(@section_one_features&.count) %> + <% @section_one_features&.each_with_index do |hf, index| %> +
+ <%= image_tag "#{hf&.image_s3_presigned_url}", alt: hf&.image_alt_text, class: 'homepage-featured-image' if hf.featured_image.exists? %> + <%= tag.h3 hf.title, id: "section-1-feature-#{index + 1}-title", class: 'feature-title' if hf.title.present? %> + <%= tag.p hf.description, class: 'usa-prose-body margin-bottom-5' if hf.description.present? %> + <%= link_to hf&.cta_text, hf.url, class: 'usa-link', 'aria-describedby': "section-1-feature-#{index + 1}-title" if hf.url.present? %>
<% end %> +
- <% if fallback_content? %> -

Trending Tags

-
-
- <%= image_tag("homepage/tag-suicide-prevention.jpg", alt: "VA Secretary Denis McDonough greeting a volunteer at a VA clinic", class: "homepage-featured-image") %> -

Suicide Prevention

-

- Discover our range of innovations focused on suicide prevention, ensuring Veterans receive the essential mental health care they deserve. -

- Learn More -
-
- <%= image_tag("homepage/tag-homeheatlh.jpg", alt: "a miniature house in glove hands of a medical staff member", class: "homepage-featured-image") %> -

Home Health

-

- Explore cutting-edge home health innovations, providing Veterans with personalized and accessible care in the comfort of their own homes -

- Learn More -
-
- <%= image_tag("homepage/tag-specialty-care.jpg", alt: "a man attached to a blood pressure monitor", class: "homepage-featured-image") %> -

Specialty Care

-

- Access the latest innovations in specialty care, dedicated to providing advanced medical treatments and personalized care tailored to Veterans' unique health needs. -

- Learn More +

<%= @homepage&.section_title_two %>

+
+ <% column_classes = HomepageFeature.column_size(@section_two_features&.count) %> + <% @section_two_features&.each_with_index do |hf, index| %> +
+ <%= image_tag "#{hf&.image_s3_presigned_url}", alt: hf&.image_alt_text, class: 'homepage-featured-image' if hf.featured_image.exists? %> + <%= tag.h3 hf.title, id: "section-2-feature-#{index + 1}-title", class: 'feature-title' if hf.title.present? %> + <%= tag.p hf.description, class: 'usa-prose-body margin-bottom-5' if hf.description.present? %> + <%= link_to hf&.cta_text, hf.url, class: 'usa-link', 'aria-describedby': "section-2-feature-#{index + 1}-title" if hf.url.present? %>
-
- <% else %> -

<%= @homepage&.section_title_two %>

-
- <% column_classes = HomepageFeature.column_size(@section_two_features.count) %> - <% @section_two_features.each_with_index do |hf, index| %> -
- <%= image_tag "#{hf&.image_s3_presigned_url}", alt: hf&.image_alt_text, class: 'homepage-featured-image' if hf.featured_image.exists? %> - <%= tag.h3 hf.title, id: "section-2-feature-#{index + 1}-title", class: 'feature-title' if hf.title.present? %> - <%= tag.p hf.description, class: 'usa-prose-body margin-bottom-5' if hf.description.present? %> - <%= link_to hf&.cta_text, hf.url, class: 'usa-link', 'aria-describedby': "section-2-feature-#{index + 1}-title" if hf.url.present? %> -
- <% end %> -
- <% end %> + <% end %> +
- <% if fallback_content? %> -

Innovation Communities

-
-
- <%= image_tag("homepage/community-age-friendly.jpg", alt: 'doctor and patient looking at a tablet together', class: "homepage-featured-image") %> -

Age-Friendly

-

- Reimagining the landscape of healthcare for our aging Veteran population. -

- <%= link_to 'View Community', '/communities/age-friendly', class: 'usa-link', 'aria-describedby': 'section-3-feature-1-title' %> -
-
- <%= image_tag("homepage/community-vr.jpg", alt: "a person wearing a VR headset, weraing a mask, and a Veterans Affairs lanyard", class: "homepage-featured-image") %> -

VA Immersive

-

- We help improve care delivery and experiences by leveraging immersive technology for falls risk assessment, neurological risk assessment, pain management, anxiety, addiction recovery, physical therapy, recreation therapy, PTSD, employee education, and more. -

- <%= link_to 'View Community', '/communities/va-immersive', class: 'usa-link', 'aria-describedby': 'section-3-feature-2-title' %> -
-
- <% else %> -

<%= @homepage&.section_title_three %>

-
- <% column_classes = HomepageFeature.column_size(@section_three_features.count) %> - <% @section_three_features.each_with_index do |hf, index| %> -
- <%= image_tag "#{hf&.image_s3_presigned_url}", alt: hf&.image_alt_text, class: 'homepage-featured-image' if hf.featured_image.exists? %> - <%= tag.h3 hf.title, id: "section-3-feature-#{index + 1}-title", class: 'feature-title' if hf.title.present? %> - <%= tag.p hf.description, class: 'usa-prose-body margin-bottom-5' if hf.description.present? %> - <%= link_to hf&.cta_text, hf.url, class: 'usa-link', 'aria-describedby': "section-3-feature-#{index + 1}-title" if hf.url.present? %> -
- <% end %> +

<%= @homepage&.section_title_three %>

+
+ <% column_classes = HomepageFeature.column_size(@section_three_features&.count) %> + <% @section_three_features&.each_with_index do |hf, index| %> +
+ <%= image_tag "#{hf&.image_s3_presigned_url}", alt: hf&.image_alt_text, class: 'homepage-featured-image' if hf.featured_image.exists? %> + <%= tag.h3 hf.title, id: "section-3-feature-#{index + 1}-title", class: 'feature-title' if hf.title.present? %> + <%= tag.p hf.description, class: 'usa-prose-body margin-bottom-5' if hf.description.present? %> + <%= link_to hf&.cta_text, hf.url, class: 'usa-link', 'aria-describedby': "section-3-feature-#{index + 1}-title" if hf.url.present? %>
<% end %> +