-
Notifications
You must be signed in to change notification settings - Fork 1
/
bookingbug-angular-events.min.js
1 lines (1 loc) · 7.6 KB
/
bookingbug-angular-events.min.js
1
(function(){"use strict";angular.module("BBAdminEvents").config(["$logProvider",function($logProvider){"ngInject";$logProvider.debugEnabled(!0)}])}).call(this),function(){"use strict";angular.module("BBAdminEvents",["BB","BBAdmin.Services","BBAdmin.Filters","BBAdmin.Controllers","trNgGrid"]),angular.module("BBAdminEventsMockE2E",["BBAdminEvents","BBAdminMockE2E"])}.call(this),function(){"use strict";angular.module("BBAdminEvents").directive("eventChainTable",["BBModel","$log","ModalForm",function(BBModel,$log,ModalForm){var controller,link;return controller=function($scope){var editSuccess;return $scope.fields=["id","name","description"],$scope.getEventChains=function(){var params;return params={company:$scope.company},BBModel.Admin.EventChain.$query(params).then(function(event_chains){return $scope.event_chains=event_chains})},$scope.newEventChain=function(){return ModalForm["new"]({company:$scope.company,title:"New Event Chain",new_rel:"new_event_chain",post_rel:"event_chains",success:function(event_chain){return $scope.event_chains.push(event_chain)}})},$scope["delete"]=function(id){var event_chain;return event_chain=_.find($scope.event_chains,function(x){return x.id===id}),event_chain.$del("self").then(function(){return $scope.event_chains=_.reject($scope.event_chains,function(x){return x.id===id})},function(err){return $log.error("Failed to delete event_chain")})},editSuccess=function(updated){return updated.$flush("events"),$scope.event_chains=_.map($scope.event_chains,function(event_chain){return event_chain.id===updated.id?updated:event_chain})},$scope.edit=function(id){var event_chain;return event_chain=_.find($scope.event_chains,function(x){return x.id===id}),event_chain.$get("events").then(function(collection){return collection.$get("events").then(function(events){return event_chain.events=events,ModalForm.edit({model:event_chain,title:"Edit Event Chain",success:editSuccess})})})}},link=function(scope,element,attrs){return scope.company?scope.getEventChains():BBModel.Admin.Company.$query(attrs).then(function(company){return scope.company=company,scope.getEventChains()})},{controller:controller,link:link,templateUrl:"event-chain-table/event_chain_table_main.html"}}])}.call(this),function(){"use strict";angular.module("BBAdminEvents").directive("eventGroupTable",["BBModel","$log","ModalForm",function(BBModel,$log,ModalForm){var controller,link;return controller=function($scope){return $scope.getEventGroups=function(){var params;return params={company:$scope.company},BBModel.Admin.EventGroup.$query(params).then(function(event_groups){return $scope.event_groups_models=event_groups,$scope.event_groups=_.map(event_groups,function(event_group){return _.pick(event_group,"id","name","mobile")})})},$scope.newEventGroup=function(){return ModalForm["new"]({company:$scope.company,title:"New Event Group",new_rel:"new_event_group",post_rel:"event_groups",success:function(event_group){return $scope.event_groups.push(event_group)}})},$scope["delete"]=function(id){var event_group;return event_group=_.find($scope.event_groups_models,function(p){return p.id===id}),event_group.$del("self").then(function(){return $scope.event_groups=_.reject($scope.event_groups,function(p){return p.id===id})},function(err){return $log.error("Failed to delete event_group")})},$scope.edit=function(id){var event_group;return event_group=_.find($scope.event_groups_models,function(p){return p.id===id}),ModalForm.edit({model:event_group,title:"Edit Event Group"})}},link=function(scope,element,attrs){return scope.company?scope.getEventGroups():BBModel.Admin.Company.$query(attrs).then(function(company){return scope.company=company,scope.getEventGroups()})},{controller:controller,link:link,templateUrl:"event-chain-table/event_group_table_main.html"}}])}.call(this),function(){"use strict";var extend=function(child,parent){function ctor(){this.constructor=child}for(var key in parent)hasProp.call(parent,key)&&(child[key]=parent[key]);return ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype,child},hasProp={}.hasOwnProperty;angular.module("BB.Models").factory("AdminEventModel",["$q","BBModel","BaseModel",function($q,BBModel,BaseModel){var Admin_Event;return Admin_Event=function(superClass){function Admin_Event(data){Admin_Event.__super__.constructor.call(this,data)}return extend(Admin_Event,superClass),Admin_Event}(BaseModel)}])}.call(this),function(){"use strict";var extend=function(child,parent){function ctor(){this.constructor=child}for(var key in parent)hasProp.call(parent,key)&&(child[key]=parent[key]);return ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype,child},hasProp={}.hasOwnProperty;angular.module("BB.Models").factory("AdminEventChainModel",["$q","BBModel","BaseModel","EventChainService",function($q,BBModel,BaseModel,EventChainService){var Admin_EventChain;return Admin_EventChain=function(superClass){function Admin_EventChain(data){Admin_EventChain.__super__.constructor.call(this,data)}return extend(Admin_EventChain,superClass),Admin_EventChain.$query=function(params){return EventChainService.query(params)},Admin_EventChain}(BaseModel)}])}.call(this),function(){"use strict";var extend=function(child,parent){function ctor(){this.constructor=child}for(var key in parent)hasProp.call(parent,key)&&(child[key]=parent[key]);return ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype,child},hasProp={}.hasOwnProperty;angular.module("BB.Models").factory("AdminEventGroupModel",["$q","BBModel","BaseModel","EventGroupService",function($q,BBModel,BaseModel,EventGroupService){var Admin_EventGroup;return Admin_EventGroup=function(superClass){function Admin_EventGroup(data){Admin_EventGroup.__super__.constructor.call(this,data)}return extend(Admin_EventGroup,superClass),Admin_EventGroup.$query=function(params){return EventGroupService.query(params)},Admin_EventGroup}(BaseModel)}])}.call(this),function(){"use strict";angular.module("BBAdminEvents").factory("AdminEventChainService",["$q","BBModel",function($q,BBModel){return{query:function(params){var company,defer;return company=params.company,defer=$q.defer(),company.$get("event_chains").then(function(collection){return collection.$get("event_chains").then(function(event_chains){var e,models;return models=function(){var i,len,results;for(results=[],i=0,len=event_chains.length;len>i;i++)e=event_chains[i],results.push(new BBModel.Admin.EventChain(e));return results}(),defer.resolve(models)},function(err){return defer.reject(err)})},function(err){return defer.reject(err)}),defer.promise}}}])}.call(this),function(){"use strict";angular.module("BBAdminEvents").factory("AdminEventGroupService",["$q","BBModel",function($q,BBModel){return{query:function(params){var company,defer;return company=params.company,defer=$q.defer(),company.$get("event_groups").then(function(collection){return collection.$get("event_groups").then(function(event_groups){var e,models;return models=function(){var i,len,results;for(results=[],i=0,len=event_groups.length;len>i;i++)e=event_groups[i],results.push(new BBModel.Admin.EventGroup(e));return results}(),defer.resolve(models)},function(err){return defer.reject(err)})},function(err){return defer.reject(err)}),defer.promise}}}])}.call(this),function(){"use strict";angular.module("BBAdminEvents").config(["$translateProvider",function($translateProvider){"ngInject";var translations;translations={EVENTS:{EVENT_CHAIN_TABLE:{NEW_EVENT_CHAIN_BTN:"New Event Chain",DELETE_BTN:"@:COMMON.BTN.DELETE",EDIT_BTN:"@:COMMON.BTN.EDIT"},EVENT_GROUP_TABLE:{NEW_EVENT_GROUP:"New Event Group",DELETE_BTN:"@:COMMON.BTN.DELETE",EDIT_BTN:"@:COMMON.BTN.EDIT"}}},$translateProvider.translations("en",translations)}])}.call(this);