Skip to content

Commit

Permalink
fixup fetch data from content item
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanita Barrett committed Jan 23, 2020
1 parent 7df3b88 commit 61eb0ef
Showing 1 changed file with 3 additions and 23 deletions.
26 changes: 3 additions & 23 deletions app/presenters/content_item/no_deal_notice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,17 @@ def has_no_deal_notice?
end

def no_deal_notice_component
# TODO: uncomment this if statement once schema is sorted
#if has_no_deal_notice?
if has_no_deal_notice?
{
title: no_deal_notice_title,
description_govspeak: no_deal_notice_description_govspeak,
}
#end
end

private

def no_deal_notice
content_item["no_deal_notice"]
content_item["brexit_no_deal_notice"]
end

def no_deal_notice_title
Expand All @@ -43,27 +41,9 @@ def no_deal_notice_description_govspeak
content_tag :div do
content_tag(:p, no_deal_notice_description) +
content_tag(:ul, class: "legislative-list") do
no_deal_links.collect { |link| content_tag(:li, link_to(link[:title], link[:path]), tracking_attributes) }.join("").html_safe
no_deal_notice.collect { |link| content_tag(:li, link_to(link[:title], link[:path]), no_deal_notice_tracking_attributes) }.join("").html_safe
end
end
end

def no_deal_links
# TODO: get this from the content item, rather than hardcoding
[
{
title: "This is one link",
path: "/path",
},
{
title: "This is second link",
path: "/path-2",
},
{
title: "This is a third link",
path: "/path-3",
},
]
end
end
end

0 comments on commit 61eb0ef

Please sign in to comment.