-
Notifications
You must be signed in to change notification settings - Fork 20
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
1 parent
fac92c5
commit de30d60
Showing
2 changed files
with
67 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,31 @@ | ||
<% | ||
add_view_stylesheet("landing_page/hero") | ||
|
||
hero_classes = %w[app-b-hero] | ||
hero_classes << "app-b-hero--mid-page" if block.data["theme"] == "middle_left" | ||
|
||
grid_class = "govuk-grid-column-two-thirds-from-desktop" | ||
grid_class = "govuk-grid-column-one-third-from-desktop" if block.data["theme"] == "middle_left" | ||
%> | ||
<div class="app-b-hero"> | ||
<%= content_tag("div", class: hero_classes) do %> | ||
<%= picture_tag(class: "app-b-hero__imagewrapper") do %> | ||
<%= tag.source srcset: "#{image_path(block.image.sources.desktop)}, #{image_path(block.image.sources.desktop_2x)} 2x", media: "(min-width: 769px)" %> | ||
<%= tag.source srcset: "#{image_path(block.image.sources.tablet)}, #{image_path(block.image.sources.tablet_2x)} 2x", media: "(min-width: 641px) and (max-width: 768px)" %> | ||
<%= tag.source srcset: "#{image_path(block.image.sources.mobile)}, #{image_path(block.image.sources.mobile_2x)} 2x", media: "(max-width: 640px)" %> | ||
<%= image_tag(block.image.sources.desktop, alt: block.image.alt, class: "app-b-hero__image") %> | ||
<% end %> | ||
|
||
<div class="govuk-width-container"> | ||
<div class="govuk-width-container app-b-hero__textbox-wrapper"> | ||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-two-thirds"> | ||
<div class="app-b-hero__textbox"> | ||
<%= content_tag("div", class: grid_class) do %> | ||
<%= content_tag("div", class: "app-b-hero__textbox") do %> | ||
<% block.hero_content.each do |subblock| %> | ||
<%= render_block(subblock) %> | ||
<% end %> | ||
</div> | ||
</div> | ||
<% end %> | ||
<% end %> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
<% end %> |