Skip to content

Commit

Permalink
ER-886 Completed modules revert change (#1296)
Browse files Browse the repository at this point in the history
  • Loading branch information
martikat authored Jul 30, 2024
1 parent d68e6d9 commit 72a19b2
Showing 1 changed file with 32 additions and 37 deletions.
69 changes: 32 additions & 37 deletions app/views/learning/show.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -13,42 +13,37 @@

= render 'cms_debug'

- if current_user.course.completed_modules.all? && current_user.course.upcoming_modules.none?
#started.govuk-grid-row
.govuk-grid-column-full
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.
#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
.grid-container
- current_user.course.current_modules.each do |mod|
= render 'card', mod: mod, progress: module_progress(mod)
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
.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.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

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

- if current_user.course.upcoming_modules.any?
- 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 @@ -65,9 +60,9 @@
course_overview_path + mod.card_anchor

- if current_user.course.completed_modules.any?
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
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

= render 'debug'
= render 'debug'

0 comments on commit 72a19b2

Please sign in to comment.