-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also updated the pipelines to the new standard.
- Loading branch information
1 parent
78d02e5
commit e0404ed
Showing
44 changed files
with
4,765 additions
and
59 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
37 changes: 37 additions & 0 deletions
37
Infocaster.Umbraco.DateFolders.Website/Infocaster.Umbraco.DateFolders.Website.csproj
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,37 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
<PropertyGroup> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Umbraco.Cms" Version="10.0.1" /> | ||
<PackageReference Include="Umbraco.TheStarterKit" Version="10.0.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\src\Infocaster.Umbraco.DateFolders\Infocaster.Umbraco.DateFolders.csproj" /> | ||
</ItemGroup> | ||
|
||
<!-- Force Windows to use ICU. Otherwise Windows 10 2019H1+ will do it, but older Windows 10 and most, if not all, Windows Server editions will run NLS --> | ||
<ItemGroup> | ||
<PackageReference Include="Microsoft.ICU.ICU4C.Runtime" Version="68.2.0.9" /> | ||
<RuntimeHostConfigurationOption Include="System.Globalization.AppLocalIcu" Value="68.2.0.9" Condition="$(RuntimeIdentifier.StartsWith('linux')) or $(RuntimeIdentifier.StartsWith('win')) or ('$(RuntimeIdentifier)' == '' and !$([MSBuild]::IsOSPlatform('osx')))" /> | ||
</ItemGroup> | ||
|
||
|
||
<PropertyGroup> | ||
<CopyRazorGenerateFilesToPublishDirectory>true</CopyRazorGenerateFilesToPublishDirectory> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Folder Include="wwwroot" /> | ||
</ItemGroup> | ||
|
||
<!-- Keep this as false if ModelsBuilder mode is InMemoryAuto --> | ||
<PropertyGroup> | ||
<RazorCompileOnBuild>false</RazorCompileOnBuild> | ||
<RazorCompileOnPublish>false</RazorCompileOnPublish> | ||
</PropertyGroup> | ||
</Project> |
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,19 @@ | ||
namespace Infocaster.Umbraco.DateFolders.Website | ||
{ | ||
public class Program | ||
{ | ||
public static void Main(string[] args) | ||
=> CreateHostBuilder(args) | ||
.Build() | ||
.Run(); | ||
|
||
public static IHostBuilder CreateHostBuilder(string[] args) => | ||
Host.CreateDefaultBuilder(args) | ||
.ConfigureUmbracoDefaults() | ||
.ConfigureWebHostDefaults(webBuilder => | ||
{ | ||
webBuilder.UseStaticWebAssets(); | ||
webBuilder.UseStartup<Startup>(); | ||
}); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
Infocaster.Umbraco.DateFolders.Website/Properties/launchSettings.json
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,29 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/launchsettings.json", | ||
"iisSettings": { | ||
"windowsAuthentication": false, | ||
"anonymousAuthentication": true, | ||
"iisExpress": { | ||
"applicationUrl": "http://localhost:50975", | ||
"sslPort": 44376 | ||
} | ||
}, | ||
"profiles": { | ||
"IIS Express": { | ||
"commandName": "IISExpress", | ||
"launchBrowser": true, | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
} | ||
}, | ||
"Umbraco.Web.UI": { | ||
"commandName": "Project", | ||
"dotnetRunMessages": true, | ||
"launchBrowser": true, | ||
"applicationUrl": "https://localhost:44376;http://localhost:50975", | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
} | ||
} | ||
} | ||
} |
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,65 @@ | ||
namespace Infocaster.Umbraco.DateFolders.Website | ||
{ | ||
public class Startup | ||
{ | ||
private readonly IWebHostEnvironment _env; | ||
private readonly IConfiguration _config; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="Startup" /> class. | ||
/// </summary> | ||
/// <param name="webHostEnvironment">The web hosting environment.</param> | ||
/// <param name="config">The configuration.</param> | ||
/// <remarks> | ||
/// Only a few services are possible to be injected here https://github.com/dotnet/aspnetcore/issues/9337. | ||
/// </remarks> | ||
public Startup(IWebHostEnvironment webHostEnvironment, IConfiguration config) | ||
{ | ||
_env = webHostEnvironment ?? throw new ArgumentNullException(nameof(webHostEnvironment)); | ||
_config = config ?? throw new ArgumentNullException(nameof(config)); | ||
} | ||
|
||
/// <summary> | ||
/// Configures the services. | ||
/// </summary> | ||
/// <param name="services">The services.</param> | ||
/// <remarks> | ||
/// This method gets called by the runtime. Use this method to add services to the container. | ||
/// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940. | ||
/// </remarks> | ||
public void ConfigureServices(IServiceCollection services) | ||
{ | ||
services.AddUmbraco(_env, _config) | ||
.AddBackOffice() | ||
.AddWebsite() | ||
.AddComposers() | ||
.Build(); | ||
} | ||
|
||
/// <summary> | ||
/// Configures the application. | ||
/// </summary> | ||
/// <param name="app">The application builder.</param> | ||
/// <param name="env">The web hosting environment.</param> | ||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) | ||
{ | ||
if (env.IsDevelopment()) | ||
{ | ||
app.UseDeveloperExceptionPage(); | ||
} | ||
|
||
app.UseUmbraco() | ||
.WithMiddleware(u => | ||
{ | ||
u.UseBackOffice(); | ||
u.UseWebsite(); | ||
}) | ||
.WithEndpoints(u => | ||
{ | ||
u.UseInstallerEndpoints(); | ||
u.UseBackOfficeEndpoints(); | ||
u.UseWebsiteEndpoints(); | ||
}); | ||
} | ||
} | ||
} |
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,21 @@ | ||
@using ContentModels = Umbraco.Cms.Web.Common.PublishedModels | ||
|
||
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<ContentModels.Blog> | ||
|
||
@{ | ||
Layout = "master.cshtml"; | ||
} | ||
@Html.Partial("~/Views/Partials/SectionHeader.cshtml") | ||
|
||
<section class="section"> | ||
|
||
<div class="container"> | ||
@await Umbraco.RenderMacroAsync("latestBlogposts", | ||
new | ||
{ | ||
numberOfPosts = Model.HowManyPostsShouldBeShown, | ||
startNodeId = Model.Id | ||
}) | ||
</div> | ||
|
||
</section> |
24 changes: 24 additions & 0 deletions
24
Infocaster.Umbraco.DateFolders.Website/Views/Blogpost.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 @@ | ||
@using ContentModels = Umbraco.Cms.Web.Common.PublishedModels | ||
@using Microsoft.AspNetCore.Mvc.Rendering | ||
@using Umbraco.Extensions | ||
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<ContentModels.Blogpost> | ||
@{ | ||
Layout = "master.cshtml"; | ||
} | ||
@Html.Partial("~/Views/Partials/SectionHeader.cshtml") | ||
|
||
<section class="section"> | ||
<div class="container"> | ||
<article> | ||
<div class="blogpost-meta"> | ||
<small class="blogpost-date">@Model.CreateDate.ToShortDateString()</small> | ||
<span class="blogpost-cat"> | ||
@Html.Partial("~/Views/Partials/CategoryLinks.cshtml", Model.Categories) | ||
</span> | ||
</div> | ||
<h3>@Model.Excerpt</h3> | ||
@Html.GetGridHtml(Model, "bodyText", "bootstrap3-fluid") | ||
<!-- todo: implement discus comments --> | ||
</article> | ||
</div> | ||
</section> |
27 changes: 27 additions & 0 deletions
27
Infocaster.Umbraco.DateFolders.Website/Views/MacroPartials/FeaturedProducts.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,27 @@ | ||
@using Umbraco.Cms.Core.Models.PublishedContent | ||
@using Umbraco.Cms.Core.Routing | ||
@using Umbraco.Cms.Web.Common | ||
@using Umbraco.Extensions | ||
@inherits Umbraco.Cms.Web.Common.Macros.PartialViewMacroPage | ||
@inject UmbracoHelper Umbraco | ||
@inject IPublishedValueFallback PublishedValueFallback | ||
@inject IPublishedUrlProvider PublishedUrlProvider | ||
@* | ||
This snippet lists the items from a Multinode tree picker, using the pickers default settings. | ||
Content Values stored as xml. | ||
To get it working with any site's data structure, set the selection equal to the property which has the | ||
multinode treepicker (so: replace "PropertyWithPicker" with the alias of your property). | ||
*@ | ||
|
||
@{ var selection = Model.Content.Value<IEnumerable<IPublishedContent>>(PublishedValueFallback, "PropertyWithPicker").ToArray(); } | ||
|
||
<ul> | ||
@foreach (var id in selection) | ||
{ | ||
var item = Umbraco.Content(id); | ||
<li> | ||
<a href="@item.Url(PublishedUrlProvider)">@item.Name</a> | ||
</li> | ||
} | ||
</ul> |
102 changes: 102 additions & 0 deletions
102
Infocaster.Umbraco.DateFolders.Website/Views/MacroPartials/LatestBlogposts.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,102 @@ | ||
@using Microsoft.AspNetCore.Http | ||
@using ContentModels = Umbraco.Cms.Web.Common.PublishedModels | ||
@using Microsoft.AspNetCore.Mvc.Rendering | ||
@using Umbraco.Cms.Core.Routing | ||
@using Umbraco.Cms.Web.Common | ||
@inherits Umbraco.Cms.Web.Common.Macros.PartialViewMacroPage | ||
@inject UmbracoHelper Umbraco | ||
@inject IPublishedUrlProvider PublishedUrlProvider | ||
@inject IHttpContextAccessor HttpContextAccessor | ||
@{ | ||
var startNodeId = Model.MacroParameters["startNodeId"] ?? Model.Content.Id; | ||
|
||
var numberOfPosts = 3; | ||
if (Model.MacroParameters["numberOfPosts"] != null) | ||
{ | ||
int.TryParse((string)Model.MacroParameters["numberOfPosts"], out numberOfPosts); | ||
} | ||
} | ||
|
||
@if (startNodeId != null) | ||
{ | ||
@* Get the starting page *@ | ||
var startNode = Umbraco.Content(startNodeId); | ||
|
||
if (startNode == null) | ||
{ | ||
<div class="blogposts"> | ||
<h1>There are no posts at this time, try again later.</h1> | ||
</div> | ||
|
||
return; | ||
} | ||
|
||
var httpContext = HttpContextAccessor.HttpContext; | ||
|
||
//Gets all blogposts to calculate pages | ||
var blogposts = startNode.Children.OrderBy(x => x.CreateDate).ToList(); | ||
var pageCount = (int)Math.Ceiling((double)blogposts.Count / (double)numberOfPosts); | ||
//gets the page from the querystring and sets it to one if it is out of range | ||
var page = 1; | ||
if (httpContext != null && !string.IsNullOrEmpty(httpContext.Request.Query["page"])) | ||
{ | ||
int.TryParse(httpContext.Request.Query["page"], out page); | ||
if (page <= 0 || page > pageCount) | ||
{ | ||
page = 1; | ||
} | ||
} | ||
//Gets the blogposts for the current page | ||
var pagedBlogposts = blogposts.Skip((page - 1) * numberOfPosts).Take(numberOfPosts).ToList(); | ||
|
||
if (pagedBlogposts.Count > 0) | ||
{ | ||
<div class="blogposts"> | ||
|
||
@foreach (ContentModels.Blogpost post in pagedBlogposts) | ||
{ | ||
<a href="@post.Url(PublishedUrlProvider)" class="blogpost"> | ||
<div class="blogpost-meta"> | ||
<small class="blogpost-date">@post.CreateDate.ToShortDateString()</small> | ||
<small class="blogpost-cat"> | ||
@await Html.PartialAsync("~/Views/Partials/CategoryLinks.cshtml", post.Categories) | ||
</small> | ||
</div> | ||
<h3 class="blogpost-title">@post.PageTitle</h3> | ||
<div class="blogpost-excerpt">@post.Excerpt</div> | ||
</a> | ||
} | ||
</div> | ||
} | ||
|
||
if (blogposts.Count > numberOfPosts) | ||
{ | ||
<div class="pagination"> | ||
<nav class="nav-bar nav-bar--center"> | ||
@if (page <= 1) | ||
{ | ||
<span class="nav-link nav-link--black nav-link--disabled">Prev</span> | ||
} | ||
else | ||
{ | ||
<a class="nav-link nav-link--black" href="@(Model.Content.Url(PublishedUrlProvider) + "?page=" + (page - 1))">Prev</a> | ||
} | ||
|
||
@for (int i = 1; i <= pageCount; i++) | ||
{ | ||
<a class="nav-link nav-link--black @(page == i ? " nav-link--active" : null)" href="@(Model.Content.Url(PublishedUrlProvider) + "?page=" + i)">@i</a> | ||
} | ||
@if (page == pageCount) | ||
{ | ||
<span class="nav-link nav-link--black nav-link--disabled">Next</span> | ||
} | ||
else | ||
{ | ||
<a class="nav-link nav-link--black" href="@(Model.Content.Url(PublishedUrlProvider) + "?page=" + (page + 1))">Next</a> | ||
} | ||
|
||
</nav> | ||
</div> | ||
} | ||
} | ||
|
7 changes: 7 additions & 0 deletions
7
Infocaster.Umbraco.DateFolders.Website/Views/Partials/CategoryLinks.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,7 @@ | ||
@model IEnumerable<string> | ||
@foreach (var category in Model) | ||
{ | ||
<!-- TODO: Add links to categories--> | ||
@category | ||
<text> </text> | ||
} |
29 changes: 29 additions & 0 deletions
29
Infocaster.Umbraco.DateFolders.Website/Views/Partials/ContactForm.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,29 @@ | ||
@using Umbraco.Extensions | ||
@using Umbraco.SampleSite | ||
@model Umbraco.SampleSite.ContactFormViewModel | ||
|
||
@{ | ||
var message = TempData["Message"]?.ToString(); | ||
} | ||
<div class="form-group"> | ||
@using (Html.BeginUmbracoForm<ContactFormController>(nameof(ContactFormController.Submit))) | ||
{ | ||
<div> | ||
@Html.TextBoxFor(m => m.Name, new {@class="form-control", placeholder = Html.DisplayNameFor(m => m.Name)}) | ||
@Html.ValidationMessageFor(m => m.Name) | ||
</div> | ||
<div> | ||
@Html.TextBoxFor(m => m.Email, new {@class="form-control", placeholder = Html.DisplayNameFor(m => m.Email)}) | ||
@Html.ValidationMessageFor(m => m.Email) | ||
</div> | ||
<div> | ||
@Html.TextAreaFor(m => m.Message, new {@class="form-control", placeholder = Html.DisplayNameFor(m => m.Message)}) | ||
@Html.ValidationMessageFor(m => m.Message) | ||
</div> | ||
<input type="submit" name="Submit" value="Submit"/> | ||
@if (!string.IsNullOrEmpty(message)) | ||
{ | ||
@message | ||
} | ||
} | ||
</div> |
16 changes: 16 additions & 0 deletions
16
Infocaster.Umbraco.DateFolders.Website/Views/Partials/Navigation/SubNavigation.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,16 @@ | ||
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage | ||
@using Umbraco.Cms.Core.Models.PublishedContent | ||
@using Umbraco.Cms.Core.Routing | ||
@using Umbraco.Extensions | ||
|
||
@inject IPublishedValueFallback PublishedValueFallback | ||
@inject IPublishedUrlProvider PublishedUrlProvider | ||
@{ | ||
var siteSection = Model.AncestorOrSelf(2); | ||
var selection = siteSection.Children.Where(x => x.IsVisible(PublishedValueFallback)); | ||
} | ||
|
||
@foreach (var item in selection) | ||
{ | ||
<a class="nav-link nav-link--black nav-link--air-bottom @(item.IsAncestorOrSelf(Model) ? "nav-link--active" : null)" href="@item.Url(PublishedUrlProvider)">@item.Name</a> | ||
} |
Oops, something went wrong.