diff --git a/openslides/core/static/js/core/core.js b/openslides/core/static/js/core/core.js index ad837df9e..b767dccc3 100644 --- a/openslides/core/static/js/core/core.js +++ b/openslides/core/static/js/core/core.js @@ -229,12 +229,12 @@ angular.module('OpenSlidesApp.core.site', [ // Replaces any folowing points though a - templateUrl = 'static/templates/' + appName.replace(/\./g, '-') + '.html'; } - config.templateUrl = config.templateUrl || templateUrl; + config.templateUrl = state.templateUrl || templateUrl; // controller if (patterns.length >= 3) { controller = _.capitalize(patterns[1]) + defaultControllers[_.last(patterns)]; - config.controller = config.controller || controller; + config.controller = state.controller || controller; } result[name] = config; }); diff --git a/openslides/core/static/templates/index.html b/openslides/core/static/templates/index.html index 51af20959..80e5bf766 100644 --- a/openslides/core/static/templates/index.html +++ b/openslides/core/static/templates/index.html @@ -1,8 +1,5 @@ - - - - + @@ -34,19 +31,22 @@ diff --git a/openslides/users/static/js/users/users.js b/openslides/users/static/js/users/users.js index 16ca545be..600ce1bc5 100644 --- a/openslides/users/static/js/users/users.js +++ b/openslides/users/static/js/users/users.js @@ -122,6 +122,13 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users']) } } }) + .state('users.user.detail.profile', { + views: { + '@users.user': {}, + }, + url: '/profile', + controller: 'UserProfileCtrl', + }) .state('users.user.import', { url: '/import', controller: 'UserImportCtrl', @@ -336,6 +343,18 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users']) }; }) +.controller('UserProfileCtrl', function($scope, $state, User, user) { + $scope.user = user; // autoupdate is not activated + $scope.save = function (user) { + User.save(user).then( + function(success) { + // TODO: show success message + console.log("profile saved"); + } + ); + }; +}) + .controller('UserImportCtrl', function($scope, $state, User) { // import from textarea $scope.importByLine = function () { diff --git a/openslides/users/static/templates/users/user-detail-profile.html b/openslides/users/static/templates/users/user-detail-profile.html new file mode 100644 index 000000000..3612c93ca --- /dev/null +++ b/openslides/users/static/templates/users/user-detail-profile.html @@ -0,0 +1,41 @@ +

Edit profil

+ +
+
+ + +
+
+
+ + +
+
+ + +
+
+ + +
+
+
+ + +
+
+ +