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 5aebead137..25dae4182b 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 @@ -9,11 +9,11 @@ angular.module('umbraco.services') var scope = options.scope || $rootScope.$new(), animationClass = options.animation || "fade", - modalClass = options.modalClass || "umb-modalcolumn", + modalClass = options.modalClass || "umb-modal", templateUrl = options.template || "views/common/notfound.html"; var callback = options.callback; - var $modal = $(''); + var $modal = $(''); var id = templateUrl.replace('.html', '').replace(/[\/|\.|:]/g, "-") + '-' + scope.$id; $modal diff --git a/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js b/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js index 5256f29a1c..d29a1ec0eb 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js @@ -127,6 +127,15 @@ angular.module('umbraco.services') setMode("tree"); }, + showUserDialog: function(){ + var d = dialogService.open( + { + template: "views/common/dialogs/user.html", + modalClass: "umb-modal-left", + show: true + }); + + }, showDialog: function (args) { setMode("dialog"); diff --git a/src/Umbraco.Web.UI.Client/src/common/services/user.service.js b/src/Umbraco.Web.UI.Client/src/common/services/user.service.js index 62435d09e5..87cde95012 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/user.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/user.service.js @@ -12,6 +12,8 @@ angular.module('umbraco.services') $q.when(authResource.isAuthenticated()) .then(function(data) { currentUser = data; + currentUser.avatar = 'http://www.gravatar.com/avatar/' + data.emailHash + '?s=40'; + //note, this can return null if they are not authenticated deferred.resolve({ user: data, authenticated: data == null ? false : true }); }, diff --git a/src/Umbraco.Web.UI.Client/src/less/modals.less b/src/Umbraco.Web.UI.Client/src/less/modals.less index da218b4790..df7225be39 100644 --- a/src/Umbraco.Web.UI.Client/src/less/modals.less +++ b/src/Umbraco.Web.UI.Client/src/less/modals.less @@ -1,5 +1,5 @@ -// Modals -// ------------------------- +/* Modals +// -------------------------*/ .umb-modalcolumn { background: #fff; @@ -53,8 +53,7 @@ border-top: #efefef 1px solid } -.umb-modal{border: none; border-radius: none;} - +.modal.fade.in{border: none !important; border-radius: none !important;} .umb-modal.fade { top: 0 !important; left: -100% !important; @@ -74,8 +73,28 @@ display: block; } -/* MEDIA PICKER */ +.umb-modal-left.fade { + top: 0 !important; + left: -100% !important; + width: 0px !important; + -webkit-transition: left 0.3s linear, left 0.3s ease-out; + -moz-transition: opacity 0.3s linear, top 0.3s ease-out; + -o-transition: opacity 0.3s linear, top 0.3s ease-out; + transition: opacity 0.3s linear, top 0.3s ease-out; + height: 100% !important; +} +.umb-modal-left.fade.in { + top: 0 !important; + left: 0 !important; + margin-left: 80px; + width: 440px !important; + height: 100% !important; + display: block; +} + + +/* MEDIA PICKER */ .umb-modal .umb-btn-toolbar { margin: 10px 0 0 0 } diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.controller.js new file mode 100644 index 0000000000..39f38f30e7 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.controller.js @@ -0,0 +1,7 @@ +angular.module("umbraco") + .controller("Umbraco.Dialogs.UserController", function ($scope, $location) { + $scope.logout = function () { + userService.logout(); + $location = "/"; + }; +}); \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.html new file mode 100644 index 0000000000..4bba9f4601 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.html @@ -0,0 +1,19 @@ +
+
+

{{user.name}}

+ +
+
+ +
+
+
+ +
+
+
    +
  • Your recent items
  • +
+
+
+
\ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/common/main.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/main.controller.js index c105fffa4b..f538e4c689 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/main.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/common/main.controller.js @@ -26,7 +26,6 @@ function MainController($scope, $routeParams, $rootScope, $timeout, notification $scope.closeDialogs = function (event) { $rootScope.$emit("closeDialogs"); - if (navigationService.ui.stickyNavigation && $(event.target).parents(".umb-modalcolumn").size() == 0) { navigationService.hideNavigation(); } diff --git a/src/Umbraco.Web.UI.Client/src/views/common/navigation.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/navigation.controller.js index 23d5bbc0eb..d54c71f3de 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/navigation.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/common/navigation.controller.js @@ -16,6 +16,7 @@ function NavigationController($scope, navigationService, sectionResource) { $scope.hideTree = navigationService.hideTree; $scope.hideMenu = navigationService.hideMenu; $scope.showMenu = navigationService.showMenu; + $scope.showUserDialog = navigationService.showUserDialog; $scope.hideDialog = navigationService.hideDialog; $scope.hideNavigation = navigationService.hideNavigation; $scope.ui = navigationService.ui; diff --git a/src/Umbraco.Web.UI.Client/src/views/directives/umb-leftcolumn.html b/src/Umbraco.Web.UI.Client/src/views/directives/umb-leftcolumn.html index 3e9915ed88..f9d0e62c04 100644 --- a/src/Umbraco.Web.UI.Client/src/views/directives/umb-leftcolumn.html +++ b/src/Umbraco.Web.UI.Client/src/views/directives/umb-leftcolumn.html @@ -3,7 +3,9 @@