parent
df51d08814
commit
75fdc72e22
6 changed files with 48 additions and 2 deletions
|
@ -20,7 +20,9 @@ const Status = {
|
|||
},
|
||||
loggedIn () {
|
||||
return !!this.$store.state.users.currentUser
|
||||
}
|
||||
},
|
||||
deleted () { return this.statusoid.deleted },
|
||||
canDelete () { return this.statusoid.user.rights.delete_others_notice || this.statusoid.user.id == this.$store.state.users.currentUser.id }
|
||||
},
|
||||
components: {
|
||||
Attachment,
|
||||
|
@ -31,6 +33,12 @@ const Status = {
|
|||
methods: {
|
||||
toggleReplying () {
|
||||
this.replying = !this.replying
|
||||
},
|
||||
deleteStatus () {
|
||||
const confirmed = confirm('Do you really want to delete this status?')
|
||||
if (confirmed) {
|
||||
this.$store.dispatch('deleteStatus', { id: this.status.id })
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<div class="status-el">
|
||||
<div class="status-el" v-if="!status.deleted">
|
||||
<div v-if="retweet" class="media container retweet-info">
|
||||
<div class="media-left">
|
||||
<i class='fa icon-retweet'></i>
|
||||
|
@ -52,6 +52,11 @@
|
|||
</div>
|
||||
<retweet-button :status=status></retweet-button>
|
||||
<favorite-button :status=status></favorite-button>
|
||||
<div v-if="canDelete">
|
||||
<a href="#" v-on:click.prevent="deleteStatus">
|
||||
<i class='fa icon-cancel delete-status'></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<post-status-form v-if="replying" :reply-to="status.id" :attentions="status.attentions" :repliedUser="status.user" v-on:posted="toggleReplying"></post-status-form>
|
||||
|
@ -125,4 +130,11 @@
|
|||
.status-el:last-child .status {
|
||||
border: none
|
||||
}
|
||||
|
||||
.icon-cancel,.delete-status {
|
||||
cursor: pointer;
|
||||
&:hover {
|
||||
color: $red;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue