|
|
|
@ -399,7 +399,8 @@
|
|
|
|
|
body-class="list-group-flush p-0 rounded">
|
|
|
|
|
<div class="list-group text-center">
|
|
|
|
|
<div class="list-group-item rounded cursor-pointer" @click="moderatePost(ctxMenuStatus, 'unlist')">Unlist from Timelines</div>
|
|
|
|
|
<div class="list-group-item rounded cursor-pointer" @click="">Add Content Warning</div>
|
|
|
|
|
<div v-if="ctxMenuStatus.sensitive" class="list-group-item rounded cursor-pointer" @click="moderatePost(ctxMenuStatus, 'remcw')">Remove Content Warning</div>
|
|
|
|
|
<div v-else class="list-group-item rounded cursor-pointer" @click="moderatePost(ctxMenuStatus, 'addcw')">Add Content Warning</div>
|
|
|
|
|
<div class="list-group-item rounded cursor-pointer text-lighter" @click="ctxModMenuClose()">Cancel</div>
|
|
|
|
|
</div>
|
|
|
|
|
</b-modal>
|
|
|
|
@ -929,36 +930,11 @@
|
|
|
|
|
|
|
|
|
|
moderatePost(status, action, $event) {
|
|
|
|
|
let username = status.account.username;
|
|
|
|
|
let msg = '';
|
|
|
|
|
let self = this;
|
|
|
|
|
switch(action) {
|
|
|
|
|
case 'autocw':
|
|
|
|
|
let msg = 'Are you sure you want to enforce CW for ' + username + ' ?';
|
|
|
|
|
swal({
|
|
|
|
|
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 enforced CW for ' + username, 'success');
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
swal(
|
|
|
|
|
'Error',
|
|
|
|
|
'Something went wrong, please try again later.',
|
|
|
|
|
'error'
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'noautolink':
|
|
|
|
|
msg = 'Are you sure you want to disable auto linking for ' + username + ' ?';
|
|
|
|
|
case 'addcw':
|
|
|
|
|
msg = 'Are you sure you want to add a content warning to this post?';
|
|
|
|
|
swal({
|
|
|
|
|
title: 'Confirm',
|
|
|
|
|
text: msg,
|
|
|
|
@ -972,20 +948,23 @@
|
|
|
|
|
item_id: status.id,
|
|
|
|
|
item_type: 'status'
|
|
|
|
|
}).then(res => {
|
|
|
|
|
swal('Success', 'Successfully disabled autolinking for ' + username, 'success');
|
|
|
|
|
swal('Success', 'Successfully added content warning', 'success');
|
|
|
|
|
status.sensitive = true;
|
|
|
|
|
self.ctxModMenuClose();
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
swal(
|
|
|
|
|
'Error',
|
|
|
|
|
'Something went wrong, please try again later.',
|
|
|
|
|
'error'
|
|
|
|
|
);
|
|
|
|
|
self.ctxModMenuClose();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'unlisted':
|
|
|
|
|
msg = 'Are you sure you want to unlist from timelines for ' + username + ' ?';
|
|
|
|
|
case 'remcw':
|
|
|
|
|
msg = 'Are you sure you want to remove the content warning on this post?';
|
|
|
|
|
swal({
|
|
|
|
|
title: 'Confirm',
|
|
|
|
|
text: msg,
|
|
|
|
@ -999,20 +978,23 @@
|
|
|
|
|
item_id: status.id,
|
|
|
|
|
item_type: 'status'
|
|
|
|
|
}).then(res => {
|
|
|
|
|
swal('Success', 'Successfully unlisted for ' + username, 'success');
|
|
|
|
|
swal('Success', 'Successfully added content warning', 'success');
|
|
|
|
|
status.sensitive = false;
|
|
|
|
|
self.ctxModMenuClose();
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
swal(
|
|
|
|
|
'Error',
|
|
|
|
|
'Something went wrong, please try again later.',
|
|
|
|
|
'error'
|
|
|
|
|
);
|
|
|
|
|
self.ctxModMenuClose();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'disable':
|
|
|
|
|
msg = 'Are you sure you want to disable ' + username + '’s account ?';
|
|
|
|
|
case 'unlist':
|
|
|
|
|
msg = 'Are you sure you want to unlist this post?';
|
|
|
|
|
swal({
|
|
|
|
|
title: 'Confirm',
|
|
|
|
|
text: msg,
|
|
|
|
@ -1026,35 +1008,13 @@
|
|
|
|
|
item_id: status.id,
|
|
|
|
|
item_type: 'status'
|
|
|
|
|
}).then(res => {
|
|
|
|
|
swal('Success', 'Successfully disabled ' + username + '’s account', 'success');
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
swal(
|
|
|
|
|
'Error',
|
|
|
|
|
'Something went wrong, please try again later.',
|
|
|
|
|
'error'
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
this.feed = this.feed.filter(f => {
|
|
|
|
|
return f.id != status.id;
|
|
|
|
|
});
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'suspend':
|
|
|
|
|
msg = 'Are you sure you want to suspend ' + username + '’s account ?';
|
|
|
|
|
swal({
|
|
|
|
|
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 suspend ' + username + '’s account', 'success');
|
|
|
|
|
swal('Success', 'Successfully unlisted post', 'success');
|
|
|
|
|
self.ctxModMenuClose();
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
self.ctxModMenuClose();
|
|
|
|
|
swal(
|
|
|
|
|
'Error',
|
|
|
|
|
'Something went wrong, please try again later.',
|
|
|
|
|