diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/umbnavigation.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/umbnavigation.directive.js
index b3ce9cbd15..dfee6c1daf 100644
--- a/src/Umbraco.Web.UI.Client/src/common/directives/umbnavigation.directive.js
+++ b/src/Umbraco.Web.UI.Client/src/common/directives/umbnavigation.directive.js
@@ -3,7 +3,7 @@
* @name umbraco.directives.directive:umbNavigation
* @restrict E
**/
-function leftColumnDirective() {
+function umbNavigationDirective() {
return {
restrict: "E", // restrict to an element
replace: true, // replace the html element with the template
@@ -11,4 +11,4 @@ function leftColumnDirective() {
};
}
-angular.module('umbraco.directives').directive("umbNavigation", leftColumnDirective);
+angular.module('umbraco.directives').directive("umbNavigation", umbNavigationDirective);
\ No newline at end of file
diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/umbnotifications.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/umbnotifications.directive.js
index 607ae97f3f..365c212f42 100644
--- a/src/Umbraco.Web.UI.Client/src/common/directives/umbnotifications.directive.js
+++ b/src/Umbraco.Web.UI.Client/src/common/directives/umbnotifications.directive.js
@@ -2,11 +2,22 @@
* @ngdoc directive
* @name umbraco.directives.directive:umbNotifications
*/
-function notificationDirective() {
+function notificationDirective(notificationsService) {
return {
restrict: "E", // restrict to an element
replace: true, // replace the html element with the template
- templateUrl: 'views/directives/umb-notifications.html'
+ templateUrl: 'views/directives/umb-notifications.html',
+ link: function (scope, element, attr, ctrl) {
+
+ //subscribes to notifications in the notification service
+ scope.notifications = notificationsService.current;
+ scope.$watch('notificationsService.current', function (newVal, oldVal, scope) {
+ if (newVal) {
+ scope.notifications = newVal;
+ }
+ });
+
+ }
};
}
diff --git a/src/Umbraco.Web.UI.Client/src/common/services/dialog.service.js b/src/Umbraco.Web.UI.Client/src/common/services/dialog.service.js
index 5746fd022c..1dc25363b3 100644
--- a/src/Umbraco.Web.UI.Client/src/common/services/dialog.service.js
+++ b/src/Umbraco.Web.UI.Client/src/common/services/dialog.service.js
@@ -508,7 +508,7 @@ angular.module('umbraco.services')
/**
* @ngdoc method
- * @name umbraco.services.dialogService#ysodDialog
+ * @name umbraco.services.dialogService#embedDialog
* @methodOf umbraco.services.dialogService
* @description
* Opens a dialog to an embed dialog
@@ -531,7 +531,7 @@ angular.module('umbraco.services')
var newScope = $rootScope.$new();
newScope.error = ysodError;
return openDialog({
- modalClass: "umb-modal wide",
+ modalClass: "umb-modal wide ysod",
scope: newScope,
//callback: options.callback,
template: 'views/common/dialogs/ysod.html',
diff --git a/src/Umbraco.Web.UI.Client/src/controllers/main.controller.js b/src/Umbraco.Web.UI.Client/src/controllers/main.controller.js
index cc5dc314d1..5bf230a91b 100644
--- a/src/Umbraco.Web.UI.Client/src/controllers/main.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/controllers/main.controller.js
@@ -15,13 +15,7 @@ function MainController($scope, $rootScope, $location, $routeParams, $timeout, $
$scope.authenticated = null;
$scope.avatar = "assets/img/application/logo.png";
$scope.touchDevice = appState.getGlobalState("touchDevice");
- //subscribes to notifications in the notification service
- $scope.notifications = notificationsService.current;
- $scope.$watch('notificationsService.current', function (newVal, oldVal, scope) {
- if (newVal) {
- $scope.notifications = newVal;
- }
- });
+
$scope.removeNotification = function (index) {
notificationsService.remove(index);
diff --git a/src/Umbraco.Web.UI.Client/src/less/grid.less b/src/Umbraco.Web.UI.Client/src/less/grid.less
index 22ea5d9836..74c2d17f7e 100644
--- a/src/Umbraco.Web.UI.Client/src/less/grid.less
+++ b/src/Umbraco.Web.UI.Client/src/less/grid.less
@@ -176,3 +176,12 @@ body {
.emptySection #contentwrapper {left: 80px;}
.emptySection #speechbubble {left: 0;}
.emptySection #navigation {display: none}
+
+
+.login-only #speechbubble {
+ z-index: 10000;
+ left: 0 !important;
+}
+.login-only #speechbubble ul {
+ padding-left:20px
+}
\ No newline at end of file
diff --git a/src/Umbraco.Web.UI.Client/src/less/modals.less b/src/Umbraco.Web.UI.Client/src/less/modals.less
index dbfd4d7841..3a5b4abe27 100644
--- a/src/Umbraco.Web.UI.Client/src/less/modals.less
+++ b/src/Umbraco.Web.UI.Client/src/less/modals.less
@@ -193,3 +193,6 @@
height: 12px
}
+.umb-modal.ysod {
+ z-index: 10000;
+}
\ No newline at end of file
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/ysod.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/ysod.html
index d6b980fa3c..4d8a000d43 100644
--- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/ysod.html
+++ b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/ysod.html
@@ -1,4 +1,4 @@
-
+
diff --git a/src/Umbraco.Web.UI/Umbraco/Views/AuthorizeUpgrade.cshtml b/src/Umbraco.Web.UI/Umbraco/Views/AuthorizeUpgrade.cshtml
index ff307364f7..ac0b453bdb 100644
--- a/src/Umbraco.Web.UI/Umbraco/Views/AuthorizeUpgrade.cshtml
+++ b/src/Umbraco.Web.UI/Umbraco/Views/AuthorizeUpgrade.cshtml
@@ -1,14 +1,24 @@
-@using System.Web.Mvc
+@using System.Collections
+@using System.Net.Http
@using System.Web.Mvc.Html
@using Umbraco.Core
@using ClientDependency.Core
@using ClientDependency.Core.Mvc
+@using Microsoft.Owin.Security
+@using Newtonsoft.Json
+@using Newtonsoft.Json.Linq
+@using Umbraco.Core.IO
@using Umbraco.Web
@using Umbraco.Web.Editors
@using umbraco
@inherits System.Web.Mvc.WebViewPage
@{
Layout = null;
+
+ Html
+ .RequiresCss("assets/css/umbraco.css", "Umbraco")
+ .RequiresCss("lib/bootstrap-social/bootstrap-social.css", "Umbraco")
+ .RequiresCss("lib/font-awesome/css/font-awesome.min.css", "Umbraco");
}
@@ -17,10 +27,13 @@
-
+
Umbraco
-
+
+ @Html.RenderCssHere(
+ new BasicPath("Umbraco", IOHelper.ResolveUrl(SystemDirectories.Umbraco)),
+ new BasicPath("UmbracoClient", IOHelper.ResolveUrl(SystemDirectories.UmbracoClient)))
@*Because we're lazy loading angular js, the embedded cloak style will not be loaded initially, but we need it*@
-
-
+
+
-
- @*
- These are the bare minimal server variables that are required for the application to start without being authenticated,
- we will load the rest of the server vars after the user is authenticated.
- *@
-
+
+
+
+ @Html.BareMinimumServerVariables(Url, (string)ViewBag.UmbracoPath)
+
+ @Html.AngularExternalLoginInfoValues((IEnumerable
)ViewBag.ExternalSignInError)
@*And finally we can load in our angular app*@
@@ -59,4 +61,3 @@
-
diff --git a/src/Umbraco.Web.UI/umbraco/Views/Default.cshtml b/src/Umbraco.Web.UI/umbraco/Views/Default.cshtml
index b37c14b421..a0c6bd225e 100644
--- a/src/Umbraco.Web.UI/umbraco/Views/Default.cshtml
+++ b/src/Umbraco.Web.UI/umbraco/Views/Default.cshtml
@@ -14,6 +14,24 @@
@inherits System.Web.Mvc.WebViewPage
+@{
+ var isDebug = false;
+ if (Request.RawUrl.IndexOf('?') >= 0)
+ {
+ var parsed = HttpUtility.ParseQueryString(Request.RawUrl.Split('?')[1]);
+ var attempt = parsed["umbDebug"].TryConvertTo();
+ if (attempt && attempt.Result)
+ {
+ isDebug = true;
+ }
+ }
+
+ Html
+ .RequiresCss("assets/css/umbraco.css", "Umbraco")
+ .RequiresCss("tree/treeicons.css", "UmbracoClient")
+ .RequiresCss("lib/bootstrap-social/bootstrap-social.css", "Umbraco")
+ .RequiresCss("lib/font-awesome/css/font-awesome.min.css", "Umbraco");
+}
@@ -28,13 +46,6 @@
Umbraco
- @{
- Html
- .RequiresCss("assets/css/umbraco.css", "Umbraco")
- .RequiresCss("tree/treeicons.css", "UmbracoClient")
- .RequiresCss("lib/bootstrap-social/bootstrap-social.css", "Umbraco")
- .RequiresCss("lib/font-awesome/css/font-awesome.min.css", "Umbraco");
- }
@Html.RenderCssHere(
new BasicPath("Umbraco", IOHelper.ResolveUrl(SystemDirectories.Umbraco)),
new BasicPath("UmbracoClient", IOHelper.ResolveUrl(SystemDirectories.UmbracoClient)))
@@ -55,77 +66,14 @@
+ @Html.BareMinimumServerVariables(Url, (string)ViewBag.UmbracoPath)
- @{
- var loginProviders = Context.GetOwinContext().Authentication.GetExternalAuthenticationTypes()
- .Where(p => p.Properties.ContainsKey("UmbracoBackOffice"))
- .Select(p => new
- {
- authType = p.AuthenticationType,
- caption = p.Caption,
- properties = p.Properties
- })
- .ToArray();
- }
-
- @*
- These are the bare minimal server variables that are required for the application to start without being authenticated,
- we will load the rest of the server vars after the user is authenticated.
- *@
-
-
-
-
-
-
+ @Html.AngularExternalLoginInfoValues((IEnumerable)ViewBag.ExternalSignInError)
+
@*And finally we can load in our angular app*@
- @{
- var isDebug = false;
- if (Request.RawUrl.IndexOf('?') >= 0)
- {
- var parsed = HttpUtility.ParseQueryString(Request.RawUrl.Split('?')[1]);
- var attempt = parsed["umbDebug"].TryConvertTo();
- if (attempt && attempt.Result)
- {
- isDebug = true;
- }
- }
-
- }
@if (isDebug)
{
@Html.RenderProfiler()
diff --git a/src/Umbraco.Web/Editors/AuthenticationController.cs b/src/Umbraco.Web/Editors/AuthenticationController.cs
index 9162aa801c..6f3a7b4fea 100644
--- a/src/Umbraco.Web/Editors/AuthenticationController.cs
+++ b/src/Umbraco.Web/Editors/AuthenticationController.cs
@@ -49,7 +49,19 @@ namespace Umbraco.Web.Editors
protected BackOfficeUserManager UserManager
{
- get { return _userManager ?? (_userManager = TryGetOwinContext().Result.GetUserManager()); }
+ get
+ {
+ if (_userManager == null)
+ {
+ var mgr = TryGetOwinContext().Result.GetUserManager();
+ if (mgr == null)
+ {
+ throw new NullReferenceException("Could not resolve an instance of " + typeof(BackOfficeUserManager) + " from the " + typeof(IOwinContext) + " GetUserManager method");
+ }
+ _userManager = mgr;
+ }
+ return _userManager;
+ }
}
///
diff --git a/src/Umbraco.Web/Editors/BackOfficeController.cs b/src/Umbraco.Web/Editors/BackOfficeController.cs
index 40ca7d428a..fe60eb647e 100644
--- a/src/Umbraco.Web/Editors/BackOfficeController.cs
+++ b/src/Umbraco.Web/Editors/BackOfficeController.cs
@@ -94,6 +94,8 @@ namespace Umbraco.Web.Editors
[HttpGet]
public ActionResult AuthorizeUpgrade()
{
+ ViewBag.UmbracoPath = GlobalSettings.UmbracoMvcArea;
+
return View(GlobalSettings.Path.EnsureEndsWith('/') + "Views/AuthorizeUpgrade.cshtml");
}
diff --git a/src/Umbraco.Web/HtmlHelperBackOfficeExtensions.cs b/src/Umbraco.Web/HtmlHelperBackOfficeExtensions.cs
new file mode 100644
index 0000000000..b9b8d478d2
--- /dev/null
+++ b/src/Umbraco.Web/HtmlHelperBackOfficeExtensions.cs
@@ -0,0 +1,95 @@
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Web;
+using System.Web.Mvc;
+using Microsoft.Owin.Security;
+using Newtonsoft.Json;
+using Umbraco.Web.Editors;
+
+namespace Umbraco.Web
+{
+ ///
+ /// HtmlHelper extensions for the back office
+ ///
+ public static class HtmlHelperBackOfficeExtensions
+ {
+ ///
+ /// Outputs a script tag containing the bare minimum (non secure) server vars for use with the angular app
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// These are the bare minimal server variables that are required for the application to start without being authenticated,
+ /// we will load the rest of the server vars after the user is authenticated.
+ ///
+ public static IHtmlString BareMinimumServerVariables(this HtmlHelper html, UrlHelper uri, string umbracoPath)
+ {
+ var str = @"";
+
+ return html.Raw(str);
+ }
+
+ ///
+ /// Used to render the script tag that will pass in the angular externalLoginInfo service on page load
+ ///
+ ///
+ ///
+ ///
+ public static IHtmlString AngularExternalLoginInfoValues(this HtmlHelper html, IEnumerable externalLoginErrors)
+ {
+ var loginProviders = html.ViewContext.HttpContext.GetOwinContext().Authentication.GetExternalAuthenticationTypes()
+ .Where(p => p.Properties.ContainsKey("UmbracoBackOffice"))
+ .Select(p => new
+ {
+ authType = p.AuthenticationType,
+ caption = p.Caption,
+ properties = p.Properties
+ })
+ .ToArray();
+
+
+ //define a callback that is executed when we bootstrap angular, this is used to inject angular values
+ //with server side info
+
+ var sb = new StringBuilder(@"");
+
+ return html.Raw(sb.ToString());
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Umbraco.Web/HtmlHelperRenderExtensions.cs b/src/Umbraco.Web/HtmlHelperRenderExtensions.cs
index 11675cc241..7ae519a44b 100644
--- a/src/Umbraco.Web/HtmlHelperRenderExtensions.cs
+++ b/src/Umbraco.Web/HtmlHelperRenderExtensions.cs
@@ -18,7 +18,6 @@ using umbraco.cms.businesslogic.member;
namespace Umbraco.Web
{
-
///
/// HtmlHelper extensions for use in templates
///
diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj
index ca27ef9fda..d0e5493474 100644
--- a/src/Umbraco.Web/Umbraco.Web.csproj
+++ b/src/Umbraco.Web/Umbraco.Web.csproj
@@ -308,6 +308,7 @@
+