Make notes editable only on user profile
This commit is contained in:
parent
a35fa29a6b
commit
2e25120192
@ -40,7 +40,8 @@ export default {
|
||||
'rounded',
|
||||
'bordered',
|
||||
'avatarAction', // default - open profile, 'zoom' - zoom, function - call function
|
||||
'onClose'
|
||||
'onClose',
|
||||
'hasNoteEditor'
|
||||
],
|
||||
data () {
|
||||
return {
|
||||
@ -130,6 +131,9 @@ export default {
|
||||
const privileges = this.loggedIn.privileges
|
||||
return this.loggedIn.role === 'admin' || privileges.includes('users_manage_activation_state') || privileges.includes('users_delete') || privileges.includes('users_manage_tags')
|
||||
},
|
||||
hasNote () {
|
||||
return this.relationship.note
|
||||
},
|
||||
supportsNote () {
|
||||
return 'note' in this.relationship
|
||||
},
|
||||
|
@ -269,10 +269,10 @@
|
||||
<RemoteFollow :user="user" />
|
||||
</div>
|
||||
<UserNote
|
||||
v-if="loggedIn && isOtherUser && supportsNote"
|
||||
v-if="loggedIn && isOtherUser && (hasNote || (hasNoteEditor && supportsNote))"
|
||||
:user="user"
|
||||
:relationship="relationship"
|
||||
:editing="isEditingNote"
|
||||
:editable="hasNoteEditor"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,7 +1,8 @@
|
||||
const UserNote = {
|
||||
props: {
|
||||
user: Object,
|
||||
relationship: Object
|
||||
relationship: Object,
|
||||
editable: Boolean
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
|
@ -6,7 +6,7 @@
|
||||
<span>{{ $t('user_card.note') }}</span>
|
||||
<div class="buttons">
|
||||
<button
|
||||
v-show="!editing"
|
||||
v-show="!editing && editable"
|
||||
class="button-default btn"
|
||||
@click="startEditing"
|
||||
>
|
||||
@ -77,7 +77,6 @@
|
||||
}
|
||||
|
||||
.note-text {
|
||||
line-height: 2;
|
||||
align-self: stretch;
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,7 @@
|
||||
:selected="timeline.viewing"
|
||||
avatar-action="zoom"
|
||||
rounded="top"
|
||||
:has-note-editor="true"
|
||||
/>
|
||||
<div
|
||||
v-if="user.fields_html && user.fields_html.length > 0"
|
||||
|
Loading…
Reference in New Issue
Block a user