diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index e43bd53fe4..0828cbb975 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -2098,7 +2098,6 @@ Code - @@ -2106,9 +2105,40 @@ - + Code + + + + + + Code + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Breadcrumb.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Breadcrumb.cshtml new file mode 100644 index 0000000000..29dab7ad82 --- /dev/null +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Breadcrumb.cshtml @@ -0,0 +1,22 @@ +@inherits Umbraco.Web.Macros.PartialViewMacroPage +@* + This snippet makes a breadcrumb of parents using an unordred html list. + + How it works: + - It uses the Ancestors() method to get all parents and then generates links so the visitor get go back + - Finally it outputs the name of the current page (without a link) +*@ + +@if (CurrentPage.Ancestors().Any()) +{ + +} \ No newline at end of file diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/EmptyTemplate (ForUseWithCustomViews).cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/EmptyTemplate (ForUseWithCustomViews).cshtml new file mode 100644 index 0000000000..8d10a3a9c7 --- /dev/null +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/EmptyTemplate (ForUseWithCustomViews).cshtml @@ -0,0 +1 @@ +@inherits Umbraco.Web.Mvc.UmbracoViewPage \ No newline at end of file diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Gallery.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Gallery.cshtml new file mode 100644 index 0000000000..e0d53980ac --- /dev/null +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Gallery.cshtml @@ -0,0 +1,31 @@ +@inherits Umbraco.Web.Macros.PartialViewMacroPage + +@* +Macro to display a gallery from a media folder. Add the below parameter to the macro +and use it to point the macro at a specific media folder to display it's content as +a simple list. + +Macro Parameters To Create, for this macro to work: +Show:True Alias:mediaId Name:Media Folder ID Type:MediaCurrent +*@ + +@if (Model.MacroParameters["mediaId"] != null) +{ + @* Get the media folder as a dynamic node *@ + var mediaFolder = Umbraco.Media(Model.MacroParameters["mediaId"]); + + if (mediaFolder.Children.Any()) + { +
    + @* for each item in children of the selected media folder *@ + @foreach (var mediaItem in mediaFolder.Children) + { +
  • + + @mediaItem.Name + +
  • + } +
+ } +} \ No newline at end of file diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListAncestorsFromCurrentPage.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListAncestorsFromCurrentPage.cshtml new file mode 100644 index 0000000000..e5b63c939d --- /dev/null +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListAncestorsFromCurrentPage.cshtml @@ -0,0 +1,16 @@ +@inherits Umbraco.Web.Macros.PartialViewMacroPage + +@* Check the current page has ancestors *@ +@if (CurrentPage.Ancestors().Any()) +{ +
    + @* For each page in the ancestors collection which have been ordered by Level (so we start with the highest top node first) *@ + @foreach (var page in CurrentPage.Ancestors().OrderBy("Level")) + { +
  • @page.Name »
  • + } + + @* Display the current page as the last item in the list *@ +
  • @CurrentPage.Name
  • +
+} \ No newline at end of file diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesFromChangeableSource.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesFromChangeableSource.cshtml new file mode 100644 index 0000000000..f06cbb7987 --- /dev/null +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesFromChangeableSource.cshtml @@ -0,0 +1,21 @@ +@inherits Umbraco.Web.Macros.PartialViewMacroPage +@* + === Macro Parameters To Create === + Show:True Alias:nodeId Name:Node ID Type:Content Picker +*@ + +@if (Model.MacroParameters["startNodeID"] != null) +{ + @* Get the start node as a dynamic node *@ + var startNode = Umbraco.Content(Model.MacroParameters["startNodeID"]); + + if (startNode.Children.Where("Visible").Any()) + { +
    + @foreach (var page in startNode.Children.Where("Visible")) + { +
  • @page.Name
  • + } +
+ } +} \ No newline at end of file diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesFromCurrentPage.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesFromCurrentPage.cshtml new file mode 100644 index 0000000000..7918e56386 --- /dev/null +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesFromCurrentPage.cshtml @@ -0,0 +1,15 @@ +@inherits Umbraco.Web.Macros.PartialViewMacroPage + +@* Ensure that the Current Page has children, where the property umbracoNaviHide is not True *@ +@if (CurrentPage.Children.Where("Visible").Any()) +{ +
    + @* For each child page under the root node, where the property umbracoNaviHide is not True *@ + @foreach (var childPage in CurrentPage.Children.Where("Visible")) + { +
  • + @childPage.Name +
  • + } +
+} diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByDate.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByDate.cshtml new file mode 100644 index 0000000000..136578c16c --- /dev/null +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByDate.cshtml @@ -0,0 +1,10 @@ +@inherits Umbraco.Web.Macros.PartialViewMacroPage + +
    + @*OrderBy() takes the property to sort by and optionally order desc/asc *@ + + @foreach (var page in CurrentPage.Children.Where("Visible").OrderBy("CreateDate desc")) + { +
  • @page.Name
  • + } +
diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByName.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByName.cshtml new file mode 100644 index 0000000000..0a1ded1cd3 --- /dev/null +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByName.cshtml @@ -0,0 +1,8 @@ +@inherits Umbraco.Web.Mvc.UmbracoTemplatePage +
    + @*OrderBy() takes the property to sort by*@ + @foreach (var page in CurrentPage.Children.Where("Visible").OrderBy("Name")) + { +
  • @page.Name
  • + } +
diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByProperty.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByProperty.cshtml new file mode 100644 index 0000000000..dc37b363c4 --- /dev/null +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByProperty.cshtml @@ -0,0 +1,21 @@ +@inherits Umbraco.Web.Macros.PartialViewMacroPage +@* + Macro parameter to be set on the macro + Show:True Alias:propertyAlias Name:Property Alias Type:Textstring +*@ + + +@{ + + @* Get the property alias we want to filter on from the macro parameter *@ + var propertyAlias = Model.MacroParameters["propertyAlias"]; + var selection = CurrentPage.Children.Where("Visible").OrderBy(propertyAlias); +} + + +
    + @foreach (var page in selection) + { +
  • @page.Name
  • + } +
diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesWithDoctype.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesWithDoctype.cshtml new file mode 100644 index 0000000000..12077f82b6 --- /dev/null +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesWithDoctype.cshtml @@ -0,0 +1,32 @@ +@inherits Umbraco.Web.Macros.PartialViewMacroPage + +@* + This snippet shows how simple it is to fetch only children of a certain Document Type using Razor. Instead of + calling .Children, simply call .AliasOfDocumentType in plural. + For instance .Textpages or .NewsArticles (you can find the alias of your Document Type by editing it in the + Settings section). +*@ + + +@{ + @*Build a query and return the visible items *@ + var selection= CurrentPage.Textpages.Where("Visible"); + + @* + Example of more querying, if you have a true/false property with the alias of shouldBeFeatured: + var selection= Model.Textpages.Where("shouldBeFeatured == true").Where("Visible"); + *@ +} + + +@*Determine if there are any nodes in the selection, then render list *@ +@if(selection.Any()){ + +
    + @foreach(var page in selection){ +
  • @page.Name
  • + } +
+ +} + diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListDescendantsFromCurrentPage.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListDescendantsFromCurrentPage.cshtml new file mode 100644 index 0000000000..0cf32ad868 --- /dev/null +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListDescendantsFromCurrentPage.cshtml @@ -0,0 +1,54 @@ +@inherits Umbraco.Web.Mvc.UmbracoTemplatePage + +@* Ensure that the Current Page has children, where the property umbracoNaviHide is not True *@ +@if (CurrentPage.Children.Where("Visible").Any()) +{ + @* Get the first page in the children, where the property umbracoNaviHide is not True *@ + var naviLevel = CurrentPage.Children.Where("Visible").First().Level; + + @* Add in level for a CSS hook *@ +
    + @* For each child page under the root node, where the property umbracoNaviHide is not True *@ + @foreach (var childPage in CurrentPage.Children.Where("Visible")) + { +
  • + @childPage.Name + + @* if the current page has any children, where the property umbracoNaviHide is not True *@ + @if (childPage.Children.Where("Visible").Any()) + { + @* Call our helper to display the children *@ + @childPages(childPage.Children) + } +
  • + } +
+} + + +@helper childPages(dynamic pages) + { + @* Ensure that we have a collection of pages *@ + if (pages.Any()) + { + @* Get the first page in pages and get the level *@ + var naviLevel = pages.First().Level; + + @* Add in level for a CSS hook *@ +
    + @foreach (var page in pages.Where("Visible")) + { +
  • + @page.Name + + @* if the current page has any children, where the property umbracoNaviHide is not True *@ + @if (page.Children.Where("Visible").Any()) + { + @* Call our helper to display the children *@ + @childPages(page.Children) + } +
  • + } +
+ } +} \ No newline at end of file diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListImagesFromMediaFolder.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListImagesFromMediaFolder.cshtml new file mode 100644 index 0000000000..dc63da00f8 --- /dev/null +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListImagesFromMediaFolder.cshtml @@ -0,0 +1,23 @@ +@inherits Umbraco.Web.Macros.PartialViewMacroPage + +@* +Macro Parameters To Create, for this macro to work: +Show:True Alias:mediaId Name:Media Folder ID Type:MediaCurrent +*@ + +@if (Model.MacroParameters["mediaId"] != null) +{ + @* Get the media folder as a dynamic node *@ + var mediaFolder = Umbraco.Media(Model.MacroParameters["mediaId"]); + + if (mediaFolder.Children.Any()) + { +
    + @* for each item in children of the selected media folder *@ + @foreach (var mediaItem in mediaFolder.Children) + { +
  • @mediaItem.Name
  • + } +
+ } +} \ No newline at end of file diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/MultinodeTree-picker.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/MultinodeTree-picker.cshtml new file mode 100644 index 0000000000..46dfe4a7b5 --- /dev/null +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/MultinodeTree-picker.cshtml @@ -0,0 +1,20 @@ +@inherits Umbraco.Web.Macros.PartialViewMacroPage + +@* + Macro to list nodes 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, simply set the selection equal to the property which has the + multinode treepicker (so: replace "PropertyWithPicker" with the alias of your property). +*@ + +@* Lists each selected value from the picker as a link *@ +
    + @foreach(var id in CurrentPage.PropertyWithPicker){ + + @*For each link, get the node, and display its name and url*@ + var content = Umbraco.Content(id.InnerText); + +
  • @content.Name
  • + } +
