Add breadcrumb trail on Post view

And lint

Closes #466

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2022-11-02 18:02:20 +01:00
parent 30eb37e31b
commit 3ddf360e11
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773

View File

@ -1,5 +1,21 @@
<template> <template>
<article class="container mx-auto post" v-if="post"> <article class="container mx-auto post" v-if="post">
<breadcrumbs-nav
v-if="post.attributedTo"
:links="[
{ name: RouteName.MY_GROUPS, text: t('My groups') },
{
name: RouteName.GROUP,
params: { preferredUsername: usernameWithDomain(post.attributedTo) },
text: displayName(post.attributedTo),
},
{
name: RouteName.POST,
params: { slug: post.slug },
text: post.title,
},
]"
/>
<header> <header>
<div class="flex justify-center"> <div class="flex justify-center">
<lazy-image-wrapper :picture="post.picture" /> <lazy-image-wrapper :picture="post.picture" />
@ -94,7 +110,8 @@
isCurrentActorAGroupModerator isCurrentActorAGroupModerator
" "
> >
<router-link class="flex gap-1 whitespace-nowrap" <router-link
class="flex gap-1 whitespace-nowrap"
:to="{ :to="{
name: RouteName.POST_EDIT, name: RouteName.POST_EDIT,
params: { slug: post.slug }, params: { slug: post.slug },
@ -112,7 +129,10 @@
" "
tabIndex="-1" tabIndex="-1"
> >
<button @click="openDeletePostModal" class="flex gap-1 whitespace-nowrap"> <button
@click="openDeletePostModal"
class="flex gap-1 whitespace-nowrap"
>
<Delete /> <Delete />
{{ t("Delete") }} {{ t("Delete") }}
</button> </button>
@ -132,7 +152,10 @@
v-if="!post.draft" v-if="!post.draft"
tabIndex="-1" tabIndex="-1"
> >
<button @click="triggerShare()" class="flex gap-1 whitespace-nowrap"> <button
@click="triggerShare()"
class="flex gap-1 whitespace-nowrap"
>
<Share /> <Share />
{{ t("Share this event") }} {{ t("Share this event") }}
</button> </button>
@ -143,7 +166,10 @@
v-if="ableToReport" v-if="ableToReport"
tabIndex="-1" tabIndex="-1"
> >
<button @click="isReportModalActive = true" class="flex gap-1 whitespace-nowrap"> <button
@click="isReportModalActive = true"
class="flex gap-1 whitespace-nowrap"
>
<Flag /> <Flag />
{{ t("Report") }} {{ t("Report") }}
</button> </button>