@ -37,6 +37,10 @@
< div class = "list-group-item rounded cursor-pointer" @ click = "moderatePost(status, 'unlist')" > Unlist from Timelines < / div >
< div class = "list-group-item rounded cursor-pointer" @ click = "moderatePost(status, 'unlist')" > Unlist from Timelines < / div >
< div v-if ="status.sensitive" class="list-group-item rounded cursor-pointer" @click="moderatePost(status, 'remcw')" > Remove Content Warning < / div >
< div v-if ="status.sensitive" class="list-group-item rounded cursor-pointer" @click="moderatePost(status, 'remcw')" > Remove Content Warning < / div >
< div v -else class = "list-group-item rounded cursor-pointer" @ click = "moderatePost(status, 'addcw')" > Add Content Warning < / div >
< div v -else class = "list-group-item rounded cursor-pointer" @ click = "moderatePost(status, 'addcw')" > Add Content Warning < / div >
< div class = "list-group-item rounded cursor-pointer" @ click = "moderatePost(status, 'spammer')" >
Mark as Spammer < br / >
< span class = "small" > Unlist + CW existing and future posts < / span >
< / div >
<!-- < div class = "list-group-item rounded cursor-pointer" @click ="ctxModOtherMenuShow()" > Other < / div > - - >
<!-- < div class = "list-group-item rounded cursor-pointer" @click ="ctxModOtherMenuShow()" > Other < / div > - - >
< div class = "list-group-item rounded cursor-pointer text-lighter" @click ="ctxModMenuClose()" > Cancel < / div >
< div class = "list-group-item rounded cursor-pointer text-lighter" @click ="ctxModMenuClose()" > Cancel < / div >
< / div >
< / div >
@ -465,99 +469,129 @@
moderatePost ( status , action , $event ) {
moderatePost ( status , action , $event ) {
let username = status . account . username ;
let username = status . account . username ;
let pid = status . id ;
let msg = '' ;
let msg = '' ;
let self = this ;
let self = this ;
switch ( action ) {
switch ( action ) {
case 'addcw' :
case 'addcw' :
msg = 'Are you sure you want to add a content warning to this post?' ;
msg = 'Are you sure you want to add a content warning to this post?' ;
swal ( {
swal ( {
title : 'Confirm' ,
title : 'Confirm' ,
text : msg ,
text : msg ,
icon : 'warning' ,
icon : 'warning' ,
buttons : true ,
buttons : true ,
dangerMode : true
dangerMode : true
} ) . then ( res => {
} ) . then ( res => {
if ( res ) {
if ( res ) {
axios . post ( '/api/v2/moderator/action' , {
axios . post ( '/api/v2/moderator/action' , {
action : action ,
action : action ,
item _id : status . id ,
item _id : status . id ,
item _type : 'status'
item _type : 'status'
} ) . then ( res => {
} ) . then ( res => {
swal ( 'Success' , 'Successfully added content warning' , 'success' ) ;
swal ( 'Success' , 'Successfully added content warning' , 'success' ) ;
status . sensitive = true ;
status . sensitive = true ;
self . ctxModMenuClose ( ) ;
self . ctxModMenuClose ( ) ;
} ) . catch ( err => {
} ) . catch ( err => {
swal (
swal (
'Error' ,
'Error' ,
'Something went wrong, please try again later.' ,
'Something went wrong, please try again later.' ,
'error'
'error'
) ;
) ;
self . ctxModMenuClose ( ) ;
self . ctxModMenuClose ( ) ;
} ) ;
} ) ;
}
}
} ) ;
} ) ;
break ;
break ;
case 'remcw' :
case 'remcw' :
msg = 'Are you sure you want to remove the content warning on this post?' ;
msg = 'Are you sure you want to remove the content warning on this post?' ;
swal ( {
swal ( {
title : 'Confirm' ,
title : 'Confirm' ,
text : msg ,
text : msg ,
icon : 'warning' ,
icon : 'warning' ,
buttons : true ,
buttons : true ,
dangerMode : true
dangerMode : true
} ) . then ( res => {
} ) . then ( res => {
if ( res ) {
if ( res ) {
axios . post ( '/api/v2/moderator/action' , {
axios . post ( '/api/v2/moderator/action' , {
action : action ,
action : action ,
item _id : status . id ,
item _id : status . id ,
item _type : 'status'
item _type : 'status'
} ) . then ( res => {
} ) . then ( res => {
swal ( 'Success' , 'Successfully added content warning' , 'success' ) ;
swal ( 'Success' , 'Successfully added content warning' , 'success' ) ;
status . sensitive = false ;
status . sensitive = false ;
self . ctxModMenuClose ( ) ;
self . ctxModMenuClose ( ) ;
} ) . catch ( err => {
} ) . catch ( err => {
swal (
swal (
'Error' ,
'Error' ,
'Something went wrong, please try again later.' ,
'Something went wrong, please try again later.' ,
'error'
'error'
) ;
) ;
self . ctxModMenuClose ( ) ;
self . ctxModMenuClose ( ) ;
} ) ;
} ) ;
}
}
} ) ;
} ) ;
break ;
break ;
case 'unlist' :
case 'unlist' :
msg = 'Are you sure you want to unlist this post?' ;
msg = 'Are you sure you want to unlist this post?' ;
swal ( {
swal ( {
title : 'Confirm' ,
title : 'Confirm' ,
text : msg ,
text : msg ,
icon : 'warning' ,
icon : 'warning' ,
buttons : true ,
buttons : true ,
dangerMode : true
dangerMode : true
} ) . then ( res => {
} ) . then ( res => {
if ( res ) {
if ( res ) {
axios . post ( '/api/v2/moderator/action' , {
axios . post ( '/api/v2/moderator/action' , {
action : action ,
action : action ,
item _id : status . id ,
item _id : status . id ,
item _type : 'status'
item _type : 'status'
} ) . then ( res => {
} ) . then ( res => {
this . feed = this . feed . filter ( f => {
this . feed = this . feed . filter ( f => {
return f . id != status . id ;
return f . id != status . id ;
} ) ;
swal ( 'Success' , 'Successfully unlisted post' , 'success' ) ;
self . ctxModMenuClose ( ) ;
} ) . catch ( err => {
self . ctxModMenuClose ( ) ;
swal (
'Error' ,
'Something went wrong, please try again later.' ,
'error'
) ;
} ) ;
} ) ;
swal ( 'Success' , 'Successfully unlisted post' , 'success' ) ;
}
self . ctxModMenuClose ( ) ;
} ) ;
} ) . catch ( err => {
break ;
self . ctxModMenuClose ( ) ;
swal (
case 'spammer' :
'Error' ,
msg = 'Are you sure you want to mark this user as a spammer? All existing and future posts will be unlisted on timelines and a content warning will be applied.' ;
'Something went wrong, please try again later.' ,
swal ( {
'error'
title : 'Confirm' ,
) ;
text : msg ,
} ) ;
icon : 'warning' ,
}
buttons : true ,
} ) ;
dangerMode : true
} ) . then ( res => {
if ( res ) {
axios . post ( '/api/v2/moderator/action' , {
action : action ,
item _id : status . id ,
item _type : 'status'
} ) . then ( res => {
swal ( 'Success' , 'Successfully marked account as spammer' , 'success' ) ;
self . ctxModMenuClose ( ) ;
} ) . catch ( err => {
self . ctxModMenuClose ( ) ;
swal (
'Error' ,
'Something went wrong, please try again later.' ,
'error'
) ;
} ) ;
}
} ) ;
break ;
break ;
}
}
} ,
} ,