\ No newline at end of file diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Navigation.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Navigation.cshtml new file mode 100644 index 0000000000..9b066b9706 --- /dev/null +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Navigation.cshtml @@ -0,0 +1,22 @@ +@inherits Umbraco.Web.Macros.PartialViewMacroPage + +@* + Macro to display child pages below the root page of a standard website. + Also highlights the current active page/section in the navigation with + the css class "current". +*@ + + +@{ + @*Get the root of the website *@ + var root = CurrentPage.AncestorOrSelf(1); +} + +
    + @foreach (var page in root.Children.Where("Visible")) + { +
  • + @page.Name +
  • + } +
diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/SiteMap.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/SiteMap.cshtml new file mode 100644 index 0000000000..94aab238f8 --- /dev/null +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/SiteMap.cshtml @@ -0,0 +1,32 @@ +@inherits Umbraco.Web.Macros.PartialViewMacroPage + +@*Render the sitemap by passing the root node to the traverse helper*@ +
+ @Traverse(CurrentPage.AncestorOrSelf()) +
+ +@*Helper method to travers through all descendants*@ +@helper Traverse(dynamic node) +{ + @* Update the level to reflect how deep you want the sitemap to go *@ + var maxLevelForSitemap = 4; + + @*Select visible children *@ + var items = node.Children.Where("Visible").Where("Level <= " + maxLevelForSitemap); + + @*If any items are returned, render a list *@ + if (items.Any()) + { +
    + @foreach (var item in items) + { +
  • + @item.Name + + @*Run the traverse helper again *@ + @Traverse(item) +
  • + } +
+ } +} \ No newline at end of file diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/Breadcrumb.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/Breadcrumb.cshtml new file mode 100644 index 0000000000..3f3dcfd3b6 --- /dev/null +++ b/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/Breadcrumb.cshtml @@ -0,0 +1,22 @@ +@inherits Umbraco.Web.Mvc.UmbracoTemplatePage +@* + This snippet makes a breadcrumb of parents using an unordred html list. + + How it works: + - It uses the Ancestors() method to get all parents and then generates links so the visitor get go back + - Finally it outputs the name of the current page (without a link) +*@ + +@if (CurrentPage.Ancestors().Any()) +{ + +} \ No newline at end of file diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/EditProfile.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/EditProfile.cshtml new file mode 100644 index 0000000000..80fdff9e68 --- /dev/null +++ b/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/EditProfile.cshtml @@ -0,0 +1,54 @@ +@inherits Umbraco.Web.Mvc.UmbracoTemplatePage + +@using System.Web.Mvc.Html +@using ClientDependency.Core.Mvc +@using umbraco.cms.businesslogic.member +@using Umbraco.Web +@using Umbraco.Web.Models +@using Umbraco.Web.Controllers + +@{ + var profileModel = new ProfileModel(); + + Html.EnableClientValidation(); + Html.EnableUnobtrusiveJavaScript(); + Html.RequiresJs("/umbraco_client/ui/jquery.js"); + Html.RequiresJs("/umbraco_client/Application/JQuery/jquery.validate.min.js"); + Html.RequiresJs("/umbraco_client/Application/JQuery/jquery.validate.unobtrusive.min.js"); +} + +@if (Member.IsLoggedOn()) +{ + @Html.RenderJsHere() + + using (Html.BeginUmbracoForm("HandleUpdateProfile")) + { +
+ Edit profile + + @Html.ValidationSummary(true) + + @Html.LabelFor(m => profileModel.Name) + @Html.TextBoxFor(m => profileModel.Name) + @Html.ValidationMessageFor(m => profileModel.Name) +
+ + @Html.LabelFor(m => profileModel.Email) + @Html.TextBoxFor(m => profileModel.Email) + @Html.ValidationMessageFor(m => profileModel.Email) +
+ + @for (var i = 0; i < profileModel.MemberProperties.Count; i++) + { + @Html.LabelFor(m => profileModel.MemberProperties[i].Value, profileModel.MemberProperties[i].Name) + @Html.EditorFor(m => profileModel.MemberProperties[i].Value) + @Html.HiddenFor(m => profileModel.MemberProperties[i].Alias) +
+ } + + @Html.HiddenFor(m => profileModel.MemberTypeAlias) + + +
+ } +} \ No newline at end of file diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/EmptyTemplate.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/EmptyTemplate.cshtml index 2363dcc14c..e69de29bb2 100644 --- a/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/EmptyTemplate.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/EmptyTemplate.cshtml @@ -1 +0,0 @@ -@inherits Umbraco.Web.Mvc.UmbracoTemplatePage \ No newline at end of file diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/ListAncestorsFromCurrentPage.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/ListAncestorsFromCurrentPage.cshtml new file mode 100644 index 0000000000..7ce864c204 --- /dev/null +++ b/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/ListAncestorsFromCurrentPage.cshtml @@ -0,0 +1,16 @@ +@inherits Umbraco.Web.Mvc.UmbracoTemplatePage + +@* Check the current page has ancestors *@ +@if (CurrentPage.Ancestors().Any()) +{ +
    + @* For each page in the ancestors collection which have been ordered by Level (so we start with the highest top node first) *@ + @foreach (var page in CurrentPage.Ancestors().OrderBy("Level")) + { +
  • @page.Name »
  • + } + + @* Display the current page as the last item in the list *@ +
  • @CurrentPage.Name
  • +
+} \ No newline at end of file diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/ListChildPagesFromCurrentPage.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/ListChildPagesFromCurrentPage.cshtml new file mode 100644 index 0000000000..d53af0560b --- /dev/null +++ b/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/ListChildPagesFromCurrentPage.cshtml @@ -0,0 +1,15 @@ +@inherits Umbraco.Web.Mvc.UmbracoTemplatePage + +@* Ensure that the Current Page has children, where the property umbracoNaviHide is not True *@ +@if (CurrentPage.Children.Where("Visible").Any()) +{ +
    + @* For each child page under the root node, where the property umbracoNaviHide is not True *@ + @foreach (var childPage in CurrentPage.Children.Where("Visible")) + { +
  • + @childPage.Name +
  • + } +
+} diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/ListChildPagesOrderedByDate.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/ListChildPagesOrderedByDate.cshtml new file mode 100644 index 0000000000..e504430b9a --- /dev/null +++ b/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/ListChildPagesOrderedByDate.cshtml @@ -0,0 +1,10 @@ +@inherits Umbraco.Web.Mvc.UmbracoTemplatePage + +
    + @*OrderBy() takes the property to sort by and optionally order desc/asc *@ + + @foreach (var page in CurrentPage.Children.Where("Visible").OrderBy("CreateDate desc")) + { +
  • @page.Name
  • + } +
diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/ListChildPagesOrderedByName.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/ListChildPagesOrderedByName.cshtml new file mode 100644 index 0000000000..92324b627d --- /dev/null +++ b/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/ListChildPagesOrderedByName.cshtml @@ -0,0 +1,8 @@ +@inherits Umbraco.Web.Macros.PartialViewMacroPage +
    + @*OrderBy() takes the property to sort by*@ + @foreach (var page in CurrentPage.Children.Where("Visible").OrderBy("Name")) + { +
  • @page.Name
  • + } +
diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/ListChildPagesWithDoctype.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/ListChildPagesWithDoctype.cshtml new file mode 100644 index 0000000000..322058b881 --- /dev/null +++ b/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/ListChildPagesWithDoctype.cshtml @@ -0,0 +1,32 @@ +@inherits Umbraco.Web.Mvc.UmbracoTemplatePage + +@* + This snippet shows how simple it is to fetch only children of a certain Document Type using Razor. Instead of + calling .Children, simply call .AliasOfDocumentType in plural. + For instance .Textpages or .NewsArticles (you can find the alias of your Document Type by editing it in the + Settings section). +*@ + + +@{ + @*Build a query and return the visible items *@ + var selection= CurrentPage.Textpages.Where("Visible"); + + @* + Example of more querying, if you have a true/false property with the alias of shouldBeFeatured: + var selection= Model.Textpages.Where("shouldBeFeatured == true").Where("Visible"); + *@ +} + + +@*Determine if there are any nodes in the selection, then render list *@ +@if(selection.Any()){ + +
    + @foreach(var page in selection){ +
  • @page.Name
  • + } +
+ +} + diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/ListDescendantsFromCurrentPage.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/ListDescendantsFromCurrentPage.cshtml new file mode 100644 index 0000000000..76642a68f6 --- /dev/null +++ b/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/ListDescendantsFromCurrentPage.cshtml @@ -0,0 +1,54 @@ +@inherits Umbraco.Web.Macros.PartialViewMacroPage + +@* Ensure that the Current Page has children, where the property umbracoNaviHide is not True *@ +@if (CurrentPage.Children.Where("Visible").Any()) +{ + @* Get the first page in the children, where the property umbracoNaviHide is not True *@ + var naviLevel = CurrentPage.Children.Where("Visible").First().Level; + + @* Add in level for a CSS hook *@ +
    + @* For each child page under the root node, where the property umbracoNaviHide is not True *@ + @foreach (var childPage in CurrentPage.Children.Where("Visible")) + { +
  • + @childPage.Name + + @* if the current page has any children, where the property umbracoNaviHide is not True *@ + @if (childPage.Children.Where("Visible").Any()) + { + @* Call our helper to display the children *@ + @childPages(childPage.Children) + } +
  • + } +
+} + + +@helper childPages(dynamic pages) + { + @* Ensure that we have a collection of pages *@ + if (pages.Any()) + { + @* Get the first page in pages and get the level *@ + var naviLevel = pages.First().Level; + + @* Add in level for a CSS hook *@ +
    + @foreach (var page in pages.Where("Visible")) + { +
  • + @page.Name + + @* if the current page has any children, where the property umbracoNaviHide is not True *@ + @if (page.Children.Where("Visible").Any()) + { + @* Call our helper to display the children *@ + @childPages(page.Children) + } +
  • + } +
+ } +} \ No newline at end of file diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/Login.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/Login.cshtml new file mode 100644 index 0000000000..be4e04eeae --- /dev/null +++ b/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/Login.cshtml @@ -0,0 +1,40 @@ +@inherits Umbraco.Web.Mvc.UmbracoTemplatePage + +@using System.Web.Mvc.Html +@using ClientDependency.Core.Mvc +@using Umbraco.Web +@using Umbraco.Web.Models +@using Umbraco.Web.Controllers + +@{ + var loginModel = new LoginModel(); + + Html.EnableClientValidation(); + Html.EnableUnobtrusiveJavaScript(); + Html.RequiresJs("/umbraco_client/ui/jquery.js"); + Html.RequiresJs("/umbraco_client/Application/JQuery/jquery.validate.min.js"); + Html.RequiresJs("/umbraco_client/Application/JQuery/jquery.validate.unobtrusive.min.js"); +} + +@Html.RenderJsHere() + +@using (Html.BeginUmbracoForm("HandleLogin")) +{ +
+ Login + + @Html.ValidationSummary(true) + + @Html.LabelFor(m => loginModel.Username) + @Html.TextBoxFor(m => loginModel.Username) + @Html.ValidationMessageFor(m => loginModel.Username) +
+ + @Html.LabelFor(m => loginModel.Password) + @Html.PasswordFor(m => loginModel.Password) + @Html.ValidationMessageFor(m => loginModel.Password) +
+ + +
+} \ No newline at end of file diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/LoginStatus.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/LoginStatus.cshtml new file mode 100644 index 0000000000..4f9b30d9c0 --- /dev/null +++ b/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/LoginStatus.cshtml @@ -0,0 +1,31 @@ +@inherits Umbraco.Web.Mvc.UmbracoTemplatePage + +@using ClientDependency.Core.Mvc +@using Umbraco.Web +@using Umbraco.Web.Models +@using Umbraco.Web.Controllers + +@{ + var loginStatusModel = new LoginStatusModel(); + + Html.EnableClientValidation(); + Html.EnableUnobtrusiveJavaScript(); + Html.RequiresJs("/umbraco_client/ui/jquery.js"); + Html.RequiresJs("/umbraco_client/Application/JQuery/jquery.validate.min.js"); + Html.RequiresJs("/umbraco_client/Application/JQuery/jquery.validate.unobtrusive.min.js"); +} + +@Html.RenderJsHere() + +@if (loginStatusModel.IsLoggedIn) +{ +

You are currently logged in as @loginStatusModel.Name

+ + using (Html.BeginUmbracoForm("HandleLogout")) + { +
+ Logout + +
+ } +} \ No newline at end of file diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/MultinodeTree-picker.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/MultinodeTree-picker.cshtml new file mode 100644 index 0000000000..2cefb8d8ba --- /dev/null +++ b/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/MultinodeTree-picker.cshtml @@ -0,0 +1,20 @@ +@inherits Umbraco.Web.Mvc.UmbracoTemplatePage + +@* + Macro to list nodes 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, simply set the selection equal to the property which has the + multinode treepicker (so: replace "PropertyWithPicker" with the alias of your property). +*@ + +@* Lists each selected value from the picker as a link *@ +
    + @foreach(var id in CurrentPage.PropertyWithPicker){ + + @*For each link, get the node, and display its name and url*@ + var content = Umbraco.Content(id.InnerText); + +
  • @content.Name
  • + } +
