Skip to content
Snippets Groups Projects
Unverified Commit 2e251201 authored by tusooa's avatar tusooa :zap: Committed by tusooa
Browse files

Make notes editable only on user profile

parent a35fa29a
No related branches found
No related tags found
2 merge requests!1711Update stable - 2.5.0 release,!1612User note
...@@ -40,7 +40,8 @@ export default { ...@@ -40,7 +40,8 @@ export default {
'rounded', 'rounded',
'bordered', 'bordered',
'avatarAction', // default - open profile, 'zoom' - zoom, function - call function 'avatarAction', // default - open profile, 'zoom' - zoom, function - call function
'onClose' 'onClose',
'hasNoteEditor'
], ],
data () { data () {
return { return {
...@@ -130,6 +131,9 @@ export default { ...@@ -130,6 +131,9 @@ export default {
const privileges = this.loggedIn.privileges 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') 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 () { supportsNote () {
return 'note' in this.relationship return 'note' in this.relationship
}, },
......
...@@ -269,10 +269,10 @@ ...@@ -269,10 +269,10 @@
<RemoteFollow :user="user" /> <RemoteFollow :user="user" />
</div> </div>
<UserNote <UserNote
v-if="loggedIn && isOtherUser && supportsNote" v-if="loggedIn && isOtherUser && (hasNote || (hasNoteEditor && supportsNote))"
:user="user" :user="user"
:relationship="relationship" :relationship="relationship"
:editing="isEditingNote" :editable="hasNoteEditor"
/> />
</div> </div>
</div> </div>
......
const UserNote = { const UserNote = {
props: { props: {
user: Object, user: Object,
relationship: Object relationship: Object,
editable: Boolean
}, },
data () { data () {
return { return {
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<span>{{ $t('user_card.note') }}</span> <span>{{ $t('user_card.note') }}</span>
<div class="buttons"> <div class="buttons">
<button <button
v-show="!editing" v-show="!editing && editable"
class="button-default btn" class="button-default btn"
@click="startEditing" @click="startEditing"
> >
...@@ -77,7 +77,6 @@ ...@@ -77,7 +77,6 @@
} }
.note-text { .note-text {
line-height: 2;
align-self: stretch; align-self: stretch;
} }
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
:selected="timeline.viewing" :selected="timeline.viewing"
avatar-action="zoom" avatar-action="zoom"
rounded="top" rounded="top"
:has-note-editor="true"
/> />
<div <div
v-if="user.fields_html && user.fields_html.length > 0" v-if="user.fields_html && user.fields_html.length > 0"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment