Initial commit
This commit is contained in:
commit
880e39de2e
511 files changed
+38363
No files matched your search
@@ -0,0 +1,12 @@
|
||||
<div layout="row" layout-align="end center">
|
||||
<md-button class="md-icon-button" ng-click="grid.appScope.edit(row.entity)" has-permission="{{grid.appScope.Constants.Permissions.ADD_EMAIL}}">
|
||||
<md-icon class="md-16">edit</md-icon>
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="left">Edit Email Template</md-tooltip>
|
||||
</md-button>
|
||||
|
||||
<md-button class="md-icon-button" ng-click="grid.appScope.delete(row.entity)" has-permission="{{grid.appScope.Constants.Permissions.DELETE_EMAIL}}">
|
||||
<md-icon class="md-16">delete</md-icon>
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="left">Delete Email Template</md-tooltip>
|
||||
</md-button>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,21 @@
|
||||
<div class="portal-repo-bank-selector fill-height" ng-if="tab.active" ng-cloak layout="column" flex="100" ng-controller="EmailBankCtrl">
|
||||
<md-content layout-xs="column" layout="row" layout-fill>
|
||||
<md-card class="md-padding" flex>
|
||||
<md-toolbar class="md-portal">
|
||||
<div class="md-toolbar-tools">
|
||||
<span style="padding-bottom=30px;">Available Email Templates</span>
|
||||
<span flex></span>
|
||||
<md-button class="md-icon-button" ng-click="toggleFiltering()">
|
||||
<md-icon >filter</md-icon>
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="bottom">Filter</md-tooltip>
|
||||
</md-button>
|
||||
<md-button class="md-icon-button" ng-click="addEmail()" has-permission="{{Constants.Permissions.ADD_EMAIL}}">
|
||||
<md-icon >add</md-icon>
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="bottom">Add New Email Template</md-tooltip>
|
||||
</md-button>
|
||||
</div>
|
||||
</md-toolbar>
|
||||
<div class="panel-body padding-none" ui-grid="emailGrid" ng-if="tab.active" ui-grid-pagination ui-grid-save-state ui-grid-auto-resize ui-grid-resize-columns ui-grid-pinning style="height:95%"></div>
|
||||
</md-card>
|
||||
</md-content>
|
||||
</div>
|
||||
@@ -0,0 +1,111 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* MODULE DESCRIPTION:
|
||||
*
|
||||
* TODO: Write description here.
|
||||
*/
|
||||
angular.module('portal.dashboard.emailBank', ['ui.router'])
|
||||
.controller('EmailBankCtrl', EmailBankCtrlController);
|
||||
|
||||
function EmailBankCtrlController($scope, cache, systemProvider, systemStores, $mdDialog,
|
||||
uiGridConstants, portalUtils, Constants) {
|
||||
|
||||
$scope.confirmQuestionBox = true;
|
||||
|
||||
$scope.scripts = [];
|
||||
|
||||
$scope.userRole = '';
|
||||
|
||||
$scope.Constants = Constants;
|
||||
|
||||
$scope.mCache = cache.request([
|
||||
new systemStores.EmailTemplates()
|
||||
]).then(function(){
|
||||
$scope.emailTemplates = $scope.mCache.emailTmpls.data.values;
|
||||
});
|
||||
|
||||
$scope.emailGrid = {
|
||||
data: 'emailTemplates',
|
||||
paginationPageSizes: [25, 50, 75, 100, 125, 150, 175, 200],
|
||||
paginationPageSize: 25,
|
||||
enableHorizontalScrollbar: uiGridConstants.scrollbars.NEVER,
|
||||
toggleModifierKeysToMultiSelect : true,
|
||||
enableRowHeaderSelection: true,
|
||||
multiSelect: false,
|
||||
noUnselect: false,
|
||||
onRegisterApi: function (gridApi) {
|
||||
$scope.emailTmplGridApi = gridApi;
|
||||
},
|
||||
columnDefs: [
|
||||
{field: 'emailName', displayName: 'Name', width: '*'},
|
||||
{field: 'emailSubject', displayName: 'Subject', width: '**' },
|
||||
{field: 'id', displayName: 'Actions', width: '125', enableColumnMenu: false, enableFiltering: false, enableHiding: false,
|
||||
cellTemplate: 'main/email-bank/cell-templates/email-actions.html'
|
||||
}
|
||||
],
|
||||
};
|
||||
|
||||
|
||||
$scope.edit = function(entity) {
|
||||
$mdDialog.show({
|
||||
templateUrl: 'common/partials/add-email-tmpl/add-email-tmpl.html',
|
||||
controller: 'AddEmailTmplCtrl',
|
||||
escapeToClose: false,
|
||||
locals: {
|
||||
modalInstance: {
|
||||
header: 'Edit Email Template',
|
||||
template: entity
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$scope.addEmail = function() {
|
||||
$mdDialog.show({
|
||||
templateUrl: 'common/partials/add-email-tmpl/add-email-tmpl.html',
|
||||
controller: 'AddEmailTmplCtrl',
|
||||
escapeToClose: false,
|
||||
locals: {
|
||||
modalInstance: {
|
||||
header: 'Add New Email Template',
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$scope.delete = function(entity) {
|
||||
if ($scope.confirmQuestionBox) {
|
||||
portalUtils.confirmBox('deleteTmpl', 'Delete Email Template', ['Are you sure you want to delete the template', entity.emailName],
|
||||
true, function(value) {
|
||||
if (value.confirm) {
|
||||
$scope.confirmQuestionBox = !value.checkbox;
|
||||
$scope.deleteTmpl(entity);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$scope.deleteTmpl(entity);
|
||||
}
|
||||
};
|
||||
|
||||
$scope.deleteTmpl = function(entity) {
|
||||
systemProvider.deleteEmailTemplates(entity).then(function() {
|
||||
portalUtils.toast('Email Template deleted successfully', ['top', 'left'], 2000);
|
||||
},function(err){
|
||||
portalUtils.toast('Unable to delete email Template: ' + err.message, ['top', 'left'], 4000);
|
||||
});
|
||||
};
|
||||
|
||||
$scope.toggleFiltering = function() {
|
||||
$scope.scriptGrid.enableFiltering = !$scope.scriptGrid.enableFiltering;
|
||||
$scope.emailTmplGridApi.core.notifyDataChange( uiGridConstants.dataChange.COLUMN );
|
||||
};
|
||||
|
||||
/* $scope.$on('$destroy', function () {
|
||||
$scope.mCache.unlisten();
|
||||
});*/
|
||||
|
||||
} //end EmailBankCtrlController function
|
||||
|
||||
})();
|
||||
Reference in new issue
Block a user