Many updates for OAP
This commit is contained in:
28
Twain.sln
28
Twain.sln
@@ -14,17 +14,21 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Build", "tools\Build\Build.
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MarkdownImport", "src\Modules\MarkdownImport\MarkdownImport.csproj", "{7B0477DA-BCD5-47ED-8B88-76D046524434}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BenRameyTheme", "src\Themes\BenRameyTheme\BenRameyTheme.csproj", "{A7498019-5941-479B-ADB2-56B6C984C608}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Themes", "Themes", "{C5891B30-F830-4094-A4D5-E2DB8D9ED819}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BenRameyTheme", "src\BenRamey\BenRameyTheme\BenRameyTheme.csproj", "{A7498019-5941-479B-ADB2-56B6C984C608}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Modules", "Modules", "{3DA05917-02EA-4B04-9C48-B86C77A73584}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OapTheme", "src\Themes\OapTheme\OapTheme.csproj", "{4BB167BD-2BC4-4DFB-B1E2-813EC2E2D8FF}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OapTheme", "src\OAP\OapTheme\OapTheme.csproj", "{4BB167BD-2BC4-4DFB-B1E2-813EC2E2D8FF}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OapApi.v1.Client", "src\OapApi.v1.Client\OapApi.v1.Client.csproj", "{5C30AB89-B3D4-468F-A029-3D26FECD0083}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OapApi.v1.Client", "src\OAP\OapApi.v1.Client\OapApi.v1.Client.csproj", "{5C30AB89-B3D4-468F-A029-3D26FECD0083}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OapApi.v1", "src\Modules\OapApi.v1\OapApi.v1.csproj", "{D414342C-EA8D-4115-BF22-DC8B62FB3CBF}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OapApi.v1", "src\OAP\OapApi.v1\OapApi.v1.csproj", "{D414342C-EA8D-4115-BF22-DC8B62FB3CBF}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OverseasAutoProtection", "src\OAP\OverseasAutoProtection\OverseasAutoProtection.csproj", "{D2827FDB-33A0-45E9-9F75-EB81BCE3833F}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OAP", "OAP", "{E6EDFA50-6BFE-44C5-BEEB-18108A20F625}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BenRamey", "BenRamey", "{03C1520E-5ABF-4AF7-858B-8BE234ACE0FB}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@@ -60,6 +64,10 @@ Global
|
||||
{D414342C-EA8D-4115-BF22-DC8B62FB3CBF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D414342C-EA8D-4115-BF22-DC8B62FB3CBF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D414342C-EA8D-4115-BF22-DC8B62FB3CBF}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D2827FDB-33A0-45E9-9F75-EB81BCE3833F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D2827FDB-33A0-45E9-9F75-EB81BCE3833F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D2827FDB-33A0-45E9-9F75-EB81BCE3833F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D2827FDB-33A0-45E9-9F75-EB81BCE3833F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -67,9 +75,11 @@ Global
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{97FFBB7D-C82D-47B2-B110-377B5F6B49C2} = {7C34E548-E385-4902-8A50-B7F49CABAC10}
|
||||
{7B0477DA-BCD5-47ED-8B88-76D046524434} = {3DA05917-02EA-4B04-9C48-B86C77A73584}
|
||||
{A7498019-5941-479B-ADB2-56B6C984C608} = {C5891B30-F830-4094-A4D5-E2DB8D9ED819}
|
||||
{4BB167BD-2BC4-4DFB-B1E2-813EC2E2D8FF} = {C5891B30-F830-4094-A4D5-E2DB8D9ED819}
|
||||
{D414342C-EA8D-4115-BF22-DC8B62FB3CBF} = {3DA05917-02EA-4B04-9C48-B86C77A73584}
|
||||
{A7498019-5941-479B-ADB2-56B6C984C608} = {03C1520E-5ABF-4AF7-858B-8BE234ACE0FB}
|
||||
{4BB167BD-2BC4-4DFB-B1E2-813EC2E2D8FF} = {E6EDFA50-6BFE-44C5-BEEB-18108A20F625}
|
||||
{5C30AB89-B3D4-468F-A029-3D26FECD0083} = {E6EDFA50-6BFE-44C5-BEEB-18108A20F625}
|
||||
{D414342C-EA8D-4115-BF22-DC8B62FB3CBF} = {E6EDFA50-6BFE-44C5-BEEB-18108A20F625}
|
||||
{D2827FDB-33A0-45E9-9F75-EB81BCE3833F} = {E6EDFA50-6BFE-44C5-BEEB-18108A20F625}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {0F7F9D4C-DF95-43AF-9E9A-DA09B5EE03C7}
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
using OrchardCore.Modules.Manifest;
|
||||
|
||||
[assembly: Module(
|
||||
Name = "Overseas Auto Protection API",
|
||||
Id = "OAP.APIv1",
|
||||
Name = "Overseas Auto Protection API v1",
|
||||
Author = "Overseas Auto Protection",
|
||||
Website = "https://oaprotection.org/api/v1/",
|
||||
Version = "0.0.1",
|
||||
Description = "API for OAP services",
|
||||
Category = "Content Management"
|
||||
Category = "Content Management",
|
||||
Dependencies = [
|
||||
"OAP.Content"
|
||||
]
|
||||
)]
|
||||
|
||||
@@ -11,14 +11,14 @@
|
||||
<PackageReference Include="Facility.AspNetCore" Version="3.9.0" />
|
||||
<PackageReference Include="Facility.Core" Version="2.27.0" />
|
||||
<PackageReference Include="OrchardCore.Module.Targets" Version="1.8.2" />
|
||||
<PackageReference Include="OrchardCore.ContentManagement" Version="1.8.2" />
|
||||
<PackageReference Include="OrchardCore.ContentTypes.Abstractions" Version="1.8.2" />
|
||||
<PackageReference Include="OrchardCore.DisplayManagement" Version="1.8.2" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\OapApi.v1.Client\OapApi.v1.Client.csproj" />
|
||||
<ProjectReference Include="..\OapApi.v1.Client\OapApi.v1.Client.csproj" />
|
||||
<ProjectReference Include="..\OverseasAutoProtection\OverseasAutoProtection.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -6,6 +6,11 @@ namespace OapApi.v1;
|
||||
|
||||
public sealed class OapApiV1 : IOapApiV1
|
||||
{
|
||||
public OapApiV1()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Task<ServiceResult<CreateApplicationResponseDto>> CreateApplicationAsync(CreateApplicationRequestDto request, CancellationToken cancellationToken = default) => throw new NotImplementedException();
|
||||
|
||||
public Task<ServiceResult<GetApplicationResponseDto>> GetApplicationAsync(GetApplicationRequestDto request, CancellationToken cancellationToken = default)
|
||||
@@ -1,9 +1,13 @@
|
||||
using OrchardCore.DisplayManagement.Manifest;
|
||||
|
||||
[assembly: Theme(
|
||||
Id = "OAP.Theme",
|
||||
Name = "OAP Theme",
|
||||
Author = "Ben Ramey",
|
||||
Author = "Overseas Auto Protection",
|
||||
Website = "https://oaprotection.org/",
|
||||
Version = "0.0.1",
|
||||
Description = "Overseas Auto Protection site theme."
|
||||
Description = "Overseas Auto Protection site theme.",
|
||||
Dependencies = [
|
||||
"OAP.Content",
|
||||
]
|
||||
)]
|
||||
@@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Razor">
|
||||
<Project Sdk="Microsoft.NET.Sdk.Razor">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
@@ -7,6 +7,12 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Remove="Views\HtmlBodyPart.cshtml" />
|
||||
<EmbeddedResource Remove="Views\Layout.cshtml" />
|
||||
<EmbeddedResource Remove="Views\_ViewImports.cshtml" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
||||
</ItemGroup>
|
||||
@@ -16,6 +22,7 @@
|
||||
<PackageReference Include="OrchardCore.ContentFields" Version="1.8.2" />
|
||||
<PackageReference Include="OrchardCore.Flows" Version="1.8.2" />
|
||||
<PackageReference Include="OrchardCore.Forms" Version="1.8.2" />
|
||||
<PackageReference Include="OrchardCore.Html" Version="1.8.2" />
|
||||
<PackageReference Include="OrchardCore.Lists" Version="1.8.2" />
|
||||
<PackageReference Include="OrchardCore.Theme.Targets" Version="1.8.2" />
|
||||
<PackageReference Include="OrchardCore.ContentManagement" Version="1.8.2" />
|
||||
@@ -24,8 +31,11 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Models\" />
|
||||
<Folder Include="wwwroot\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\OverseasAutoProtection\OverseasAutoProtection.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -1,6 +1,5 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Options;
|
||||
using OrchardCore.Data.Migration;
|
||||
using OrchardCore.Modules;
|
||||
using OrchardCore.ResourceManagement;
|
||||
|
||||
@@ -11,6 +10,5 @@ public class Startup : StartupBase
|
||||
public override void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddTransient<IConfigureOptions<ResourceManagementOptions>, ResourceManagementOptionsConfiguration>();
|
||||
services.AddDataMigration<Migrations>();
|
||||
}
|
||||
}
|
||||
5
src/OAP/OapTheme/Views/HtmlBodyPart.cshtml
Normal file
5
src/OAP/OapTheme/Views/HtmlBodyPart.cshtml
Normal file
@@ -0,0 +1,5 @@
|
||||
@model OrchardCore.Html.ViewModels.HtmlBodyPartViewModel
|
||||
|
||||
<div class="richtext">
|
||||
@Html.Raw(Model.Html)
|
||||
</div>
|
||||
36
src/OAP/OapTheme/Views/Layout.cshtml
Normal file
36
src/OAP/OapTheme/Views/Layout.cshtml
Normal file
@@ -0,0 +1,36 @@
|
||||
@using OrchardCore.Admin.Models
|
||||
@using OrchardCore.DisplayManagement
|
||||
@using OrchardCore.DisplayManagement.ModelBinding
|
||||
@using OrchardCore.Entities
|
||||
@using OrchardCore.Users.Models
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="@Orchard.CultureName()" dir="@Orchard.CultureDir()">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
|
||||
<title>@RenderTitleSegments(Site.SiteName, "before")</title>
|
||||
|
||||
<resources type="Meta" />
|
||||
|
||||
<link type="image/x-icon" rel="shortcut icon" href="~/OapTheme/assets/favicon.ico">
|
||||
|
||||
<style asp-name="oaptheme-styles"></style>
|
||||
|
||||
<resources type="HeadLink" />
|
||||
<resources type="Stylesheet" />
|
||||
<resources type="HeadScript" />
|
||||
|
||||
@await RenderSectionAsync("HeadMeta", required: false)
|
||||
</head>
|
||||
<body>
|
||||
@await RenderSectionAsync("Header", required: false)
|
||||
|
||||
@await RenderBodyAsync()
|
||||
|
||||
@await RenderSectionAsync("Footer", required: false)
|
||||
|
||||
<resources type="FootScript" />
|
||||
</body>
|
||||
</html>
|
||||
13
src/OAP/OapTheme/Views/_ViewImports.cshtml
Normal file
13
src/OAP/OapTheme/Views/_ViewImports.cshtml
Normal file
@@ -0,0 +1,13 @@
|
||||
@*
|
||||
For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860
|
||||
*@
|
||||
|
||||
@inherits OrchardCore.DisplayManagement.Razor.RazorPage<TModel>
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@addTagHelper *, OrchardCore.DisplayManagement
|
||||
@addTagHelper *, OrchardCore.ResourceManagement
|
||||
@addTagHelper *, OrchardCore.Menu
|
||||
@using Microsoft.AspNetCore.Routing
|
||||
@using Microsoft.Extensions.Options
|
||||
@using OrchardCore.ContentManagement
|
||||
@using OrchardCore.ContentManagement.Routing
|
||||
7
src/OAP/OverseasAutoProtection/ContentTypes.cs
Normal file
7
src/OAP/OverseasAutoProtection/ContentTypes.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace OverseasAutoProtection;
|
||||
public static class ContentTypes
|
||||
{
|
||||
public const string OapApplication = nameof(OapApplication);
|
||||
public const string OapApplicationForm = nameof(OapApplicationForm);
|
||||
public const string OapApplicationFormStep = nameof(OapApplicationFormStep);
|
||||
}
|
||||
20
src/OAP/OverseasAutoProtection/Manifest.cs
Normal file
20
src/OAP/OverseasAutoProtection/Manifest.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using OrchardCore.Modules.Manifest;
|
||||
|
||||
[assembly: Module(
|
||||
Id = "OAP.Content",
|
||||
Name = "Overseas Auto Protection",
|
||||
Author = "Overseas Auto Protection",
|
||||
Website = "https://oaprotection.org/",
|
||||
Version = "0.0.1",
|
||||
Description = "The base OAP module, providing content types, parts, etc",
|
||||
Category = "Content Management",
|
||||
Dependencies = [
|
||||
"OrchardCore.ContentFields",
|
||||
"OrchardCore.Autoroute",
|
||||
"OrchardCore.Flows",
|
||||
"OrchardCore.Forms",
|
||||
"OrchardCore.Html",
|
||||
"OrchardCore.Lists",
|
||||
"OrchardCore.Title",
|
||||
]
|
||||
)]
|
||||
118
src/OAP/OverseasAutoProtection/Migrations.cs
Normal file
118
src/OAP/OverseasAutoProtection/Migrations.cs
Normal file
@@ -0,0 +1,118 @@
|
||||
using OrchardCore.Autoroute.Models;
|
||||
using OrchardCore.ContentFields.Fields;
|
||||
using OrchardCore.ContentFields.Settings;
|
||||
using OrchardCore.ContentManagement.Metadata;
|
||||
using OrchardCore.ContentManagement.Metadata.Settings;
|
||||
using OrchardCore.Data.Migration;
|
||||
using OrchardCore.Flows.Models;
|
||||
using OrchardCore.Html.Models;
|
||||
using OrchardCore.Html.Settings;
|
||||
using OrchardCore.Lists.Models;
|
||||
using OrchardCore.Mvc.Utilities;
|
||||
using OrchardCore.Title.Models;
|
||||
using OverseasAutoProtection.OapApplication;
|
||||
|
||||
namespace OverseasAutoProtection;
|
||||
|
||||
public class Migrations : DataMigration
|
||||
{
|
||||
public Migrations(IContentDefinitionManager contentDefinitionManager)
|
||||
{
|
||||
m_contentDefinitionManager = contentDefinitionManager;
|
||||
}
|
||||
|
||||
public async Task<int> CreateAsync()
|
||||
{
|
||||
await m_contentDefinitionManager
|
||||
.AlterTypeDefinitionAsync(ContentTypes.OapApplicationFormStep, type => type
|
||||
.Securable()
|
||||
.Draftable()
|
||||
.Versionable()
|
||||
.WithPart(nameof(TitlePart), part => part
|
||||
.WithPosition("1"))
|
||||
.WithPart(nameof(AutoroutePart), part => part
|
||||
.WithPosition("2")
|
||||
.WithSettings(new AutoroutePartSettings
|
||||
{
|
||||
AllowCustomPath = true,
|
||||
AllowUpdatePath = true,
|
||||
}))
|
||||
.WithPart(nameof(FlowPart), part => part
|
||||
.WithPosition("3")));
|
||||
|
||||
await m_contentDefinitionManager
|
||||
.AlterTypeDefinitionAsync(ContentTypes.OapApplicationForm, type => type
|
||||
.Creatable()
|
||||
.Listable()
|
||||
.Securable()
|
||||
.Draftable()
|
||||
.Versionable()
|
||||
.WithPart(nameof(AutoroutePart), part => part
|
||||
.WithPosition("2")
|
||||
.WithSettings(new AutoroutePartSettings
|
||||
{
|
||||
AllowCustomPath = true,
|
||||
AllowUpdatePath = true,
|
||||
}))
|
||||
.WithPart(nameof(ListPart), part => part
|
||||
.WithDisplayName("Form Steps")
|
||||
.WithPosition("3")
|
||||
.WithSettings(new ListPartSettings
|
||||
{
|
||||
PageSize = 10,
|
||||
EnableOrdering = true,
|
||||
ContainedContentTypes = [ContentTypes.OapApplicationFormStep]
|
||||
})
|
||||
));
|
||||
|
||||
await m_contentDefinitionManager
|
||||
.AlterPartDefinitionAsync(nameof(OapApplicationPart), builder => builder
|
||||
.Attachable()
|
||||
.WithField(nameof(OapApplicationPart.Status), field => field
|
||||
.OfType(nameof(TextField))
|
||||
.WithDisplayName(nameof(OapApplicationPart.Status))
|
||||
.WithDescription("The status of the OAP Application.")
|
||||
.WithEditor("PredefinedList")
|
||||
.WithSettings(new TextFieldPredefinedListEditorSettings
|
||||
{
|
||||
Options = new[]
|
||||
{
|
||||
new ListValueOption { Name = OapApplicationStatuses.InProgress, Value = OapApplicationStatuses.InProgress.HtmlClassify() },
|
||||
new ListValueOption { Name = OapApplicationStatuses.Submitted, Value = OapApplicationStatuses.Submitted.HtmlClassify() },
|
||||
},
|
||||
DefaultValue = OapApplicationStatuses.InProgress.HtmlClassify(),
|
||||
Editor = EditorOption.Radio,
|
||||
}))
|
||||
.WithDescription("Makes a content item into an OAP Application."));
|
||||
|
||||
await m_contentDefinitionManager
|
||||
.AlterTypeDefinitionAsync(ContentTypes.OapApplication, type => type
|
||||
.Creatable()
|
||||
.Listable()
|
||||
.Securable()
|
||||
.WithPart(nameof(HtmlBodyPart), part => part
|
||||
.WithDisplayName("Notes")
|
||||
.WithSettings(new ContentTypePartSettings { Editor = "Wysiwyg", })
|
||||
)
|
||||
.WithPart(nameof(OapApplicationPart)));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
public async Task<int> UpdateFrom1Async()
|
||||
{
|
||||
await m_contentDefinitionManager
|
||||
.AlterTypeDefinitionAsync(ContentTypes.OapApplicationFormStep, type => type
|
||||
.WithPart(nameof(HtmlBodyPart), part => part
|
||||
.WithPosition("2")
|
||||
.WithEditor("Wysiwyg")
|
||||
.WithSettings(new HtmlBodyPartSettings
|
||||
{
|
||||
SanitizeHtml = true,
|
||||
})));
|
||||
|
||||
return 2;
|
||||
}
|
||||
|
||||
private readonly IContentDefinitionManager m_contentDefinitionManager;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using OrchardCore.ContentFields.Fields;
|
||||
using OrchardCore.ContentManagement;
|
||||
|
||||
namespace OverseasAutoProtection.OapApplication;
|
||||
public class OapApplicationPart : ContentPart
|
||||
{
|
||||
public TextField ApplicationId { get; set; } = new();
|
||||
public int Year { get; set; }
|
||||
public TextField Status { get; set; } = new();
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace OverseasAutoProtection.OapApplication;
|
||||
|
||||
public static class OapApplicationStatuses
|
||||
{
|
||||
public const string InProgress = nameof(InProgress);
|
||||
public const string Submitted = nameof(Submitted);
|
||||
}
|
||||
23
src/OAP/OverseasAutoProtection/OverseasAutoProtection.csproj
Normal file
23
src/OAP/OverseasAutoProtection/OverseasAutoProtection.csproj
Normal file
@@ -0,0 +1,23 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="OrchardCore.Autoroute" Version="1.8.2" />
|
||||
<PackageReference Include="OrchardCore.ContentFields" Version="1.8.2" />
|
||||
<PackageReference Include="OrchardCore.Flows" Version="1.8.2" />
|
||||
<PackageReference Include="OrchardCore.Forms" Version="1.8.2" />
|
||||
<PackageReference Include="OrchardCore.Html" Version="1.8.2" />
|
||||
<PackageReference Include="OrchardCore.Lists" Version="1.8.2" />
|
||||
<PackageReference Include="OrchardCore.Module.Targets" Version="1.8.2" />
|
||||
<PackageReference Include="OrchardCore.ContentManagement" Version="1.8.2" />
|
||||
<PackageReference Include="OrchardCore.ContentTypes.Abstractions" Version="1.8.2" />
|
||||
<PackageReference Include="OrchardCore.DisplayManagement" Version="1.8.2" />
|
||||
<PackageReference Include="OrchardCore.Title" Version="1.8.2" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
21
src/OAP/OverseasAutoProtection/Startup.cs
Normal file
21
src/OAP/OverseasAutoProtection/Startup.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Routing;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using OrchardCore.Data.Migration;
|
||||
using OverseasAutoProtection.OapApplication;
|
||||
|
||||
namespace OverseasAutoProtection;
|
||||
|
||||
public class Startup : OrchardCore.Modules.StartupBase
|
||||
{
|
||||
public override void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddScoped<OapApplicationPart>();
|
||||
|
||||
services.AddDataMigration<Migrations>();
|
||||
}
|
||||
|
||||
public override void Configure(IApplicationBuilder builder, IEndpointRouteBuilder routes, IServiceProvider serviceProvider)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using OrchardCore.Data;
|
||||
|
||||
namespace OapTheme.Controllers;
|
||||
public class ApplicationFormController : Controller
|
||||
{
|
||||
public ApplicationFormController(IDbConnectionAccessor dbConnectionAccessor)
|
||||
{
|
||||
m_dbConnectionAccessor = dbConnectionAccessor;
|
||||
}
|
||||
|
||||
public IActionResult Index()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
private readonly IDbConnectionAccessor m_dbConnectionAccessor;
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
using OrchardCore.Autoroute.Models;
|
||||
using OrchardCore.ContentFields.Fields;
|
||||
using OrchardCore.ContentFields.Settings;
|
||||
using OrchardCore.ContentManagement.Metadata;
|
||||
using OrchardCore.ContentManagement.Metadata.Settings;
|
||||
using OrchardCore.Data.Migration;
|
||||
using OrchardCore.Flows.Models;
|
||||
using OrchardCore.Lists.Models;
|
||||
|
||||
namespace OapTheme;
|
||||
public sealed class Migrations : DataMigration
|
||||
{
|
||||
public Migrations(IContentDefinitionManager contentDefinitionManager)
|
||||
{
|
||||
m_contentDefinitionManager = contentDefinitionManager;
|
||||
}
|
||||
|
||||
public async Task<int> Create()
|
||||
{
|
||||
await m_contentDefinitionManager.AlterTypeDefinitionAsync("ApplicationFormStep", type => type
|
||||
.Draftable()
|
||||
.Versionable()
|
||||
.WithPart("ApplicationFormStep", part => part
|
||||
.WithPosition("1"))
|
||||
.WithPart<AutoroutePart>("Autoroute", part => part
|
||||
.WithPosition("2")
|
||||
.WithSettings(new AutoroutePartSettings
|
||||
{
|
||||
AllowCustomPath = true,
|
||||
AllowUpdatePath = true,
|
||||
}))
|
||||
.WithPart<FlowPart>("Form", part => part
|
||||
.WithPosition("3")
|
||||
.WithSettings(new FlowPartSettings
|
||||
{
|
||||
ContainedContentTypes = new[]
|
||||
{
|
||||
"Form",
|
||||
}
|
||||
})));
|
||||
|
||||
await m_contentDefinitionManager.AlterPartDefinitionAsync("ApplicationFormStep", part => part
|
||||
.WithField<TextField>("Heading", field => field
|
||||
.WithPosition("1")
|
||||
.WithSettings(new TextFieldSettings
|
||||
{
|
||||
Hint = "Text to display at the top of the form step, above the instructions.",
|
||||
Required = true,
|
||||
}))
|
||||
.WithField<HtmlField>("Instructions", field => field
|
||||
.WithPosition("2")
|
||||
.WithEditor("Wysiwyg")
|
||||
.WithSettings(new HtmlFieldSettings
|
||||
{
|
||||
SanitizeHtml = true,
|
||||
})));
|
||||
|
||||
await m_contentDefinitionManager.AlterTypeDefinitionAsync("ApplicationForm", type => type
|
||||
.DisplayedAs("Application Form")
|
||||
.Draftable()
|
||||
.Versionable()
|
||||
.Securable()
|
||||
.Listable()
|
||||
.Creatable()
|
||||
.WithPart<AutoroutePart>("Autoroute", part => part
|
||||
.WithPosition("2")
|
||||
.WithSettings(new AutoroutePartSettings
|
||||
{
|
||||
AllowCustomPath = true,
|
||||
AllowUpdatePath = true,
|
||||
}))
|
||||
.WithPart<ListPart>("Form Steps", part => part
|
||||
.WithPosition("3")
|
||||
.WithSettings(new ListPartSettings
|
||||
{
|
||||
PageSize = 10,
|
||||
EnableOrdering = true,
|
||||
ContainedContentTypes = new[]
|
||||
{
|
||||
"ApplicationFormStep",
|
||||
}
|
||||
})));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
private readonly IContentDefinitionManager m_contentDefinitionManager;
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
<div class="richtext">
|
||||
{{ Model.Html | sanitize_html | raw }}
|
||||
</div>
|
||||
@@ -1,31 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ Culture.Name }}">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<title>{% page_title Site.SiteName, position: "before", separator: " - " %}</title>
|
||||
|
||||
{% resources type: "Meta" %}
|
||||
|
||||
{% link type: "image/x-icon", rel: "shortcut icon", href: "~/OapTheme/assets/favicon.ico" %}
|
||||
|
||||
{% style name: "oaptheme-styles" %}
|
||||
|
||||
{% resources type: "HeadLink" %}
|
||||
{% resources type: "Stylesheet" %}
|
||||
{% resources type: "HeadScript" %}
|
||||
</head>
|
||||
|
||||
<body dir="{{ Culture.Dir }}">
|
||||
{% render_section "Header", required: false %}
|
||||
|
||||
{% render_body %}
|
||||
|
||||
{% render_section "Footer", required: false %}
|
||||
|
||||
{% resources type: "FootScript" %}
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,10 +0,0 @@
|
||||
<article class="page">
|
||||
<h1 class="page-title">404 : Page not found</h1>
|
||||
<p>
|
||||
Sorry, we've misplaced that URL or it's pointing to something that doesn't exist.
|
||||
</p>
|
||||
<p>
|
||||
<a href="/">Head back home</a>
|
||||
<span>to try finding it again.</span>
|
||||
</p>
|
||||
</article>
|
||||
@@ -24,10 +24,12 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\BenRamey\BenRameyTheme\BenRameyTheme.csproj" />
|
||||
<ProjectReference Include="..\Modules\MarkdownImport\MarkdownImport.csproj" />
|
||||
<ProjectReference Include="..\Modules\OapApi.v1\OapApi.v1.csproj" />
|
||||
<ProjectReference Include="..\Themes\BenRameyTheme\BenRameyTheme.csproj" />
|
||||
<ProjectReference Include="..\Themes\OapTheme\OapTheme.csproj" />
|
||||
<ProjectReference Include="..\OAP\OapApi.v1.Client\OapApi.v1.Client.csproj" />
|
||||
<ProjectReference Include="..\OAP\OapApi.v1\OapApi.v1.csproj" />
|
||||
<ProjectReference Include="..\OAP\OapTheme\OapTheme.csproj" />
|
||||
<ProjectReference Include="..\OAP\OverseasAutoProtection\OverseasAutoProtection.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user