\ No newline at end of file diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/Navigation.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/Navigation.cshtml new file mode 100644 index 0000000000..cd9efe8b35 --- /dev/null +++ b/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/Navigation.cshtml @@ -0,0 +1,22 @@ +@inherits Umbraco.Web.Mvc.UmbracoTemplatePage + +@* + Macro to display child pages below the root page of a standard website. + Also highlights the current active page/section in the navigation with + the css class "current". +*@ + + +@{ + @*Get the root of the website *@ + var root = CurrentPage.AncestorOrSelf(1); +} + +
    + @foreach (var page in root.Children.Where("Visible")) + { +
  • + @page.Name +
  • + } +
diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/RegisterMember.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/RegisterMember.cshtml new file mode 100644 index 0000000000..b0a7cbcf7f --- /dev/null +++ b/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/RegisterMember.cshtml @@ -0,0 +1,90 @@ +@inherits Umbraco.Web.Mvc.UmbracoTemplatePage + +@using System.Web.Mvc.Html +@using ClientDependency.Core.Mvc +@using Umbraco.Web +@using Umbraco.Web.Models +@using Umbraco.Web.Controllers + +@{ + var registerModel = new RegisterModel(); + + @* + Configurable here: + + registerModel.MemberTypeAlias - the default is "Member" + + registerModel.RedirectOnSucces - the default is false + + registerModel.RedirectUrl - what page do we go to if the registration was successful? + the default is "/" unless RedirectOnSuccess is set to false + + 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(); + Html.RequiresJs("/umbraco_client/ui/jquery.js"); + Html.RequiresJs("/umbraco_client/Application/JQuery/jquery.validate.min.js"); + Html.RequiresJs("/umbraco_client/Application/JQuery/jquery.validate.unobtrusive.min.js"); + + var success = TempData["FormSuccess"] != null; +} + +@if (success) +{ + // This message will show if RedirectOnSucces is set to false (default) +

Registration succeeeded.

+} +else +{ + using (Html.BeginUmbracoForm("HandleRegisterMember")) + { +
+ Register Member + + @Html.ValidationSummary(true) + + @Html.LabelFor(m => registerModel.Name) + @Html.TextBoxFor(m => registerModel.Name) + @Html.ValidationMessageFor(m => registerModel.Name) +
+ + @Html.LabelFor(m => registerModel.Email) + @Html.TextBoxFor(m => registerModel.Email) + @Html.ValidationMessageFor(m => registerModel.Email) +
+ + @Html.LabelFor(m => registerModel.Password) + @Html.PasswordFor(m => registerModel.Password) + @Html.ValidationMessageFor(m => registerModel.Password) +
+ + @if (registerModel.MemberProperties != null) { + for (var i = 0; i < registerModel.MemberProperties.Count; i++) + { + @Html.LabelFor(m => registerModel.MemberProperties[i].Value, registerModel.MemberProperties[i].Name) + @Html.EditorFor(m => registerModel.MemberProperties[i].Value) + @Html.HiddenFor(m => registerModel.MemberProperties[i].Alias) +
+ } + } + + @Html.HiddenFor(m => registerModel.MemberTypeAlias) + @Html.HiddenFor(m => registerModel.RedirectOnSucces) + @Html.HiddenFor(m => registerModel.RedirectUrl) + @Html.HiddenFor(m => registerModel.UsernameIsEmail) + + +
+ + @Html.RenderJsHere() + } +} \ No newline at end of file diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/SiteMap.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/SiteMap.cshtml new file mode 100644 index 0000000000..6e08a509cd --- /dev/null +++ b/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/SiteMap.cshtml @@ -0,0 +1,32 @@ +@inherits Umbraco.Web.Mvc.UmbracoTemplatePage + +@*Render the sitemap by passing the root node to the traverse helper*@ +
+ @Traverse(CurrentPage.AncestorOrSelf()) +
+ +@*Helper method to travers through all descendants*@ +@helper Traverse(dynamic node) +{ + @* Update the level to reflect how deep you want the sitemap to go *@ + var maxLevelForSitemap = 4; + + @*Select visible children *@ + var items = node.Children.Where("Visible").Where("Level <= " + maxLevelForSitemap); + + @*If any items are returned, render a list *@ + if (items.Any()) + { +
    + @foreach (var item in items) + { +
  • + @item.Name + + @*Run the traverse helper again *@ + @Traverse(item) +
  • + } +
+ } +} \ No newline at end of file diff --git a/src/Umbraco.Web.UI/Umbraco/create/PartialView.ascx b/src/Umbraco.Web.UI/Umbraco/create/PartialView.ascx index 87bd5d2eab..02fb370fd7 100644 --- a/src/Umbraco.Web.UI/Umbraco/create/PartialView.ascx +++ b/src/Umbraco.Web.UI/Umbraco/create/PartialView.ascx @@ -18,7 +18,6 @@ -