@ -74,7 +74,7 @@ $(function () {
. delete ( data . record . id )
. delete ( data . record . id )
. then ( function ( ) {
. then ( function ( ) {
_ dataTable . ajax . reloadEx ( ) ;
_ dataTable . ajax . reloadEx ( ) ;
c heckWaitingComments( )
C heckWaitingComments( )
abp . notify . success ( l ( 'DeletedSuccessfully' ) ) ;
abp . notify . success ( l ( 'DeletedSuccessfully' ) ) ;
} ) ;
} ) ;
}
}
@ -90,13 +90,10 @@ $(function () {
. updateApprovalStatus ( data . record . id , { IsApproved : newApprovalStatus } )
. updateApprovalStatus ( data . record . id , { IsApproved : newApprovalStatus } )
. then ( function ( ) {
. then ( function ( ) {
_ dataTable . ajax . reloadEx ( ) ;
_ dataTable . ajax . reloadEx ( ) ;
c heckWaitingComments( )
C heckWaitingComments( )
var message = newApprovalStatus ? l ( 'ApprovedSuccessfully' ) : l ( 'ApprovalRevokedSuccessfully' ) ;
var message = newApprovalStatus ? l ( 'ApprovedSuccessfully' ) : l ( 'ApprovalRevokedSuccessfully' ) ;
abp . notify . success ( message ) ;
abp . notify . success ( message ) ;
} )
} )
. catch ( function ( error ) { // TODO: Is it necessary in ABP Framework?
abp . notify . error ( error . message ) ;
} ) ;
}
}
} ,
} ,
{
{
@ -112,13 +109,10 @@ $(function () {
. updateApprovalStatus ( data . record . id , { IsApproved : newApprovalStatus } )
. updateApprovalStatus ( data . record . id , { IsApproved : newApprovalStatus } )
. then ( function ( ) {
. then ( function ( ) {
_ dataTable . ajax . reloadEx ( ) ;
_ dataTable . ajax . reloadEx ( ) ;
c heckWaitingComments( )
C heckWaitingComments( )
var message = newApprovalStatus ? l ( 'ApprovedSuccessfully' ) : l ( 'ApprovalRevokedSuccessfully' ) ;
var message = newApprovalStatus ? l ( 'ApprovedSuccessfully' ) : l ( 'ApprovalRevokedSuccessfully' ) ;
abp . notify . success ( message ) ;
abp . notify . success ( message ) ;
} )
} )
. catch ( function ( error ) { // TODO: Is it necessary in ABP Framework?
abp . notify . error ( error . message ) ;
} ) ;
}
}
}
}
]
]
@ -198,12 +192,12 @@ $(function () {
var icons = ''
var icons = ''
if ( data === null ) {
if ( data === null ) {
icons = '<i class="fa-solid fa-hourglass-start "></i>' ;
icons = '<i class="fa-solid fa-hourglass-half text-muted "></i>' ;
} else if ( typeof data === "boolean" ) {
} else if ( typeof data === "boolean" ) {
if ( data ) {
if ( data ) {
icons = '<i class="fa-solid fa-check" style="color: #63E6BE; "></i>' ;
icons = '<i class="fa-solid fa-check text-success "></i>' ;
} else {
} else {
icons = '<i class="fa-solid fa-x" style="color: #e0102f; "></i>' ;
icons = '<i class="fa-solid fa-x text-danger "></i>' ;
}
}
}
}
@ -231,28 +225,28 @@ $(function () {
_ dataTable . ajax . reloadEx ( ) ;
_ dataTable . ajax . reloadEx ( ) ;
} ) ;
} ) ;
function c heckWaitingComments( ) { // TODO: Rename this function. CheckWaitingComments is not a good name for this function.
function C heckWaitingComments( ) {
commentsService . getWaitingCount ( ) . then ( function ( count ) {
commentsService . getWaitingCount ( ) . then ( function ( count ) {
if ( count > 0 ) {
if ( count > 0 ) {
var alertMessage = l ( "CommentAlertMessage" , count ) ;
var alertMessage = l ( "CommentAlertMessage" , count ) ;
var alertElement = '<abp-alert alert-type="Warning">' + alertMessage + '</abp-alert>' ;
var alertElement = '<abp-alert alert-type="Warning">' + alertMessage + '</abp-alert>' ;
$ ( '#comments Alert' ) . html ( alertElement ) ;
$ ( '#CommentsWaiting Alert' ) . html ( alertElement ) ;
$ ( '#comments Alert' ) . show ( )
$ ( '#CommentsWaiting Alert' ) . show ( )
$ ( '#comments Alert' ) . click ( function ( ) {
$ ( '#CommentsWaiting Alert' ) . click ( function ( ) {
window . location . href = '/Cms/Comments/Approve'
window . location . href = '/Cms/Comments/Approve'
} ) ;
} ) ;
} else {
} else {
$ ( '#comments Alert' ) . hide ( )
$ ( '#CommentsWaiting Alert' ) . hide ( )
}
}
} ) ;
} ) ;
}
}
c heckWaitingComments( )
C heckWaitingComments( )
commentsService . getSettings ( ) . then ( function ( data ) {
commentsService . getSettings ( ) . then ( function ( data ) {
if ( data . commentRequireApprovement ) {
if ( data . commentRequireApprovement ) {
$ ( '#CommentsTable' ) . DataTable ( ) . column ( 6 ) . visible ( true ) ;
$ ( '#CommentsTable' ) . DataTable ( ) . column ( 6 ) . visible ( true ) ;
} else {
} else {
$ ( '#CommentsTable' ) . DataTable ( ) . column ( 6 ) . visible ( false ) ;
$ ( '#CommentsTable' ) . DataTable ( ) . column ( 6 ) . visible ( false ) ;
$ ( '#isApprovedColumn ' ) . hide ( ) ;
$ ( '#IsApprovedSelectInput ' ) . hide ( ) ;
}
}
} )
} )
} ) ;
} ) ;