mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 08:13:16 +00:00
Update PostMenu, add missing methods
This commit is contained in:
parent
b7ce72972e
commit
2cd389e229
1 changed files with 32 additions and 2 deletions
|
@ -12,8 +12,8 @@
|
||||||
<a class="dropdown-item font-weight-bold" :href="reportUrl(status)">Report</a>
|
<a class="dropdown-item font-weight-bold" :href="reportUrl(status)">Report</a>
|
||||||
</span>
|
</span>
|
||||||
<span v-if="statusOwner(status) == true">
|
<span v-if="statusOwner(status) == true">
|
||||||
<a class="dropdown-item font-weight-bold text-decoration-none" v-on:click="muteProfile(status)">Mute Profile</a>
|
<a class="dropdown-item font-weight-bold text-decoration-none" @click.prevent="muteProfile(status)">Mute Profile</a>
|
||||||
<a class="dropdown-item font-weight-bold text-decoration-none" v-on:click="blockProfile(status)">Block Profile</a>
|
<a class="dropdown-item font-weight-bold text-decoration-none" @click.prevent="blockProfile(status)">Block Profile</a>
|
||||||
</span>
|
</span>
|
||||||
<span v-if="profile.is_admin == true">
|
<span v-if="profile.is_admin == true">
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
|
@ -187,6 +187,36 @@
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
muteProfile(status) {
|
||||||
|
if($('body').hasClass('loggedIn') == false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
axios.post('/i/mute', {
|
||||||
|
type: 'user',
|
||||||
|
item: status.account.id
|
||||||
|
}).then(res => {
|
||||||
|
swal('Success', 'You have successfully muted ' + status.account.acct, 'success');
|
||||||
|
}).catch(err => {
|
||||||
|
swal('Error', 'Something went wrong. Please try again later.', 'error');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
blockProfile(status) {
|
||||||
|
if($('body').hasClass('loggedIn') == false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
axios.post('/i/block', {
|
||||||
|
type: 'user',
|
||||||
|
item: status.account.id
|
||||||
|
}).then(res => {
|
||||||
|
swal('Success', 'You have successfully blocked ' + status.account.acct, 'success');
|
||||||
|
}).catch(err => {
|
||||||
|
swal('Error', 'Something went wrong. Please try again later.', 'error');
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue