Skip to content

Commit

Permalink
Application form documents tab and links
Browse files Browse the repository at this point in the history
  • Loading branch information
paullocknimble committed Jun 10, 2024
1 parent 1bdfbbb commit a415119
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 44 deletions.
12 changes: 6 additions & 6 deletions Dfe.PrepareConversions/Dfe.PrepareConversions/Models/Links.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ public static class Links
private static string _transfersUrl;
public static string TransfersUrl => _transfersUrl;

private static bool _isProjectDocumentsEnabled;
public static bool IsProjectDocumentsEnabled => _isProjectDocumentsEnabled;
private static bool _isApplicationDocumentsEnabled;
public static bool IsApplicationDocumentsEnabled => _isApplicationDocumentsEnabled;

private static LinkItem AddLinkItem(string page, string backText = "Back")
{
Expand All @@ -24,8 +24,8 @@ public static void InitializeTransfersUrl(string transfersUrl)
_transfersUrl = transfersUrl;
}

public static void InializeProjectDocumentsEnabled(bool isProjectDocumentsEnabled) {
_isProjectDocumentsEnabled = isProjectDocumentsEnabled;
public static void InializeProjectDocumentsEnabled(bool isApplicationDocumentsEnabled) {
_isApplicationDocumentsEnabled = isApplicationDocumentsEnabled;
}
public static LinkItem ByPage(string page)
{
Expand Down Expand Up @@ -72,9 +72,9 @@ public static class ProjectNotes
public static readonly LinkItem NewNote = AddLinkItem(page: "/ProjectNotes/NewNote");
}

public static class ProjectDocuments
public static class ApplicationDocuments
{
public static readonly LinkItem Index = AddLinkItem(page: "/ProjectDocuments/Index");
public static readonly LinkItem Index = AddLinkItem(page: "/ApplicationDocuments/Index");
}

public static class TaskList
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@page "/application-documents/{id:int}"
@using Dfe.PrepareConversions.Data.Models
@model Dfe.PrepareConversions.Pages.ApplicationDocuments.IndexModel
@{
ViewData["Title"] = "Application documents";
}

@section BeforeMain
{
<a asp-page="@Model.ReturnPage" asp-route-id="@Model.ReturnId" class="govuk-back-link">@Links.ProjectList.Index.BackText</a>
}

<partial name="Shared/_ProjectHeader" model="Model.Project" />

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<p class="govuk-body">
Application level documents folder <a href="@Model.ApplicationLevelDocumentsFolder" class="govuk-link" rel="noreferrer noopener" target="_blank">here</a>
</p><p class="govuk-body">
School level documents folder <a href="@Model.SchoolLevelDocumentsFolder" class="govuk-link" rel="noreferrer noopener" target="_blank">here</a>
</p>
</div>

</div>
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,10 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Primitives;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Net;
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using static System.Net.WebRequestMethods;

namespace Dfe.PrepareConversions.Pages.ProjectDocuments;
namespace Dfe.PrepareConversions.Pages.ApplicationDocuments;

public class IndexModel : BaseAcademyConversionProjectPageModel
{
Expand All @@ -38,8 +33,6 @@ public override async Task<IActionResult> OnGetAsync(int id)
await base.OnGetAsync(id);
var rootSharePointFolder = _configuration["Sharepoint:Url"];

//https://educationgovuk.sharepoint.com/sites/sip-dev/sip_application/Forms/AllItems.aspx?id=%2Fsites%2Fsip%2Ddev%2Fsip%5Fapplication%2FA2B%5F0027%5F63B137B6D21DEB11A813000D3A38AA47

ApplicationLevelDocumentsFolder = $"{rootSharePointFolder}sip_application/{Project.ApplicationReferenceNumber}_{Project.ApplicationSharePointId.Value.ToString("N").ToUpper()}";
SchoolLevelDocumentsFolder = $"{rootSharePointFolder}sip_applyingschools/{Project.ApplicationReferenceNumber}_{Project.SchoolSharePointId.Value.ToString("N").ToUpper()}";

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@
School application form
</sub-menu-link>
</li>

<li if="@Links.IsApplicationDocumentsEnabled && !Model.IsExternalSchoolApplication" class="moj-sub-navigation__item">
<sub-menu-link class="moj-sub-navigation__link"
asp-page="@Links.ApplicationDocuments.Index.Page"
asp-route-id="@id">
Application documents
</sub-menu-link>
</li>
<li if="@Model.IsSponsored" class="moj-sub-navigation__item">
<sub-menu-link class="moj-sub-navigation__link"
asp-page="@Links.AnnexB.Index.Page"
Expand All @@ -60,12 +66,6 @@
Project notes
</sub-menu-link>
</li>
<li if="@Links.IsProjectDocumentsEnabled" class="moj-sub-navigation__item">
<sub-menu-link class="moj-sub-navigation__link"
asp-page="@Links.ProjectDocuments.Index.Page"
asp-route-id="@id">
Project documents
</sub-menu-link>
</li>

</ul>
</nav>

0 comments on commit a415119

Please sign in to comment.