Skip to content

Commit

Permalink
ER-886 Completed module styling update (#1283)
Browse files Browse the repository at this point in the history
  • Loading branch information
martikat authored Jul 29, 2024
1 parent 95b8040 commit d68e6d9
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 32 deletions.
16 changes: 15 additions & 1 deletion app/assets/stylesheets/module-overview.scss
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,20 @@ $progress-bar-container-width: 81px;
}
}

section.completed {
background-color: govuk-colour('light-grey');
border-radius: 6px;
padding: govuk-spacing(7);

@include govuk-media-query($until: tablet) {
padding: govuk-spacing(4);
}
}

.govuk-table {
margin-bottom: 0;
}

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

Expand All @@ -95,7 +109,7 @@ $progress-bar-container-width: 81px;

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

#module-call-to-action {
Expand Down
67 changes: 36 additions & 31 deletions app/views/learning/show.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,42 @@

= render 'cms_debug'

#started.govuk-grid-row
.govuk-grid-column-full
h2.govuk-heading-m Modules in progress
- if current_user.course.current_modules.none?
- if current_user.course.completed_modules.none?
p You have not started any modules. To begin the training course, start an available module.
- else
p You have not started any modules. Please choose an available module.
- else
.grid-container
- current_user.course.current_modules.each do |mod|
= render 'card', mod: mod, progress: module_progress(mod)

- if current_user.course.available_modules.any? || current_user.course.course_completed?
hr.govuk-section-break.govuk-section-break--visible.govuk-section-break--l
#available.govuk-grid-row
- if current_user.course.completed_modules.all? && current_user.course.upcoming_modules.none?
#started.govuk-grid-row
.govuk-grid-column-full
h2.govuk-heading-m
| Available modules
- if current_user.content_changes.new_modules?
span.govuk-tag
= t('my_learning.new_tag.section')
- if current_user.course.available_modules.any?
p You have completed all available modules. You may use the links below to revisit any of the course content.
- else
#started.govuk-grid-row
.govuk-grid-column-full
h2.govuk-heading-m Modules in progress
- if current_user.course.current_modules.none?
- if current_user.course.completed_modules.none?
p You have not started any modules. To begin the training course, start an available module.
- else
p You have not started any modules. Please choose an available module.
- else
.grid-container
- current_user.course.available_modules.each do |mod|
= render 'card', mod: mod, progress: false
- current_user.course.current_modules.each do |mod|
= render 'card', mod: mod, progress: module_progress(mod)

- elsif current_user.course.course_completed?
p You do not have any modules available.
- if current_user.course.available_modules.any? || current_user.course.course_completed?
hr.govuk-section-break.govuk-section-break--visible.govuk-section-break--l
#available.govuk-grid-row
.govuk-grid-column-full
h2.govuk-heading-m
| Available modules
- if current_user.content_changes.new_modules?
span.govuk-tag
= t('my_learning.new_tag.section')
- if current_user.course.available_modules.any?
.grid-container
- current_user.course.available_modules.each do |mod|
= render 'card', mod: mod, progress: false

- if current_user.course.upcoming_modules.any?
- elsif current_user.course.course_completed?
p You do not have any modules available.

- if current_user.course.upcoming_modules.any?
hr.govuk-section-break.govuk-section-break--visible.govuk-section-break--l
#upcoming.govuk-grid-row
.govuk-grid-column-full
Expand All @@ -60,9 +65,9 @@
course_overview_path + mod.card_anchor

- if current_user.course.completed_modules.any?
hr.govuk-section-break.govuk-section-break--visible.govuk-section-break--l
#completed.govuk-grid-row
.govuk-grid-column-three-quarters-from-desktop
= completed_modules_table
section.completed class=(current_user.course.completed_modules.all? && current_user.course.upcoming_modules.none? ? '' : 'govuk-!-margin-top-7')
#completed.govuk-grid-row
.govuk-grid-column-full
= completed_modules_table

= render 'debug'

0 comments on commit d68e6d9

Please sign in to comment.