diff options
| author | HJ <30-hj@users.noreply.git.pleroma.social> | 2022-12-22 13:14:30 +0000 |
|---|---|---|
| committer | HJ <30-hj@users.noreply.git.pleroma.social> | 2022-12-22 13:14:30 +0000 |
| commit | e009510c52d62a19136e01d9f0753448ad703016 (patch) | |
| tree | b3dbe611155aeb7d3ff554e900635575792527b4 /src/components/user_note/user_note.vue | |
| parent | 515dcfd3395ce4c6bd228e6bfc20120de78976c1 (diff) | |
| parent | 2e2512019230f299c2c9eae18afec3c8218d2697 (diff) | |
Merge branch 'from/develop/tusooa/user-note' into 'develop'
User note
See merge request pleroma/pleroma-fe!1612
Diffstat (limited to 'src/components/user_note/user_note.vue')
| -rw-r--r-- | src/components/user_note/user_note.vue | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/src/components/user_note/user_note.vue b/src/components/user_note/user_note.vue new file mode 100644 index 00000000..4286e017 --- /dev/null +++ b/src/components/user_note/user_note.vue @@ -0,0 +1,88 @@ +<template> + <div + class="user-note" + > + <div class="heading"> + <span>{{ $t('user_card.note') }}</span> + <div class="buttons"> + <button + v-show="!editing && editable" + class="button-default btn" + @click="startEditing" + > + {{ $t('user_card.edit_note') }} + </button> + <button + v-show="editing" + class="button-default btn" + :disabled="frozen" + @click="finalizeEditing" + > + {{ $t('user_card.edit_note_apply') }} + </button> + <button + v-show="editing" + class="button-default btn" + :disabled="frozen" + @click="cancelEditing" + > + {{ $t('user_card.edit_note_cancel') }} + </button> + </div> + </div> + <textarea + v-show="editing" + v-model="localNote" + class="note-text" + /> + <span + v-show="!editing" + class="note-text" + :class="{ '-blank': !relationship.note }" + > + {{ relationship.note || $t('user_card.note_blank') }} + </span> + </div> +</template> + +<script src="./user_note.js"></script> + +<style lang="scss"> +@import '../../variables'; + +.user-note { + display: flex; + flex-direction: column; + + .heading { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + margin-bottom: 0.75em; + + .btn { + min-width: 95px; + } + + .buttons { + display: flex; + flex-direction: row; + justify-content: right; + + .btn { + margin-left: 0.5em; + } + } + } + + .note-text { + align-self: stretch; + } + + .note-text.-blank { + font-style: italic; + color: var(--faint, $fallback--faint); + } +} +</style> |
