Small fixes to notification page and member editing

This commit is contained in:
Nassim Jahnke 2022-05-28 18:25:52 +02:00
parent 09a4d1072e
commit 4d804fa235
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
2 changed files with 9 additions and 5 deletions

View File

@ -79,7 +79,7 @@ function invite(member: string, role: Role) {
async function post(member: EditableMember, action: "edit" | "add" | "remove") { async function post(member: EditableMember, action: "edit" | "add" | "remove") {
addErrors.value = []; addErrors.value = [];
if (search.value.length === 0) { if (member.name.length === 0) {
addErrors.value.push(i18n.t("general.error.nameEmpty")); addErrors.value.push(i18n.t("general.error.nameEmpty"));
return; return;
} }

View File

@ -100,14 +100,18 @@ async function updateInvite(invite: Invite, status: "accept" | "decline" | "unac
<h1>{{ i18n.t("notifications.title") }}</h1> <h1>{{ i18n.t("notifications.title") }}</h1>
</template> </template>
<div class="flex mb-4"> <div class="flex mb-4">
<InputSelect v-model="filters.notification" :values="notificationFilter" class="mb-4" /> <span class="flex-grow">
<Button v-if="filteredNotifications.length && filters && filters.notification === 'unread'" class="ml-4" size="medium" @click="markAllAsRead"> <InputSelect v-model="filters.notification" :values="notificationFilter" />
</span>
<Button v-if="filteredNotifications.length && filters && filters.notification === 'unread'" size="medium" @click="markAllAsRead">
{{ i18n.t("notifications.readAll") }} {{ i18n.t("notifications.readAll") }}
</Button> </Button>
</div> </div>
<Card v-for="notification in filteredNotifications" :key="notification.id" :class="'text-' + notification.type + ' flex shadow-0'"> <Card v-for="notification in filteredNotifications" :key="notification.id" :class="'text-' + notification.type + ' flex shadow-0'">
{{ i18n.t(notification.message[0], notification.message.slice(1)) }} <span class="flex-grow">
<Button v-if="!notification.read" @click="markNotificationRead(notification)"><IconMdiCheck /></Button> {{ i18n.t(notification.message[0], notification.message.slice(1)) }}
</span>
<Button v-if="!notification.read" class="ml-2" @click="markNotificationRead(notification)"><IconMdiCheck /></Button>
</Card> </Card>
<div v-if="!filteredNotifications.length" class="text-red-500 text-lg mt-4"> <div v-if="!filteredNotifications.length" class="text-red-500 text-lg mt-4">
{{ i18n.t(`notifications.empty.${filters.notification}`) }} {{ i18n.t(`notifications.empty.${filters.notification}`) }}