Skip to content

Commit

Permalink
ER-922 Review Summary Page Update (#1273)
Browse files Browse the repository at this point in the history
  • Loading branch information
martikat authored Jul 29, 2024
1 parent 0d4d0fd commit 95b8040
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 15 deletions.
4 changes: 4 additions & 0 deletions app/assets/stylesheets/card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@
}
}

.govuk-tag {
max-width: 100%;
}

&:hover &-link--retake {
&:hover {
color: govuk-colour('light-grey');
Expand Down
33 changes: 28 additions & 5 deletions app/assets/stylesheets/module-overview.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ $progress-bar-container-width: 81px;
display: grid;
grid-template-columns: $progress-bar-container-width auto;

@include govuk-media-query($until: tablet) {
grid-template-columns: 50px auto;
}

.icon {
border-radius: 50%;
width: $icon-diameter;
Expand All @@ -29,6 +33,7 @@ $progress-bar-container-width: 81px;
align-items: center;
font-weight: bold;
z-index: 2;
position: absolute;

&.completed {
background-color: govuk-colour('blue');
Expand All @@ -55,11 +60,7 @@ $progress-bar-container-width: 81px;
border-left: 1px solid govuk-colour('mid-grey');
position: relative;
z-index: 1;
right: $line-shift + 7.5px;

@include govuk-media-query($from: tablet) {
right: $line-shift + 10px;
}
right: -18px;
}

.module-section--container {
Expand All @@ -75,6 +76,28 @@ $progress-bar-container-width: 81px;
}
}

.module-section--item {
font-size: 1.1875rem;

ul {
list-style-type: disc;
padding-left: 15px;
margin-bottom: 0;

@include govuk-media-query($until: tablet) {
padding-left: 10px;
}
}

li {
list-style: square;
}

ul > li:last-child {
margin-bottom: 0;
}
}

#module-call-to-action {
@include govuk-responsive-margin(8, 'top');
}
2 changes: 1 addition & 1 deletion app/decorators/module_overview_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def heading(page)
# @param pages [Array<Training::Page, Training::Question, Training::Video>]
# @return [String]
def page_count(pages)
"(Pages #{pages.size})" unless pages.one?
I18n.t('my_learning.page_count', num: pages.size) unless pages.one?
end

# @param submodule [Integer]
Expand Down
10 changes: 6 additions & 4 deletions app/views/training/modules/_subsection.html.slim
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
span.module-section--item
- if next_page_name
= govuk_link_to heading, training_module_page_path(mod_name, next_page_name)
- else
= heading
ul
li
- if next_page_name
= govuk_link_to heading, training_module_page_path(mod_name, next_page_name)
- else
= heading
span.progress-indicator= progress_indicator(status)
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ en:
new_tag:
card: NEW
section: NEW MODULE AVAILABLE
page_count: (%{num} pages)

my_learning_log:
title: Learning log
Expand Down
8 changes: 4 additions & 4 deletions spec/decorators/module_overview_decorator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@

it 'counts pages' do
expect(output.map { |s| s[:page_count] }).to eq [
'(Pages 4)',
'(Pages 5)',
'(Pages 20)',
'(Pages 9)',
'(4 pages)',
'(5 pages)',
'(20 pages)',
'(9 pages)',
nil,
]
end
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/seed_snippets_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
subject(:locales) { described_class.new.call }

it 'converts all translations' do
expect(locales.count).to be 200
expect(locales.count).to be 201
end

it 'dot separated key -> Page::Resource#name' do
Expand Down

0 comments on commit 95b8040

Please sign in to comment.