pleroma-fe/src/components/user_note/user_note.vue

89 lines
1.7 KiB
Vue
Raw Normal View History

2022-08-20 17:02:27 +00:00
<template>
<div
class="user-note"
>
<div class="heading">
<span>{{ $t('user_card.note') }}</span>
<div class="buttons">
<button
v-show="!editing && editable"
2022-08-20 17:02:27 +00:00
class="button-default btn"
@click="startEditing"
>
{{ $t('user_card.edit_note') }}
</button>
<button
v-show="editing"
class="button-default btn"
2022-08-20 17:18:57 +00:00
:disabled="frozen"
2022-08-20 17:02:27 +00:00
@click="finalizeEditing"
>
{{ $t('user_card.edit_note_apply') }}
</button>
<button
v-show="editing"
class="button-default btn"
2022-08-20 17:18:57 +00:00
:disabled="frozen"
2022-08-20 17:02:27 +00:00
@click="cancelEditing"
>
{{ $t('user_card.edit_note_cancel') }}
</button>
</div>
</div>
2022-09-07 22:36:27 +00:00
<textarea
2022-08-20 17:02:27 +00:00
v-show="editing"
2022-08-20 17:18:57 +00:00
v-model="localNote"
2022-08-20 17:02:27 +00:00
class="note-text"
2022-09-07 22:36:27 +00:00
/>
2022-08-20 17:02:27 +00:00
<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">
2023-01-09 18:02:16 +00:00
@import "../../variables";
2022-08-20 17:02:27 +00:00
.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>