Skip to content

Commit

Permalink
Merge branch 'next' into SFSW-2844-hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
mattb-hippo authored Feb 12, 2025
2 parents 2426f11 + 0cb66c7 commit adccc31
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-contentful-space-export.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:

# Workaround: https://github.com/docker/build-push-action/issues/461
- name: Setup Docker buildx
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5
uses: docker/setup-buildx-action@f7ce87c1d6bead3e36075b2ce75da1f6cc28aaca

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-contentful-space-import.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:

# Workaround: https://github.com/docker/build-push-action/issues/461
- name: Setup Docker buildx
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5
uses: docker/setup-buildx-action@f7ce87c1d6bead3e36075b2ce75da1f6cc28aaca

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:

# Workaround: https://github.com/docker/build-push-action/issues/461
- name: Setup Docker buildx
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5
uses: docker/setup-buildx-action@f7ce87c1d6bead3e36075b2ce75da1f6cc28aaca

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@ public class LocationInfo
{
public string SectionName { get; set; }
public int SectionNumber { get; set; }
public int PageNumber { get; set; }
public int TotalSections { get; set; }
public bool IsFirstPageOfFirstSection {get; set; }
public bool IsLastSection {get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public PathwaysNavigationHelper(Content page)
{
SetTrainingPageNextNavigation(pageCounter, sectionCounter, page, section);
SetTrainingPagePreviousNavigation(pageCounter, sectionCounter, page, section);
SetTrainingPageCurrentLocation(sectionCounter, page, section);
SetTrainingPageCurrentLocation(sectionCounter, page, section, pageCounter);
}

pageCounter++;
Expand Down Expand Up @@ -203,14 +203,20 @@ private void SetTrainingPagePreviousNavigation(int pageCounter, int sectionCount
}
}

private void SetTrainingPageCurrentLocation(int currentSectionIdx, Content page, PathwaysModuleSection section)
{
private void SetTrainingPageCurrentLocation(int currentSectionIdx, Content page, PathwaysModuleSection section, int currentPageIdx)
{
bool isFirstPageOfFirstSection = currentPageIdx == 0 && currentSectionIdx == 0;
bool isLastSection = currentSectionIdx + 1 == page.PathwaysModule.Sections.Count;
this._currentLocation = new LocationInfo
{
SectionName = section.Name,
SectionNumber = currentSectionIdx + 1,
TotalSections = page.PathwaysModule.Sections.Count
TotalSections = page.PathwaysModule.Sections.Count,
PageNumber = currentPageIdx + 1,
IsFirstPageOfFirstSection = isFirstPageOfFirstSection,
IsLastSection = isLastSection
};

}

private string GetFirstSectionFirstPageId (Content page)
Expand Down
18 changes: 17 additions & 1 deletion Childrens-Social-Care-CPD/Views/Shared/_PathwaysContent.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,23 @@
</div>
</div>
</div>
@if (Model.PathwaysModule?.CreditBlock != null)

@* Render credit line in Module Type: Introductory Module on page 1 of section 1*@
@if (Model.PathwaysModule?.CreditBlock != null && Model.PathwaysModule.Type == PathwaysModuleType.IntroductoryModule && @contextModel.NavigationHelper.CurrentLocation.IsFirstPageOfFirstSection)
{
<div class="govuk-grid-row">
<div class="govuk-grid-column-three-quarters">
<hr />
</div>
</div>
<div class="govuk-grid-row pathways-nav">
<div class="govuk-grid-column-three-quarters">
<a href="https://thefrontline.org.uk/develop-your-career/pathways-programme/">Frontline 4C Leadership Framework</a> © 2024 by <a href="https://thefrontline.org.uk/">Frontline</a> is licensed under <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">CC BY-NC-SA 4.0</a>
</div>
</div>
}
@* Render credit block in all other pages except for last page of last section*@
else if (Model.PathwaysModule?.CreditBlock != null && !@contextModel.NavigationHelper.CurrentLocation.IsLastSection)
{
<div class="govuk-grid-row">
<div class="govuk-grid-column-three-quarters">
Expand Down

0 comments on commit adccc31

Please sign in to comment.