mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-02-21 01:16:24 +00:00
2 lines
5.0 KiB
JavaScript
2 lines
5.0 KiB
JavaScript
!function(){"use strict";function e(e,t){e.state("administration",{abstract:!0,views:{administration:{templateUrl:"administration.html",controller:"AdministrationController",controllerAs:"app"}}}).state("administration.rights",{url:"/rights",views:{module:{templateUrl:"rights.html"}}}).state("administration.rights.edit",{url:"/:userId/:folderId/edit",views:{acl:{templateUrl:"UIxAdministrationAclEditor",controller:"AdministrationAclController",controllerAs:"acl"}},resolve:{stateUser:r,stateFolder:n,stateAcls:o}}).state("administration.theme",{url:"/theme",views:{module:{templateUrl:"UIxThemePreview",controller:"ThemePreviewController",controllerAs:"ctrl"}}}),t.rules.otherwise("/rights")}function r(t,r,n){var o=_.find(n.$users,function(e){return e.uid==r.userId});return angular.isUndefined(o)?n.$filter(r.userId).then(function(e){return o=_.find(n.$users,function(e){return e.uid==r.userId}),angular.isUndefined(o)?t.reject("User with ID "+r.userId+" not found"):o.$folders().then(function(){return o})}):o}function n(e,t,r,n,o,i){var s=r(t.folderId),r=_.find(n.$$folders,function(e){return e.name==s}),t=new("Appointment"==r.type?i:o)({id:r.name.split("/").pop(),owner:r.owner,name:r.displayName});return n.selectedFolder=t.id,t}function o(e){return e.$acl.$users(e.owner)}function t(e,t,r,n){e.DebugEnabled||n.defaultErrorHandler(function(){}),r.onError({to:"administration.**"},function(e){"administration"==e.to().name||e.ignored()||(t.error("transition error to "+e.to().name+": "+e.error().detail),n.go({state:"administration.rights"}))})}angular.module("SOGo.AdministrationUI",["ui.router","SOGo.Common","SOGo.Authentication","SOGo.PreferencesUI","SOGo.ContactsUI","SOGo.SchedulerUI"]).config(e).run(t),e.$inject=["$stateProvider","$urlServiceProvider"],r.$inject=["$q","$stateParams","User"],n.$inject=["$state","$stateParams","decodeUriFilter","stateUser","AddressBook","Calendar"],o.$inject=["stateFolder"],t.$inject=["$window","$log","$transitions","$state"]}(),function(){"use strict";function e(t,e,r,n,o,i,s,d,a){var u=this;function c(e,t){if(t&&t.target.parentNode.classList.contains("md-secondary"))return!1;u.selectedUid==e.uid?u.selectedUid=null:(u.selectedUid=e.uid,u.selectedUser=e,u.selectedUser.$rights())}function f(){e.go("administration.rights").then(function(){delete u.user.selectedFolder,u.user=null})}u.user=o,u.folder=i,u.users=s,u.folderType=angular.isDefined(i.$cards)?"AddressBook":"Calendar",u.selectedUser=null,u.selectedUid=null,u.selectUser=c,u.selectAllRights=function(e){i.$acl.$selectAllRights(e)},u.showRights=function(e){return u.selectedUid==e.uid&&e.rights},u.removeUser=function(e){t(function(){i.$acl.$removeUser(e.uid,i.owner)},500)},u.getTemplate=function(){return angular.isDefined(i.$cards)?"../"+i.owner+"/Contacts/"+i.id+"/UIxContactsUserRightsEditor":"../"+i.owner+"/Calendar/"+i.id+"/UIxCalUserRightsEditor"},u.close=f,u.save=function(){i.$acl.$saveUsersRights(i.owner).then(function(){n.show(n.simple().textContent(l("ACLs saved")).position(d.toastPosition).hideDelay(2e3)),r("xs")&&f()})},u.userToAdd="",u.searchText="",u.userFilter=function(e){return a.$filter(e,i.$acl.users,{dry:!0,uid:u.user.uid})},u.addUser=function(e){e&&i.$acl.$addUser(e,i.owner).then(function(e){u.userToAdd="",u.searchText="",u.selectedUid=null,e&&c(e)})}}e.$inject=["$timeout","$state","$mdMedia","$mdToast","stateUser","stateFolder","stateAcls","sgConstant","User"],angular.module("SOGo.AdministrationUI").controller("AdministrationAclController",e)}(),function(){"use strict";function e(t,e,r,n,o,i,s,d,l){var a=this;angular.element(e.document).find("title").attr("sg-default");this.$onInit=function(){this.service=l,this.selectedUser=null,this.users=l.$users},this.go=function(e){t.go("administration."+e),n(i["gt-md"])||o("left").close()},this.filter=function(e){l.$filter(e)},this.selectUser=function(e){this.selectedUser==this.users[e]?this.selectedUser=null:this.users[e].$folders().then(function(){a.selectedUser=a.users[e]})},this.selectFolder=function(e){t.go("administration.rights.edit",{userId:this.selectedUser.uid,folderId:d(e.name)})}}e.$inject=["$state","$window","$mdToast","$mdMedia","$mdSidenav","sgConstant","Dialog","encodeUriFilter","User"],angular.module("SOGo.AdministrationUI").controller("AdministrationController",e)}(),function(){"use strict";function e(e){e.registerStyles(['.foreground-1 { color: "{{foreground-1}}" }','.foreground-2 { color: "{{foreground-2}}" }','.foreground-3 { color: "{{foreground-3}}" }','.foreground-4 { color: "{{foreground-4}}" }','.background-contrast { color: "{{background-contrast}}" }','.background-contrast-secondary { color: "{{background-contrast-secondary}}" }','.background-default { background-color: "{{background-default}}" }'].join("")),e.generateThemesOnDemand(!1)}function t(e,t){this.defaultTheme=e.THEMES[e.defaultTheme()],this.jsonDefaultTheme=JSON.stringify(this.defaultTheme,void 0,2),this.getColor=t.getThemeColor}e.$inject=["$mdThemingProvider"],t.$inject=["$mdTheming","$mdColors"],angular.module("SOGo.AdministrationUI").config(e).controller("ThemePreviewController",t)}();
|
|
//# sourceMappingURL=Administration.js.map
|