PATH:
home
/
letacommog
/
letaweb
/
scripts
/
editor
/
blog
define([], function() { return function($scope, communication,popup_form, popup_news) { var statuses = [ t('LBL_NO'), t('LBL_YES')]; $scope.gridOptions={ data:[] }; $scope.gridInstance={}; $scope.showApproved = function(a) { return statuses[a]; } $scope.filters = {}; $scope.showName = function(row) { if(angular.isDefined(row.user_name)) return row.user_name; return row.name; } $scope.showEmail = function(row) { if(angular.isDefined(row.user_email)) return row.user_email; return row.email; } $scope.delete = function() { var rows = $scope.gridInstance.selections; if(rows.length > 0) { $dialog.confirm({ title:'', message:window.t('LBL_DELETE_COMMENTS_CONFIRM_MESSAGE') }).result.then(function() { communication.api('deleteItems', {ids:rows},'blog.comment').then(function() { $scope.gridInstance.instance.reloadData(); }); }); } } $scope.RowButtonClickHandler = { viewNews : function(id) { communication.api('getNewsData',{id:id},'blog.comment').then(function(data) { popup_news.open( { data:data, }).result.then(function(data) { $scope.gridInstance.instance.reloadData(); }); }) }, edit : function(id) { communication.api('getFormData',{name:'news_Comments', id:id}).then(function(data) { popup_form.open( { name:'news_comment', data:data, execute_path:'blog.comment', form_name:'NewsCommentForm', controller: function($scope) { if($scope.data != undefined && $scope.data.news != undefined && $scope.data.news.id != undefined) { $scope.data.news_id = $scope.data.news.id; console.log($scope.data.news); } if($scope.data != undefined && $scope.data.parent != undefined && $scope.data.parent.id != undefined) { $scope.data.parent_id = $scope.data.parent.id; } } }).result.then(function(data) { $scope.gridInstance.instance.reloadData(); }); }) }, }; } });
[+]
..
[-] comment.js
[edit]
[+]
post
[-] post.js
[edit]