-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ER-886 Completed modules logic update (#1297)
* WIP: Update completed at logic and add specs * Rubocop updates * Update my modules to use partials, text update and spec update * Ensure completed modules text is not shown when last module to complete is in progress * Update for course progress spec
- Loading branch information
Showing
9 changed files
with
82 additions
and
48 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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
hr.govuk-section-break.govuk-section-break--visible.govuk-section-break--l | ||
#available.govuk-grid-row | ||
.govuk-grid-column-full | ||
h2.govuk-heading-m | ||
= t('my_learning.available_modules_title') | ||
- 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 = t('my_learning.course_completed') |
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,4 @@ | ||
section.completed class=(current_user.course.completed_all_modules? ? '' : 'govuk-!-margin-top-7') | ||
#completed.govuk-grid-row | ||
.govuk-grid-column-full | ||
= completed_modules_table |
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,12 @@ | ||
#started.govuk-grid-row | ||
.govuk-grid-column-full | ||
h2.govuk-heading-m = t('my_learning.modules_in_progress_title') | ||
- if current_user.course.current_modules.none? | ||
- if current_user.course.completed_modules.none? | ||
p = t('my_learning.begin_training_course') | ||
- else | ||
p = t('my_learning.choose_available_module') | ||
- else | ||
.grid-container | ||
- current_user.course.current_modules.each do |mod| | ||
= render 'card', mod: mod, progress: module_progress(mod) |
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 @@ | ||
hr.govuk-section-break.govuk-section-break--visible.govuk-section-break--l | ||
#upcoming.govuk-grid-row | ||
.govuk-grid-column-full | ||
h2.govuk-heading-m = t('my_learning.future_modules_title') | ||
|
||
.grid-container | ||
- current_user.course.upcoming_modules.each do |mod| | ||
.govuk-card id=mod.name | ||
h3.govuk-heading-s | ||
= mod.heading | ||
p.govuk-body= mod.upcoming | ||
- unless mod.draft? | ||
= govuk_link_to t('my_learning.view_more_module_information'), | ||
course_overview_path + mod.card_anchor |
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
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