-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1082 from DFE-Digital/feature/school-trust-sharep…
…oint-files Feature/school trust sharepoint files
- Loading branch information
Showing
12 changed files
with
362 additions
and
231 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
8 changes: 8 additions & 0 deletions
8
Dfe.PrepareConversions/Dfe.PrepareConversions/Configuration/SharePointOptions.cs
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,8 @@ | ||
namespace Dfe.PrepareConversions.Configuration | ||
{ | ||
public class SharePointOptions | ||
{ | ||
public bool Enabled { get; set; } | ||
public string Url { get; set; } | ||
} | ||
} |
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
24 changes: 24 additions & 0 deletions
24
Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/ApplicationDocuments/Index.cshtml
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,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> |
41 changes: 41 additions & 0 deletions
41
Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/ApplicationDocuments/Index.cshtml.cs
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,41 @@ | ||
using AngleSharp.Io.Dom; | ||
using Dfe.PrepareConversions.Data.Services; | ||
using Dfe.PrepareConversions.Models; | ||
using Dfe.PrepareConversions.Services; | ||
using Dfe.PrepareConversions.ViewModels; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.Extensions.Primitives; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using Microsoft.Extensions.Configuration; | ||
|
||
namespace Dfe.PrepareConversions.Pages.ApplicationDocuments; | ||
|
||
public class IndexModel : BaseAcademyConversionProjectPageModel | ||
{ | ||
private readonly IConfiguration _configuration; | ||
|
||
public string ReturnPage { get; set; } | ||
public string ReturnId { get; set; } | ||
|
||
public IndexModel(IAcademyConversionProjectRepository repository, IConfiguration configuration) : base(repository) | ||
{ | ||
_configuration = configuration; | ||
} | ||
|
||
[BindProperty] | ||
public string ApplicationLevelDocumentsFolder { get; set; } | ||
[BindProperty] | ||
public string SchoolLevelDocumentsFolder { get; private set; } | ||
|
||
public override async Task<IActionResult> OnGetAsync(int id) | ||
{ | ||
await base.OnGetAsync(id); | ||
var rootSharePointFolder = _configuration["Sharepoint:Url"]; | ||
|
||
ApplicationLevelDocumentsFolder = $"{rootSharePointFolder}sip_application/{Project.ApplicationReferenceNumber}_{Project.ApplicationSharePointId.Value.ToString("N").ToUpper()}"; | ||
SchoolLevelDocumentsFolder = $"{rootSharePointFolder}sip_applyingschools/{Project.ApplicationReferenceNumber}_{Project.SchoolSharePointId.Value.ToString("N").ToUpper()}"; | ||
|
||
return Page(); | ||
} | ||
} |
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
Oops, something went wrong.