Merge remote-tracking branch 'origin/netcore/feature/fix-integration-tests' into netcore/feature/better-linux-support
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
This commit is contained in:
@@ -1,132 +0,0 @@
|
||||
@using Umbraco.Core
|
||||
@using Umbraco.Web.Composing
|
||||
@using Umbraco.Web
|
||||
@using Umbraco.Web.WebAssets
|
||||
@using Umbraco.Web.Common.Security
|
||||
@using Umbraco.Core.WebAssets
|
||||
@using Umbraco.Core.Configuration
|
||||
@using Umbraco.Core.Hosting
|
||||
@using Umbraco.Extensions
|
||||
@using Umbraco.Core.Logging
|
||||
@using Umbraco.Web.BackOffice.Controllers
|
||||
@inject BackOfficeSignInManager signInManager
|
||||
@inject BackOfficeServerVariables backOfficeServerVariables
|
||||
@inject IUmbracoVersion umbracoVersion
|
||||
@inject IHostingEnvironment hostingEnvironment
|
||||
@inject IGlobalSettings globalSettings
|
||||
@inject IRuntimeMinifier runtimeMinifier
|
||||
@inject IProfilerHtml profilerHtml
|
||||
|
||||
@{
|
||||
var isDebug = false;
|
||||
var qryDebug = Context.Request.Query["umbDebug"].TryConvertTo<bool>();
|
||||
isDebug = qryDebug.Success && qryDebug.Result;
|
||||
var backOfficePath = globalSettings.GetBackOfficePath(hostingEnvironment);
|
||||
}
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<base href="@backOfficePath.EnsureEndsWith('/')" />
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<meta name="pinterest" content="nopin" />
|
||||
|
||||
<title ng-bind="$root.locationTitle">Umbraco</title>
|
||||
|
||||
@Html.Raw(await runtimeMinifier.RenderCssHereAsync(BackOfficeWebAssets.UmbracoInitCssBundleName))
|
||||
|
||||
</head>
|
||||
<body ng-class="{'touch':touchDevice, 'emptySection':emptySection, 'umb-drawer-is-visible':drawer.show, 'umb-tour-is-visible': tour.show, 'tabbing-active':tabbingActive}" ng-controller="Umbraco.MainController" id="umbracoMainPageBody">
|
||||
|
||||
<noscript>
|
||||
<div style="margin: 10px;">
|
||||
<h3><img src="assets/img/application/logo.png" alt="Umbraco logo" style="vertical-align: text-bottom;" /> Umbraco</h3>
|
||||
<p>For full functionality of Umbraco CMS it is necessary to enable JavaScript.</p>
|
||||
<p>Here are the <a href="https://www.enable-javascript.com/" target="_blank" style="text-decoration: underline;">instructions how to enable JavaScript in your web browser</a>.</p>
|
||||
</div>
|
||||
</noscript>
|
||||
|
||||
<div ng-hide="!authenticated" ng-cloak>
|
||||
|
||||
<div style="display: none;" id="mainwrapper" class="clearfix">
|
||||
|
||||
<umb-app-header></umb-app-header>
|
||||
|
||||
<div class="umb-app-content">
|
||||
|
||||
<umb-navigation></umb-navigation>
|
||||
|
||||
<section id="contentwrapper">
|
||||
|
||||
<div id="contentcolumn">
|
||||
<div class="umb-editor" ng-view></div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
<umb-tour ng-if="tour.show"
|
||||
model="tour">
|
||||
</umb-tour>
|
||||
|
||||
<umb-notifications></umb-notifications>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- help dialog controller by the help button - this also forces the backoffice UI to shift 400px -->
|
||||
<umb-drawer data-element="drawer" ng-if="drawer.show" model="drawer.model" view="drawer.view"></umb-drawer>
|
||||
|
||||
<umb-search ng-if="search.show" on-close="closeSearch()"></umb-search>
|
||||
|
||||
</div>
|
||||
|
||||
<umb-backdrop ng-if="backdrop.show || infiniteMode"
|
||||
backdrop-opacity="backdrop.opacity"
|
||||
highlight-element="backdrop.element"
|
||||
highlight-prevent-click="backdrop.elementPreventClick"
|
||||
disable-events-on-click="backdrop.disableEventsOnClick">
|
||||
</umb-backdrop>
|
||||
|
||||
<umb-overlay ng-if="overlay.show"
|
||||
model="overlay"
|
||||
position="{{overlay.position}}"
|
||||
view="overlay.view"
|
||||
parent-scope="overlay.parentScope">
|
||||
</umb-overlay>
|
||||
|
||||
<umb-editors ng-show="infiniteMode"></umb-editors>
|
||||
|
||||
<umb-login ng-if="login.show"
|
||||
on-login="hideLoginScreen()">
|
||||
</umb-login>
|
||||
|
||||
@await Html.BareMinimumServerVariablesScriptAsync(backOfficeServerVariables)
|
||||
|
||||
<script>
|
||||
|
||||
document.angularReady = function(app) {
|
||||
@await Html.AngularValueExternalLoginInfoScriptAsync(signInManager, ViewData.GetExternalSignInError())
|
||||
@Html.AngularValueResetPasswordCodeInfoScript(ViewData["PasswordResetCode"])
|
||||
@await Html.AngularValueTinyMceAssetsAsync(runtimeMinifier)
|
||||
|
||||
//required for the noscript trick
|
||||
document.getElementById("mainwrapper").style.display = "inherit";
|
||||
}
|
||||
</script>
|
||||
|
||||
<script src="lib/lazyload-js/LazyLoad.min.js"></script>
|
||||
<script src="@Url.GetUrlWithCacheBust("Application", "BackOffice", null, hostingEnvironment, umbracoVersion, runtimeMinifier)"></script>
|
||||
|
||||
@if (isDebug)
|
||||
{
|
||||
@Html.Raw(profilerHtml.Render())
|
||||
}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,80 +0,0 @@
|
||||
@using Umbraco.Extensions
|
||||
@using Umbraco.Composing
|
||||
@{
|
||||
Layout = null;
|
||||
}
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<base href="@ViewData.GetUmbracoBaseFolder()/" />
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Install Umbraco</title>
|
||||
<link rel="stylesheet" href="assets/css/installer.css" />
|
||||
</head>
|
||||
|
||||
<body ng-class="{loading:installer.loading}" ng-controller="Umbraco.InstallerController" id="umbracoInstallPageBody">
|
||||
|
||||
<img src="assets/img/application/logo_white.png" id="logo" />
|
||||
|
||||
<umb-loader position="bottom"
|
||||
class="umb-installer-loader"
|
||||
ng-if="installer.loading"
|
||||
ng-style="{'width': installer.progress}">
|
||||
</umb-loader>
|
||||
|
||||
<div id="overlay" ng-cloak ng-animate="'fade'" ng-show="installer.done"></div>
|
||||
|
||||
<div id="installer" class="absolute-center clearfix"
|
||||
ng-cloak
|
||||
ng-animate="'fade'"
|
||||
ng-show="installer.configuring">
|
||||
|
||||
<div ng-if="installer.current" ng-switch on="installer.current.view">
|
||||
<div ng-switch-when="ysod">
|
||||
<h1>A server error occurred</h1>
|
||||
<p>This is most likely due to an error during application startup</p>
|
||||
<iframe id="ysod"></iframe>
|
||||
</div>
|
||||
<div ng-switch-default>
|
||||
<div ng-include="installer.current.view"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div ng-cloak ng-animate="'fade'" id="fact" class="absolute-center clearfix" ng-show="installer.fact">
|
||||
<h2>Did you know</h2>
|
||||
<p ng-bind-html="installer.fact"></p>
|
||||
</div>
|
||||
|
||||
<h3 ng-cloak ng-animate="'fade'" id="feedback" ng-show="installer.feedback">{{installer.feedback}}</h3>
|
||||
|
||||
<div id="missinglazyload" style="display: none;">
|
||||
<h3>There has been a problem with the build.</h3>
|
||||
<p>This might be because you could be offline or on a slow connection. Please try the following steps</p>
|
||||
<ol>
|
||||
<li>Make sure you have <a href="https://nodejs.org" target="_blank">Node.js</a> installed.</li>
|
||||
<li>Open command prompt and cd to \src\Umbraco.Web.UI.Client.</li>
|
||||
<li>Check to see if \src\Umbraco.Web.UI.Client\node_modules folder exists (this could be hidden); if so delete it.</li>
|
||||
<li>Run npm install; if successfull the node_modules folder should be created in the Umbraco.Web.UI.Client directory.</li>
|
||||
<li>Run build\Build.bat.</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var Umbraco = {};
|
||||
Umbraco.Sys = {};
|
||||
Umbraco.Sys.ServerVariables = {
|
||||
"installApiBaseUrl": "@ViewData.GetInstallApiBaseUrl()",
|
||||
"umbracoBaseUrl": "@ViewData.GetUmbracoBaseFolder()",
|
||||
"application": {
|
||||
version: "@ViewData.GetUmbracoVersion().Major"
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="lib/lazyload-js/LazyLoad.min.js"></script>
|
||||
<script src="js/install.loader.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -5,6 +5,11 @@
|
||||
<RootNamespace>Umbraco.Web.UI.NetCore</RootNamespace>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||
<DocumentationFile>bin\Release\Umbraco.Web.UI.NetCore.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Umbraco.PublishedCache.NuCache\Umbraco.PublishedCache.NuCache.csproj" />
|
||||
<ProjectReference Include="..\Umbraco.Web.BackOffice\Umbraco.Web.BackOffice.csproj" />
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
@using System.Web.Mvc.Html
|
||||
@using Umbraco.Web
|
||||
@using Umbraco.Web.Composing
|
||||
@using Umbraco.Web.Controllers
|
||||
@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage
|
||||
|
||||
@{
|
||||
var profileModel = Current.MembershipHelper.GetCurrentMemberProfileModel();
|
||||
|
||||
Html.EnableClientValidation();
|
||||
Html.EnableUnobtrusiveJavaScript();
|
||||
|
||||
var success = TempData["ProfileUpdateSuccess"] != null;
|
||||
}
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.0/jquery.validate.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validation-unobtrusive/3.2.11/jquery.validate.unobtrusive.min.js"></script>
|
||||
|
||||
@if (Current.MembershipHelper.IsLoggedIn() && profileModel != null)
|
||||
{
|
||||
if (success)
|
||||
{
|
||||
@* This message will show if profileModel.RedirectUrl is not defined (default) *@
|
||||
<p>Profile updated</p>
|
||||
}
|
||||
|
||||
using (Html.BeginUmbracoForm<UmbProfileController>("HandleUpdateProfile"))
|
||||
{
|
||||
<fieldset>
|
||||
<legend>Edit profile</legend>
|
||||
|
||||
@Html.ValidationSummary("profileModel", true)
|
||||
|
||||
@Html.LabelFor(m => profileModel.Name)
|
||||
@Html.TextBoxFor(m => profileModel.Name)
|
||||
@Html.ValidationMessageFor(m => profileModel.Name)
|
||||
<br />
|
||||
|
||||
@Html.LabelFor(m => profileModel.Email)
|
||||
@Html.TextBoxFor(m => profileModel.Email)
|
||||
@Html.ValidationMessageFor(m => profileModel.Email)
|
||||
<br />
|
||||
|
||||
@for (var i = 0; i < profileModel.MemberProperties.Count; i++)
|
||||
{
|
||||
@Html.LabelFor(m => profileModel.MemberProperties[i].Value, profileModel.MemberProperties[i].Name)
|
||||
@*
|
||||
By default this will render a textbox but if you want to change the editor template for this property you can
|
||||
easily change it. For example, if you wanted to render a custom editor for this field called "MyEditor" you would
|
||||
create a file at ~/Views/Shared/EditorTemplates/MyEditor.cshtml", then you will change the next line of code to
|
||||
render your specific editor template like:
|
||||
@Html.EditorFor(m => profileModel.MemberProperties[i].Value, "MyEditor")
|
||||
*@
|
||||
@Html.EditorFor(m => profileModel.MemberProperties[i].Value)
|
||||
@Html.HiddenFor(m => profileModel.MemberProperties[i].Alias)
|
||||
<br />
|
||||
}
|
||||
|
||||
<button>Save</button>
|
||||
</fieldset>
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
@using Umbraco.Core.Models.PublishedContent
|
||||
@using Umbraco.Web
|
||||
@using Umbraco.Core
|
||||
@using Umbraco.Core.Media
|
||||
@using Umbraco.Web.Composing
|
||||
@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage
|
||||
|
||||
@*
|
||||
Macro to display a gallery of images from the Media section.
|
||||
Works with either a 'Single Media Picker' or a 'Multiple Media Picker' macro parameter (see below).
|
||||
|
||||
How it works:
|
||||
- Confirm the macro parameter has been passed in with a value
|
||||
- Loop through all the media Ids passed in (might be a single item, might be many)
|
||||
- Display any individual images, as well as any folders of images
|
||||
|
||||
Macro Parameters To Create, for this macro to work:
|
||||
Alias:mediaIds Name:Select folders and/or images Type: Multiple Media Picker
|
||||
Type: (note: You can use a Single Media Picker if that's more appropriate to your needs)
|
||||
*@
|
||||
|
||||
@{ var mediaIds = Model.MacroParameters["mediaIds"] as string; }
|
||||
|
||||
@if (mediaIds != null)
|
||||
{
|
||||
<div class="row">
|
||||
@foreach (var mediaId in mediaIds.Split(','))
|
||||
{
|
||||
var media = Current.PublishedContentQuery.Media(mediaId);
|
||||
|
||||
@* a single image *@
|
||||
if (media.IsDocumentType("Image"))
|
||||
{
|
||||
@Render(media)
|
||||
}
|
||||
|
||||
@* a folder with images under it *@
|
||||
foreach (var image in media.Children(Current.VariationContextAccessor))
|
||||
{
|
||||
@Render(image)
|
||||
}
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
@helper Render(IPublishedContent item)
|
||||
{
|
||||
<div class="col-xs-6 col-md-3">
|
||||
<a href="@item.Url()" class="thumbnail">
|
||||
<img src="@(item.GetCropUrl(Current.Factory.GetInstance<IImageUrlGenerator>(), width:200, height:200))" alt="@item.Name" />
|
||||
</a>
|
||||
</div>
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
@using Umbraco.Core
|
||||
@using Umbraco.Web
|
||||
@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage
|
||||
|
||||
@*
|
||||
This snippet makes a list of links to the of parents of the current page using an unordered HTML list.
|
||||
|
||||
How it works:
|
||||
- It uses the Ancestors() method to get all parents and then generates links so the visitor can go back
|
||||
- Finally it outputs the name of the current page (without a link)
|
||||
*@
|
||||
|
||||
@{ var selection = Model.Content.Ancestors().ToArray(); }
|
||||
|
||||
@if (selection.Length > 0)
|
||||
{
|
||||
<ul>
|
||||
@* For each page in the ancestors collection which have been ordered by Level (so we start with the highest top node first) *@
|
||||
@foreach (var item in selection.OrderBy(x => x.Level))
|
||||
{
|
||||
<li><a href="@item.Url()">@item.Name</a> »</li>
|
||||
}
|
||||
|
||||
@* Display the current page as the last item in the list *@
|
||||
<li>@Model.Content.Name</li>
|
||||
</ul>
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
@using Umbraco.Web
|
||||
@using Umbraco.Web.Composing
|
||||
@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage
|
||||
|
||||
@*
|
||||
Macro to list all child pages under a specific page in the content tree.
|
||||
|
||||
How it works:
|
||||
- Confirm the startNodeId macro parameter has been passed in with a value
|
||||
- Loop through all child pages
|
||||
- Display a list of link to those pages, sorted by the value of the propertyAlias
|
||||
|
||||
Macro Parameters To Create, for this macro to work:
|
||||
Alias:startNodeId Name:Select starting page Type:Content Picker
|
||||
*@
|
||||
|
||||
@{ var startNodeId = Model.MacroParameters["startNodeId"]; }
|
||||
|
||||
@if (startNodeId != null)
|
||||
{
|
||||
@* Get the starting page *@
|
||||
var startNode = Current.PublishedContentQuery.Content(startNodeId);
|
||||
var selection = startNode.Children.Where(x => x.IsVisible()).ToArray();
|
||||
|
||||
if (selection.Length > 0)
|
||||
{
|
||||
<ul>
|
||||
@foreach (var item in selection)
|
||||
{
|
||||
<li><a href="@item.Url">@item.Name</a></li>
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
@using Umbraco.Web
|
||||
@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage
|
||||
|
||||
@*
|
||||
This snippet makes a list of links to the of children of the current page using an unordered HTML list.
|
||||
|
||||
How it works:
|
||||
- It uses the Children method to get all child pages
|
||||
- It then generates links so the visitor can go to each page
|
||||
*@
|
||||
|
||||
@{ var selection = Model.Content.Children.Where(x => x.IsVisible()).ToArray(); }
|
||||
|
||||
@if (selection.Length > 0)
|
||||
{
|
||||
<ul>
|
||||
@foreach (var item in selection)
|
||||
{
|
||||
<li>
|
||||
<a href="@item.Url">@item.Name</a>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
@using Umbraco.Web
|
||||
@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage
|
||||
|
||||
@*
|
||||
This snippet makes a list of links to the of children of the current page using an unordered HTML list.
|
||||
|
||||
How it works:
|
||||
- It uses the Children method to get all child pages
|
||||
- It then uses the OrderByDescending() method, which takes the property to sort. In this case the page's creation date.
|
||||
- It then generates links so the visitor can go to each page
|
||||
*@
|
||||
|
||||
@{ var selection = Model.Content.Children.Where(x => x.IsVisible()).OrderByDescending(x => x.CreateDate).ToArray(); }
|
||||
|
||||
@if (selection.Length > 0)
|
||||
{
|
||||
<ul>
|
||||
@foreach (var item in selection)
|
||||
{
|
||||
<li><a href="@item.Url">@item.Name</a></li>
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
@using Umbraco.Web
|
||||
@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage
|
||||
|
||||
@*
|
||||
This snippet makes a list of links to the of children of the current page using an unordered HTML list.
|
||||
|
||||
How it works:
|
||||
- It uses the Children method to get all child pages
|
||||
- It then uses the OrderBy() method, which takes the property to sort. In this case, the page's name.
|
||||
- It then generates links so the visitor can go to each page
|
||||
*@
|
||||
|
||||
@{ var selection = Model.Content.Children.Where(x => x.IsVisible()).OrderBy(x => x.Name).ToArray(); }
|
||||
|
||||
@if (selection.Length > 0)
|
||||
{
|
||||
<ul>
|
||||
@foreach (var item in selection)
|
||||
{
|
||||
<li><a href="@item.Url">@item.Name</a></li>
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
@using Umbraco.Web
|
||||
@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage
|
||||
|
||||
@*
|
||||
Macro to list all child pages with a specific property, sorted by the value of that property.
|
||||
|
||||
How it works:
|
||||
- Confirm the propertyAlias macro parameter has been passed in with a value
|
||||
- Loop through all child pages that have the propertyAlias
|
||||
- Display a list of link to those pages, sorted by the value of the propertyAlias
|
||||
|
||||
Macro Parameters To Create, for this macro to work:
|
||||
Alias:propertyAlias Name:Property Alias Type:Textbox
|
||||
*@
|
||||
|
||||
@{ var propertyAlias = Model.MacroParameters["propertyAlias"]; }
|
||||
|
||||
@if (propertyAlias != null)
|
||||
{
|
||||
var selection = Model.Content.Children.Where(x => x.IsVisible()).OrderBy(x => x.Value(propertyAlias.ToString())).ToArray();
|
||||
|
||||
if (selection.Length > 0)
|
||||
{
|
||||
<ul>
|
||||
@foreach (var item in selection)
|
||||
{
|
||||
<li><a href="@item.Url">@item.Name</a></li>
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
@using Umbraco.Core.Models.PublishedContent
|
||||
@using Umbraco.Web
|
||||
@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage
|
||||
|
||||
@*
|
||||
This snippet shows how simple it is to fetch only children of a certain Document Type.
|
||||
|
||||
Be sure to change "IPublishedContent" below to match your needs, such as "TextPage" or "NewsItem".
|
||||
(You can find the alias of your Document Type by editing it in the Settings section)
|
||||
*@
|
||||
|
||||
@{ var selection = Model.Content.Children<IPublishedContent>().Where(x => x.IsVisible()).ToArray(); }
|
||||
|
||||
@if (selection.Length > 0)
|
||||
{
|
||||
<ul>
|
||||
@foreach (var item in selection)
|
||||
{
|
||||
<li><a href="@item.Url">@item.Name</a></li>
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
@using Umbraco.Core.Models.PublishedContent
|
||||
@using Umbraco.Web
|
||||
@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage
|
||||
|
||||
@*
|
||||
This snippet creates links for every single page (no matter how deep) below
|
||||
the page currently being viewed by the website visitor, displayed as nested unordered HTML lists.
|
||||
*@
|
||||
|
||||
@{ var selection = Model.Content.Children.Where(x => x.IsVisible()).ToArray(); }
|
||||
|
||||
@* Ensure that the Current Page has children *@
|
||||
@if (selection.Length > 0)
|
||||
{
|
||||
@* Get the first page in the children, where the property umbracoNaviHide is not True *@
|
||||
var naviLevel = selection[0].Level;
|
||||
|
||||
@* Add in level for a CSS hook *@
|
||||
<ul class="level-@(naviLevel)">
|
||||
@* Loop through the selection *@
|
||||
@foreach (var item in selection)
|
||||
{
|
||||
<li>
|
||||
<a href="@item.Url">@item.Name</a>
|
||||
|
||||
@* if this child page has any children, where the property umbracoNaviHide is not True *@
|
||||
@{
|
||||
var children = item.Children.Where(x => x.IsVisible()).ToArray();
|
||||
if (children.Length > 0)
|
||||
{
|
||||
@* Call our helper to display the children *@
|
||||
@ChildPages(children)
|
||||
}
|
||||
}
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
|
||||
@helper ChildPages(IPublishedContent[] selection)
|
||||
{
|
||||
@* Ensure that we have a collection of pages *@
|
||||
if (selection.Length > 0)
|
||||
{
|
||||
@* Get the first page in pages and get the level *@
|
||||
var naviLevel = selection[0].Level;
|
||||
|
||||
@* Add in level for a CSS hook *@
|
||||
<ul class="level-@(naviLevel)">
|
||||
@foreach (var item in selection)
|
||||
{
|
||||
<li>
|
||||
<a href="@item.Url">@item.Name</a>
|
||||
|
||||
@* if the page has any children, where the property umbracoNaviHide is not True *@
|
||||
@{
|
||||
var children = item.Children.Where(x => x.IsVisible()).ToArray();
|
||||
if (children.Length > 0)
|
||||
{
|
||||
@* Recurse and call our helper to display the children *@
|
||||
@ChildPages(children)
|
||||
}
|
||||
}
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
@using Umbraco.Web
|
||||
@using Umbraco.Web.Composing
|
||||
@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage
|
||||
|
||||
@*
|
||||
Macro to display a series of images from a media folder.
|
||||
|
||||
How it works:
|
||||
- Confirm the macro parameter has been passed in with a value
|
||||
- Loop through all the media Ids passed in (might be a single item, might be many)
|
||||
- Display any individual images, as well as any folders of images
|
||||
|
||||
Macro Parameters To Create, for this macro to work:
|
||||
Alias:mediaId Name:Select folder with images Type:Single Media Picker
|
||||
*@
|
||||
|
||||
@{ var mediaId = Model.MacroParameters["mediaId"]; }
|
||||
|
||||
@if (mediaId != null)
|
||||
{
|
||||
@* Get the media item associated with the id passed in *@
|
||||
var media = Current.PublishedContentQuery.Media(mediaId);
|
||||
var selection = media.Children.ToArray();
|
||||
|
||||
if (selection.Length > 0)
|
||||
{
|
||||
<ul>
|
||||
@foreach (var item in selection)
|
||||
{
|
||||
<li>
|
||||
<img src="@item.Url()" alt="@item.Name" />
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
@using System.Web.Mvc.Html
|
||||
@using Umbraco.Web
|
||||
@using Umbraco.Web.Composing
|
||||
@using Umbraco.Web.Models
|
||||
@using Umbraco.Web.Controllers
|
||||
@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage
|
||||
|
||||
@{
|
||||
var loginModel = new LoginModel();
|
||||
loginModel.RedirectUrl = HttpContext.Current.Request.Url.AbsolutePath;
|
||||
|
||||
Html.EnableClientValidation();
|
||||
Html.EnableUnobtrusiveJavaScript();
|
||||
|
||||
}
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.0/jquery.validate.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validation-unobtrusive/3.2.11/jquery.validate.unobtrusive.min.js"></script>
|
||||
|
||||
@using (Html.BeginUmbracoForm<UmbLoginController>("HandleLogin"))
|
||||
{
|
||||
@Html.HiddenFor(m => loginModel.RedirectUrl)
|
||||
<fieldset>
|
||||
<legend>Login</legend>
|
||||
|
||||
@Html.ValidationSummary("loginModel", true)
|
||||
|
||||
@Html.LabelFor(m => loginModel.Username)
|
||||
@Html.TextBoxFor(m => loginModel.Username)
|
||||
@Html.ValidationMessageFor(m => loginModel.Username)
|
||||
<br />
|
||||
|
||||
@Html.LabelFor(m => loginModel.Password)
|
||||
@Html.PasswordFor(m => loginModel.Password)
|
||||
@Html.ValidationMessageFor(m => loginModel.Password)
|
||||
<br />
|
||||
|
||||
<button>Login</button>
|
||||
</fieldset>
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
@using System.Web.Mvc.Html
|
||||
@using Umbraco.Web
|
||||
@using Umbraco.Web.Composing
|
||||
@using Umbraco.Web.Models
|
||||
@using Umbraco.Web.Controllers
|
||||
@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage
|
||||
|
||||
@{
|
||||
var loginStatusModel = Current.MembershipHelper.GetCurrentLoginStatus();
|
||||
var logoutModel = new PostRedirectModel();
|
||||
|
||||
@*
|
||||
Here you can specify a redirect URL for after logging out, by default umbraco will simply
|
||||
redirect to the current page. Example to redirect to the home page:
|
||||
|
||||
logoutModel.RedirectUrl = "/";
|
||||
*@
|
||||
}
|
||||
|
||||
@if (loginStatusModel.IsLoggedIn)
|
||||
{
|
||||
<p>You are currently logged in as @loginStatusModel.Name</p>
|
||||
|
||||
using (Html.BeginUmbracoForm<UmbLoginStatusController>("HandleLogout"))
|
||||
{
|
||||
<fieldset>
|
||||
<legend>Logout</legend>
|
||||
<button>Logout</button>
|
||||
</fieldset>
|
||||
|
||||
@Html.HiddenFor(m => logoutModel.RedirectUrl)
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
@using Umbraco.Core.Models.PublishedContent
|
||||
@using Umbraco.Web
|
||||
@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage
|
||||
|
||||
@*
|
||||
This snippet lists the items from a Multinode tree picker, using the picker's 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>>("PropertyWithPicker").ToArray(); }
|
||||
|
||||
@if (selection.Length > 0)
|
||||
{
|
||||
<ul>
|
||||
@foreach (var item in selection)
|
||||
{
|
||||
<li>
|
||||
<a href="@item.Url">@item.Name</a>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
@using Umbraco.Core
|
||||
@using Umbraco.Web
|
||||
@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage
|
||||
|
||||
@*
|
||||
This snippet displays a list of links of the pages immediately under the top-most page in the content tree.
|
||||
This is the home page for a standard website.
|
||||
It also highlights the current active page/section in the navigation with the CSS class "current".
|
||||
*@
|
||||
|
||||
@{ var selection = Model.Content.Root().Children.Where(x => x.IsVisible()).ToArray(); }
|
||||
|
||||
@if (selection.Length > 0)
|
||||
{
|
||||
<ul>
|
||||
@foreach (var item in selection)
|
||||
{
|
||||
<li class="@(item.IsAncestorOrSelf(Model.Content) ? "current" : null)">
|
||||
<a href="@item.Url()">@item.Name</a>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
@@ -1,101 +0,0 @@
|
||||
@using System.Web.Mvc.Html
|
||||
@using Umbraco.Web
|
||||
@using Umbraco.Web.Composing
|
||||
@using Umbraco.Web.Controllers
|
||||
@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage
|
||||
|
||||
@{
|
||||
@*
|
||||
You can specify a custom member type alias in the constructor, the default is 'Member'
|
||||
for example, to use 'Custom Member' you'd use this syntax:
|
||||
|
||||
var registerModel = Members.CreateRegistrationModel("Custom Member");
|
||||
*@
|
||||
|
||||
var registerModel = Current.MembershipHelper.CreateRegistrationModel();
|
||||
|
||||
@*
|
||||
Configurable here:
|
||||
|
||||
registerModel.RedirectUrl - Optional. What path to redirect to if registration is successful.
|
||||
By default the member will be redirected to the current umbraco page
|
||||
unless this is specified.
|
||||
|
||||
registerModel.UsernameIsEmail - the default is true
|
||||
if you want the username to be different from the email
|
||||
address, set this to true and add a new Username field in
|
||||
the form below
|
||||
|
||||
@Html.LabelFor(m => registerModel.Username)
|
||||
@Html.TextBoxFor(m => registerModel.Username)
|
||||
@Html.ValidationMessageFor(m => registerModel.Username)
|
||||
*@
|
||||
|
||||
Html.EnableClientValidation();
|
||||
Html.EnableUnobtrusiveJavaScript();
|
||||
|
||||
var success = TempData["FormSuccess"] != null;
|
||||
}
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.0/jquery.validate.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validation-unobtrusive/3.2.11/jquery.validate.unobtrusive.min.js"></script>
|
||||
|
||||
@if (success)
|
||||
{
|
||||
@* This message will show if registerModel.RedirectUrl is not defined (default) *@
|
||||
<p>Registration succeeded.</p>
|
||||
}
|
||||
else
|
||||
{
|
||||
using (Html.BeginUmbracoForm<UmbRegisterController>("HandleRegisterMember"))
|
||||
{
|
||||
<fieldset>
|
||||
<legend>Register Member</legend>
|
||||
|
||||
@Html.ValidationSummary("registerModel", true)
|
||||
|
||||
@Html.LabelFor(m => registerModel.Name)
|
||||
@Html.TextBoxFor(m => registerModel.Name)
|
||||
@Html.ValidationMessageFor(m => registerModel.Name)
|
||||
<br />
|
||||
|
||||
@Html.LabelFor(m => registerModel.Email)
|
||||
@Html.TextBoxFor(m => registerModel.Email)
|
||||
@Html.ValidationMessageFor(m => registerModel.Email)
|
||||
<br />
|
||||
|
||||
@Html.LabelFor(m => registerModel.Password)
|
||||
@Html.PasswordFor(m => registerModel.Password)
|
||||
@Html.ValidationMessageFor(m => registerModel.Password)
|
||||
<br />
|
||||
|
||||
@if (registerModel.MemberProperties != null)
|
||||
{
|
||||
@*
|
||||
It will only displays properties marked as "Member can edit" on the "Info" tab of the Member Type.
|
||||
*@
|
||||
for (var i = 0; i < registerModel.MemberProperties.Count; i++)
|
||||
{
|
||||
@Html.LabelFor(m => registerModel.MemberProperties[i].Value, registerModel.MemberProperties[i].Name)
|
||||
@*
|
||||
By default this will render a textbox but if you want to change the editor template for this property you can
|
||||
easily change it. For example, if you wanted to render a custom editor for this field called "MyEditor" you would
|
||||
create a file at ~/Views/Shared/EditorTemplates/MyEditor.cshtml", then you will change the next line of code to
|
||||
render your specific editor template like:
|
||||
@Html.EditorFor(m => registerModel.MemberProperties[i].Value, "MyEditor")
|
||||
*@
|
||||
@Html.EditorFor(m => registerModel.MemberProperties[i].Value)
|
||||
@Html.HiddenFor(m => registerModel.MemberProperties[i].Alias)
|
||||
<br />
|
||||
}
|
||||
}
|
||||
|
||||
@Html.HiddenFor(m => registerModel.MemberTypeAlias)
|
||||
@Html.HiddenFor(m => registerModel.RedirectUrl)
|
||||
@Html.HiddenFor(m => registerModel.UsernameIsEmail)
|
||||
|
||||
<button>Register</button>
|
||||
</fieldset>
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
@using Umbraco.Core
|
||||
@using Umbraco.Core.Models.PublishedContent
|
||||
@using Umbraco.Web
|
||||
@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage
|
||||
|
||||
@*
|
||||
This snippet makes a list of links of all visible pages of the site, as nested unordered HTML lists.
|
||||
|
||||
How it works:
|
||||
- It uses a custom Razor helper called Traverse() to select and display the markup and links.
|
||||
*@
|
||||
|
||||
@{ var selection = Model.Content.Root(); }
|
||||
|
||||
<div class="sitemap">
|
||||
@* Render the sitemap by passing the root node to the traverse helper, below *@
|
||||
@Traverse(selection)
|
||||
</div>
|
||||
|
||||
@* Helper method to traverse through all descendants *@
|
||||
@helper Traverse(IPublishedContent node)
|
||||
{
|
||||
@* Update the level to reflect how deep you want the sitemap to go *@
|
||||
const int maxLevelForSitemap = 4;
|
||||
|
||||
@* Select visible children *@
|
||||
var selection = node.Children.Where(x => x.IsVisible() && x.Level <= maxLevelForSitemap).ToArray();
|
||||
|
||||
@* If any items are returned, render a list *@
|
||||
if (selection.Length > 0)
|
||||
{
|
||||
<ul>
|
||||
@foreach (var item in selection)
|
||||
{
|
||||
<li class="level-@item.Level">
|
||||
<a href="@item.Url()">@item.Name</a>
|
||||
|
||||
@* Run the traverse helper again for any child pages *@
|
||||
@Traverse(item)
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user