From 4976ffc106c1c5b202c955f18f52bebde6a0a3c0 Mon Sep 17 00:00:00 2001 From: Callum Whyte Date: Thu, 20 Sep 2018 10:45:45 +0100 Subject: [PATCH 1/2] Updating legacy macro examples with latest V8 equivalents --- .../PartialViewMacros/Templates/Gallery.cshtml | 12 +++++++----- .../ListChildPagesFromChangeableSource.cshtml | 2 +- .../Templates/ListChildPagesOrderedByName.cshtml | 2 +- .../Templates/ListChildPagesWithDoctype.cshtml | 2 +- .../Templates/ListDescendantsFromCurrentPage.cshtml | 4 ++-- .../Templates/ListImagesFromMediaFolder.cshtml | 4 ++-- .../Templates/MultinodeTree-picker.cshtml | 4 ++-- .../PartialViewMacros/Templates/Navigation.cshtml | 2 +- .../PartialViewMacros/Templates/SiteMap.cshtml | 4 ++-- 9 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Gallery.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Gallery.cshtml index a34eab0eaa..dfc5773c71 100755 --- a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Gallery.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Gallery.cshtml @@ -1,3 +1,5 @@ +@using Umbraco.Core.Models.PublishedContent +@using Umbraco.Web @inherits Umbraco.Web.Macros.PartialViewMacroPage @* Macro to display a gallery of images from the Media section. @@ -20,16 +22,16 @@
@foreach (var mediaId in mediaIds.Split(',')) { - var media = Umbraco.TypedMedia(mediaId); + var media = Umbraco.Media(mediaId); @* a single image *@ - if (media.DocumentTypeAlias == "Image") + if (media.IsDocumentType("Image")) { - @Render(media as Image); + @Render(media); } @* a folder with images under it *@ - foreach (var image in media.Children()) + foreach (var image in media.Children()) { @Render(image); } @@ -37,7 +39,7 @@
} -@helper Render(Image item) +@helper Render(IPublishedContent item) {
diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesFromChangeableSource.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesFromChangeableSource.cshtml index 6fbe125de5..e1812d2388 100755 --- a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesFromChangeableSource.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesFromChangeableSource.cshtml @@ -18,7 +18,7 @@ @if (startNodeId != null) { @* Get the starting page *@ - var startNode = Umbraco.TypedContent(startNodeId); + var startNode = Umbraco.Content(startNodeId); var selection = startNode.Children.Where(x => x.IsVisible()).ToArray(); if (selection.Length > 0) diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByName.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByName.cshtml index dd5e00cc88..a02034906d 100755 --- a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByName.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByName.cshtml @@ -1,5 +1,5 @@ @using Umbraco.Web -@inherits Umbraco.Web.Mvc.UmbracoTemplatePage +@inherits Umbraco.Web.Macros.PartialViewMacroPage @* This snippet makes a list of links to the of children of the current page using an unordered HTML list. diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesWithDoctype.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesWithDoctype.cshtml index 100d502206..0f21ce3230 100755 --- a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesWithDoctype.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesWithDoctype.cshtml @@ -1,4 +1,4 @@ -@using Umbraco.Core.Models +@using Umbraco.Core.Models.PublishedContent @using Umbraco.Web @inherits Umbraco.Web.Macros.PartialViewMacroPage diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListDescendantsFromCurrentPage.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListDescendantsFromCurrentPage.cshtml index 1e7528274f..30db9d3748 100755 --- a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListDescendantsFromCurrentPage.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListDescendantsFromCurrentPage.cshtml @@ -1,6 +1,6 @@ -@inherits Umbraco.Web.Mvc.UmbracoTemplatePage -@using Umbraco.Core.Models +@using Umbraco.Core.Models.PublishedContent @using Umbraco.Web +@inherits Umbraco.Web.Macros.PartialViewMacroPage @* This snippet creates links for every single page (no matter how deep) below diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListImagesFromMediaFolder.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListImagesFromMediaFolder.cshtml index 3303418ae4..436255f2e1 100755 --- a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListImagesFromMediaFolder.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListImagesFromMediaFolder.cshtml @@ -16,8 +16,8 @@ @if (mediaId != null) { @* Get the media item associated with the id passed in *@ - var media = Umbraco.TypedMedia(mediaId); - var selection = media.Children().ToArray(); + var media = Umbraco.Media(mediaId); + var selection = media.Children.ToArray(); if (selection.Length > 0) { diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/MultinodeTree-picker.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/MultinodeTree-picker.cshtml index a8df4b9a4e..a3fff0dc8f 100755 --- a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/MultinodeTree-picker.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/MultinodeTree-picker.cshtml @@ -1,4 +1,4 @@ -@using Umbraco.Core.Models +@using Umbraco.Core.Models.PublishedContent @using Umbraco.Web @inherits Umbraco.Web.Macros.PartialViewMacroPage @@ -10,7 +10,7 @@ multinode treepicker (so: replace "PropertyWithPicker" with the alias of your property). *@ -@{ var selection = Model.Content.GetPropertyValue>("PropertyWithPicker").ToArray(); } +@{ var selection = Model.Content.Value>("PropertyWithPicker").ToArray(); } @if (selection.Length > 0) { diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Navigation.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Navigation.cshtml index 9775c81a59..1c01eeb855 100755 --- a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Navigation.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Navigation.cshtml @@ -7,7 +7,7 @@ It also highlights the current active page/section in the navigation with the CSS class "current". *@ -@{ var selection = Model.Content.Site().Children.Where(x => x.IsVisible()).ToArray(); } +@{ var selection = Model.Content.Root().Children.Where(x => x.IsVisible()).ToArray(); } @if (selection.Length > 0) { diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/SiteMap.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/SiteMap.cshtml index 46ead8a2db..3dbf45b370 100755 --- a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/SiteMap.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/SiteMap.cshtml @@ -1,4 +1,4 @@ -@using Umbraco.Core.Models +@using Umbraco.Core.Models.PublishedContent @using Umbraco.Web @inherits Umbraco.Web.Macros.PartialViewMacroPage @@ -9,7 +9,7 @@ - It uses a custom Razor helper called Traverse() to select and display the markup and links. *@ -@{ var selection = Model.Content.Site(); } +@{ var selection = Model.Content.Root(); }
@* Render the sitemap by passing the root node to the traverse helper, below *@ From 35227a8d5881feb7f07942c400b9b1730b28dce2 Mon Sep 17 00:00:00 2001 From: Callum Whyte Date: Thu, 20 Sep 2018 14:00:01 +0100 Subject: [PATCH 2/2] Cleanup of partial view macro templates for consistency --- src/Umbraco.Web.UI/Umbraco.Web.UI.csproj | 3 -- .../Templates/Breadcrumb.cshtml | 3 +- .../Templates/EditProfile.cshtml | 23 ++++++------ .../Empty (ForUseWithCustomViews).cshtml | 1 - .../PartialViewMacros/Templates/Empty.cshtml | 2 +- .../Templates/Gallery.cshtml | 3 +- .../ListAncestorsFromCurrentPage.cshtml | 1 + .../ListChildPagesFromChangeableSource.cshtml | 2 +- .../ListChildPagesOrderedByName.cshtml | 2 +- .../ListChildPagesOrderedByProperty.cshtml | 1 + .../ListChildPagesWithDoctype.cshtml | 1 - .../ListDescendantsFromCurrentPage.cshtml | 9 ++--- .../ListImagesFromMediaFolder.cshtml | 1 + .../PartialViewMacros/Templates/Login.cshtml | 13 +++---- .../Templates/LoginStatus.cshtml | 18 ++++----- .../Templates/MultinodeTree-picker.cshtml | 2 +- .../Templates/RegisterMember.cshtml | 37 +++++++++---------- .../Templates/SiteMap.cshtml | 3 +- .../Macros/PartialViewMacroPage.cs | 4 +- 19 files changed, 61 insertions(+), 68 deletions(-) delete mode 100644 src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Empty (ForUseWithCustomViews).cshtml diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index 4df862dcb3..426b87581a 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -389,9 +389,6 @@ - - Code - diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Breadcrumb.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Breadcrumb.cshtml index 7be87c07bb..263d4ae66e 100755 --- a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Breadcrumb.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Breadcrumb.cshtml @@ -1,5 +1,6 @@ @using Umbraco.Web @inherits Umbraco.Web.Macros.PartialViewMacroPage + @* This snippet makes a breadcrumb of parents using an unordered HTML list. @@ -22,4 +23,4 @@ @* Display the current page as the last item in the list *@
  • @Model.Content.Name
  • -} \ No newline at end of file +} diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/EditProfile.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/EditProfile.cshtml index dd17f9d6f5..d74b090c07 100644 --- a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/EditProfile.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/EditProfile.cshtml @@ -1,9 +1,8 @@ -@inherits Umbraco.Web.Macros.PartialViewMacroPage - -@using System.Web.Mvc.Html +@using System.Web.Mvc.Html @using ClientDependency.Core.Mvc @using Umbraco.Web @using Umbraco.Web.Controllers +@inherits Umbraco.Web.Macros.PartialViewMacroPage @{ var profileModel = Members.GetCurrentMemberProfileModel(); @@ -11,8 +10,8 @@ Html.EnableClientValidation(); Html.EnableUnobtrusiveJavaScript(); Html.RequiresJs("/umbraco/lib/jquery/jquery.min.js"); - Html.RequiresJs("/Umbraco/lib/jquery-validate/jquery.validate.min.js"); - Html.RequiresJs("/Umbraco/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"); + Html.RequiresJs("/umbraco/lib/jquery-validate/jquery.validate.min.js"); + Html.RequiresJs("/umbraco/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"); var success = TempData["ProfileUpdateSuccess"] != null; } @@ -21,18 +20,18 @@ @Html.RenderJsHere() @if (Members.IsLoggedIn() && profileModel != null) -{ +{ if (success) { @* This message will show if RedirectOnSucces is set to false (default) *@

    Profile updated

    } - + using (Html.BeginUmbracoForm("HandleUpdateProfile")) {
    Edit profile - + @Html.ValidationSummary("profileModel", true) @Html.LabelFor(m => profileModel.Name) @@ -48,10 +47,10 @@ @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 + @* + 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 + 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") *@ @@ -62,5 +61,5 @@
    - } + } } diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Empty (ForUseWithCustomViews).cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Empty (ForUseWithCustomViews).cshtml deleted file mode 100644 index 8d10a3a9c7..0000000000 --- a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Empty (ForUseWithCustomViews).cshtml +++ /dev/null @@ -1 +0,0 @@ -@inherits Umbraco.Web.Mvc.UmbracoViewPage \ No newline at end of file diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Empty.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Empty.cshtml index dda3a17f51..711e8c0b52 100644 --- a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Empty.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Empty.cshtml @@ -1 +1 @@ -@inherits Umbraco.Web.Macros.PartialViewMacroPage \ No newline at end of file +@inherits Umbraco.Web.Macros.PartialViewMacroPage diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Gallery.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Gallery.cshtml index dfc5773c71..8e3222cd93 100755 --- a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Gallery.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Gallery.cshtml @@ -1,6 +1,7 @@ @using Umbraco.Core.Models.PublishedContent @using Umbraco.Web @inherits Umbraco.Web.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). @@ -46,4 +47,4 @@ @item.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 index f022aa5d1e..b654935558 100755 --- a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListAncestorsFromCurrentPage.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListAncestorsFromCurrentPage.cshtml @@ -1,5 +1,6 @@ @using Umbraco.Web @inherits Umbraco.Web.Macros.PartialViewMacroPage + @* This snippet makes a list of links to the of parents of the current page using an unordered HTML list. diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesFromChangeableSource.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesFromChangeableSource.cshtml index e1812d2388..46c8de695c 100755 --- a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesFromChangeableSource.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesFromChangeableSource.cshtml @@ -30,4 +30,4 @@ } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByName.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByName.cshtml index a02034906d..d0398e7272 100755 --- a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByName.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByName.cshtml @@ -20,4 +20,4 @@
  • @item.Name
  • } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByProperty.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByProperty.cshtml index db0f91c4d4..f9619e4e6f 100755 --- a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByProperty.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByProperty.cshtml @@ -14,6 +14,7 @@ *@ @{ var propertyAlias = Model.MacroParameters["propertyAlias"]; } + @if (propertyAlias != null) { var selection = Model.Content.Children.Where(x => x.IsVisible()).OrderBy(x => x.GetPropertyValue(propertyAlias.ToString())).ToArray(); diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesWithDoctype.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesWithDoctype.cshtml index 0f21ce3230..625d6565b2 100755 --- a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesWithDoctype.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesWithDoctype.cshtml @@ -20,4 +20,3 @@ } } - diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListDescendantsFromCurrentPage.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListDescendantsFromCurrentPage.cshtml index 30db9d3748..7ae917b41d 100755 --- a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListDescendantsFromCurrentPage.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListDescendantsFromCurrentPage.cshtml @@ -37,16 +37,15 @@ } - @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 *@ + @* Get the first page in pages and get the level *@ var naviLevel = selection[0].Level; - @* Add in level for a CSS hook *@ + @* Add in level for a CSS hook *@ } -} \ 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 index 436255f2e1..51fdbadb00 100755 --- a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListImagesFromMediaFolder.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListImagesFromMediaFolder.cshtml @@ -13,6 +13,7 @@ *@ @{ var mediaId = Model.MacroParameters["mediaId"]; } + @if (mediaId != null) { @* Get the media item associated with the id passed in *@ diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Login.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Login.cshtml index c3fcf04ba3..7c5ed032f7 100644 --- a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Login.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Login.cshtml @@ -1,10 +1,9 @@ -@inherits Umbraco.Web.Macros.PartialViewMacroPage - -@using System.Web.Mvc.Html +@using System.Web.Mvc.Html @using ClientDependency.Core.Mvc @using Umbraco.Web @using Umbraco.Web.Models @using Umbraco.Web.Controllers +@inherits Umbraco.Web.Macros.PartialViewMacroPage @{ var loginModel = new LoginModel(); @@ -12,8 +11,8 @@ Html.EnableClientValidation(); Html.EnableUnobtrusiveJavaScript(); Html.RequiresJs("/umbraco/lib/jquery/jquery.min.js"); - Html.RequiresJs("/Umbraco/lib/jquery-validate/jquery.validate.min.js"); - Html.RequiresJs("/Umbraco/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"); + Html.RequiresJs("/umbraco/lib/jquery-validate/jquery.validate.min.js"); + Html.RequiresJs("/umbraco/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"); } @* NOTE: This RenderJsHere code should be put on your main template page where the rest of your script tags are placed *@ @@ -23,7 +22,7 @@ {
    Login - + @Html.ValidationSummary("loginModel", true) @Html.LabelFor(m => loginModel.Username) @@ -37,5 +36,5 @@
    -
    + } diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/LoginStatus.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/LoginStatus.cshtml index 7caf13ae39..4fa4bff173 100644 --- a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/LoginStatus.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/LoginStatus.cshtml @@ -1,9 +1,9 @@ -@inherits Umbraco.Web.Macros.PartialViewMacroPage -@using System.Web.Mvc.Html +@using System.Web.Mvc.Html @using ClientDependency.Core.Mvc @using Umbraco.Web @using Umbraco.Web.Models @using Umbraco.Web.Controllers +@inherits Umbraco.Web.Macros.PartialViewMacroPage @{ var loginStatusModel = Members.GetCurrentLoginStatus(); @@ -19,8 +19,8 @@ @* 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 = "/"; + + logoutModel.RedirectUrl = "/"; *@ } @@ -33,11 +33,11 @@ using (Html.BeginUmbracoForm("HandleLogout")) { -
    - Logout - -
    - +
    + Logout + +
    + @Html.HiddenFor(m => logoutModel.RedirectUrl) } } diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/MultinodeTree-picker.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/MultinodeTree-picker.cshtml index a3fff0dc8f..d845e699e0 100755 --- a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/MultinodeTree-picker.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/MultinodeTree-picker.cshtml @@ -22,4 +22,4 @@ } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/RegisterMember.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/RegisterMember.cshtml index 51c0cc0443..b448a992d9 100644 --- a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/RegisterMember.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/RegisterMember.cshtml @@ -1,51 +1,50 @@ -@inherits Umbraco.Web.Macros.PartialViewMacroPage - -@using System.Web.Mvc.Html +@using System.Web.Mvc.Html @using ClientDependency.Core.Mvc @using Umbraco.Web @using Umbraco.Web.Controllers +@inherits Umbraco.Web.Macros.PartialViewMacroPage @{ @* - You can specify a custom member type alias in the constructor, the default is 'Member' + 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 = Members.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 + 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(); Html.RequiresJs("/umbraco/lib/jquery/jquery.min.js"); - Html.RequiresJs("/Umbraco/lib/jquery-validate/jquery.validate.min.js"); - Html.RequiresJs("/Umbraco/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"); - + Html.RequiresJs("/umbraco/lib/jquery-validate/jquery.validate.min.js"); + Html.RequiresJs("/umbraco/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"); + var success = TempData["FormSuccess"] != null; } @*NOTE: This RenderJsHere code should be put on your main template page where the rest of your script tags are placed*@ @Html.RenderJsHere() -@if (success) -{ +@if (success) +{ @* This message will show if RedirectOnSucces is set to false (default) *@

    Registration succeeded.

    } diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/SiteMap.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/SiteMap.cshtml index 3dbf45b370..567ed5d07d 100755 --- a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/SiteMap.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/SiteMap.cshtml @@ -16,7 +16,6 @@ @Traverse(selection)
    - @* Helper method to traverse through all descendants *@ @helper Traverse(IPublishedContent node) { @@ -41,4 +40,4 @@ } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Macros/PartialViewMacroPage.cs b/src/Umbraco.Web/Macros/PartialViewMacroPage.cs index 98b57272f7..7297fec6d3 100644 --- a/src/Umbraco.Web/Macros/PartialViewMacroPage.cs +++ b/src/Umbraco.Web/Macros/PartialViewMacroPage.cs @@ -1,6 +1,4 @@ -using System.Web.Mvc; -using Umbraco.Core.Models; -using Umbraco.Web.Models; +using Umbraco.Web.Models; using Umbraco.Web.Mvc; namespace Umbraco.Web.Macros