-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2207 from NCCE/2860-implement-new-primary-certifi…
…cate-landing-page New components - For Primary Landing Page
- Loading branch information
Showing
66 changed files
with
1,142 additions
and
89 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# frozen_string_literal: true | ||
|
||
class CmsNumberedIconListComponent < CmsWithAsidesComponent | ||
def initialize(title:, title_icon:, points:, aside_sections:) | ||
super(aside_sections:) | ||
@title = title | ||
@title_icon = title_icon | ||
@points = points | ||
end | ||
end |
21 changes: 21 additions & 0 deletions
21
app/components/cms_numbered_icon_list_component/cms_numbered_icon_list_component.html.erb
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<%= render GovGridRowComponent.new(additional_classes: 'cms-numbered-icon-list-components') do |row| %> | ||
<%= row.with_column("two-thirds") do %> | ||
<div class="cms-numbered-icon-list__header"> | ||
<%= render SectionTitleWithIconComponent.new(text: @title, icon: @title_icon) %> | ||
</div> | ||
|
||
<div> | ||
<ol class="numbered-points"> | ||
<% @points.each do |point| %> | ||
<li> | ||
<%= render point.render %> | ||
</li> | ||
<% end %> | ||
</ol> | ||
</div> | ||
|
||
<% end %> | ||
<%= row.with_column("one-third") do %> | ||
<%= render_parent %> | ||
<% end %> | ||
<% end %> |
28 changes: 28 additions & 0 deletions
28
app/components/cms_numbered_icon_list_component/cms_numbered_icon_list_component.scss
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
.numbered-points { | ||
list-style: none; | ||
counter-reset: numbered-points-counter; | ||
|
||
li{ | ||
counter-increment: numbered-points-counter; | ||
position: relative; | ||
margin-bottom: 15px; | ||
padding-left: 15px | ||
} | ||
|
||
li::before { | ||
content: counter(numbered-points-counter); | ||
font-family: $font-family-body; | ||
background: $purple; | ||
width: 2rem; | ||
height: 2rem; | ||
border-radius: 50%; | ||
display: inline-block; | ||
line-height: 2rem; | ||
color: white; | ||
text-align: center; | ||
margin-right: 15px; | ||
position: absolute; | ||
left: -2.5rem; | ||
top: calc(50% - 1rem); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# frozen_string_literal: true | ||
|
||
class CmsNumericCardComponent < ViewComponent::Base | ||
def initialize(title:, text_content:, number:) | ||
@title = title | ||
@text_content = text_content | ||
@number = number | ||
end | ||
end |
16 changes: 16 additions & 0 deletions
16
app/components/cms_numeric_card_component/cms_numeric_card_component.html.erb
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<div class="numeric-card"> | ||
<div class="numeric-card__header"> | ||
<div class="numeric-card__number"> | ||
<h3 class="govuk-heading-l"><%= @number %>.</h3> | ||
</div> | ||
<div class="numeric-card__title"> | ||
<h3 class="govuk-heading-l"> | ||
<%= @title %> | ||
</h3> | ||
</div> | ||
</div> | ||
|
||
<div class="numeric-card__content"> | ||
<%= render @text_content.render %> | ||
</div> | ||
</div> |
31 changes: 31 additions & 0 deletions
31
app/components/cms_numeric_card_component/cms_numeric_card_component.scss
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
.numeric-card { | ||
box-shadow: 0px 0px 8px 0px #00000040; | ||
background-color: white; | ||
flex: 1 1 auto; | ||
padding: 15px 25px; | ||
|
||
&__header { | ||
display: flex; | ||
flex-direction: row; | ||
gap: 5px; | ||
|
||
.numeric-card__number { | ||
flex: 0 1 auto; | ||
|
||
h3 { | ||
margin-bottom: 10px; | ||
color: $purple; | ||
} | ||
} | ||
|
||
.numeric-card__title { | ||
flex: 1 1 auto; | ||
} | ||
} | ||
|
||
&__content { | ||
p { | ||
font-size: 1.4rem; | ||
} | ||
} | ||
} |
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,8 +1,9 @@ | ||
# frozen_string_literal: true | ||
|
||
class CmsPageTitleComponent < ViewComponent::Base | ||
def initialize(title:, sub_text: nil) | ||
def initialize(title:, sub_text: nil, title_image: nil) | ||
@title = title | ||
@sub_text = sub_text | ||
@title_image = title_image | ||
end | ||
end |
21 changes: 14 additions & 7 deletions
21
app/components/cms_page_title_component/cms_page_title_component.html.erb
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# frozen_string_literal: true | ||
|
||
class CmsSplitHorizontalCardComponent < ViewComponent::Base | ||
delegate :cms_color_theme_class, to: :helpers | ||
|
||
def initialize(card_content:, aside_content:, aside_icon: nil, aside_title: nil, section_title: nil, color_theme: nil, background_color: nil) | ||
@card_content = card_content | ||
@aside_content = aside_content | ||
@aside_icon = aside_icon | ||
@aside_title = aside_title | ||
@section_title = section_title | ||
@color_theme = color_theme | ||
@background_color = background_color | ||
end | ||
|
||
def wrapper_classes | ||
classes = ["cms-split-horizontal-card"] | ||
classes << "#{@background_color}-bg" if @background_color | ||
classes | ||
end | ||
|
||
def left_card_classes | ||
classes = ["split-horizontal-card"] | ||
classes << cms_color_theme_class(@color_theme, "left") if @color_theme | ||
classes | ||
end | ||
end |
22 changes: 22 additions & 0 deletions
22
...mponents/cms_split_horizontal_card_component/cms_split_horizontal_card_component.html.erb
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<%= render GovGridRowComponent.new(additional_classes: wrapper_classes) do |row| %> | ||
<%= row.with_column("full") do %> | ||
<% if @section_title %> | ||
<h2 class="govuk-heading-m"><%= @section_title %></h2> | ||
<% end %> | ||
<div class="tc-row"> | ||
|
||
<div class="tc-row-two-thirds"> | ||
<%= content_tag :div, class: left_card_classes do %> | ||
<%= render @card_content.render %> | ||
<% end %> | ||
</div> | ||
|
||
<div class="tc-row-one-third"> | ||
<div class="split-horizontal-card"> | ||
<%= render SectionTitleWithIconComponent.new(text: @aside_title, icon: @aside_icon, text_size: :small) %> | ||
<%= render @aside_content.render %> | ||
</div> | ||
</div> | ||
</div> | ||
<% end %> | ||
<% end %> |
9 changes: 9 additions & 0 deletions
9
app/components/cms_split_horizontal_card_component/cms_split_horizontal_card_component.scss
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.cms-split-horizontal-card { | ||
.split-horizontal-card { | ||
height: calc(100% - 40px); | ||
background-color: #ffffff; | ||
padding: 20px; | ||
border-width: 10px; | ||
box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.2); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# frozen_string_literal: true | ||
|
||
class CmsTestimonialComponent < ViewComponent::Base | ||
def initialize(name:, job_title:, avatar:, quote:) | ||
@name = name | ||
@job_title = job_title | ||
@avatar = avatar | ||
@quote = quote | ||
end | ||
end |
18 changes: 18 additions & 0 deletions
18
app/components/cms_testimonial_component/cms_testimonial_component.html.erb
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<div class="cms-testimonial"> | ||
<div class="cms-testimonial__quote"> | ||
<%= render @quote.render %> | ||
</div> | ||
<div class="cms-testimonial__bio"> | ||
<div class="cms-testimonial__bio-avatar"> | ||
<%= render CmsImageComponent.new(@avatar) if @avatar %> | ||
</div> | ||
<div class="cms-testimonial__bio-content"> | ||
<span class="name"> | ||
<%= @name %> | ||
</span> | ||
<span class="job-title"> | ||
<%= @job_title %> | ||
</span> | ||
</div> | ||
</div> | ||
</div> |
51 changes: 51 additions & 0 deletions
51
app/components/cms_testimonial_component/cms_testimonial_component.scss
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
|
||
.cms-testimonial { | ||
display: flex; | ||
flex-direction: column; | ||
flex: 1 1 calc(100%/3); | ||
|
||
&__quote { | ||
flex: 1 1 auto; | ||
padding: 20px; | ||
box-shadow: 0px 0px 8px 0px #00000040; | ||
border-radius: 10px; | ||
background-color: white; | ||
} | ||
|
||
&__bio { | ||
flex: 0 1 68px; | ||
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
gap: 10px; | ||
margin-top: 10px; | ||
margin-right: 12px; | ||
|
||
&-avatar { | ||
img { | ||
width: 48px; | ||
height: 48px; | ||
border-radius: 48px; | ||
object-position: center; | ||
object-fit: cover; | ||
border: 2px solid $orange; | ||
margin: 10px 0; | ||
} | ||
} | ||
|
||
&-content { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 5px; | ||
|
||
.name { | ||
@include govuk-font($size: 16, $weight: bold); | ||
} | ||
|
||
.job-title { | ||
@include govuk-font($size: 16); | ||
color: $grey-storm; | ||
} | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# frozen_string_literal: true | ||
|
||
class CmsTestimonialRowComponent < ViewComponent::Base | ||
def initialize(title:, testimonials:, background_color:) | ||
@title = title | ||
@testimonials = testimonials | ||
@background_color = background_color | ||
end | ||
|
||
def wrapper_classes | ||
classes = ["cms-testimonial-row"] | ||
classes << "#{@background_color}-bg" if @background_color | ||
classes | ||
end | ||
end |
14 changes: 14 additions & 0 deletions
14
app/components/cms_testimonial_row_component/cms_testimonial_row_component.html.erb
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<%= render GovGridRowComponent.new(additional_classes: wrapper_classes) do |row| %> | ||
<%= row.with_column("full") do %> | ||
<% if @title %> | ||
<h1 class="govuk-heading-m"><%= @title %></h1> | ||
<% end %> | ||
|
||
<div class="cms-testimonials-row"> | ||
<% @testimonials.each do |testimonial| %> | ||
<%= render testimonial.render %> | ||
<% end %> | ||
</div> | ||
|
||
<% end %> | ||
<% end %> |
Oops, something went wrong.