mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Refactor 'GroupContentMenu' component
This commit is contained in:
parent
2eda102a71
commit
ac9be9e2a3
@ -47,34 +47,27 @@ export default {
|
||||
return value.match(/(groupTeaser|groupProfile)/)
|
||||
},
|
||||
},
|
||||
resource: { type: Object, required: true },
|
||||
resourceType: {
|
||||
type: String,
|
||||
required: true,
|
||||
validator: (value) => {
|
||||
return value.match(/(group)/)
|
||||
},
|
||||
},
|
||||
group: { type: Object, required: true },
|
||||
placement: { type: String, default: 'bottom-end' },
|
||||
},
|
||||
computed: {
|
||||
routes() {
|
||||
const routes = []
|
||||
|
||||
if (this.resourceType === 'group') {
|
||||
if (this.usage !== 'groupProfile') {
|
||||
routes.push({
|
||||
label: this.$t('group.contentMenu.visitGroupPage'),
|
||||
icon: 'home',
|
||||
name: 'group-id-slug',
|
||||
params: { id: this.resource.id, slug: this.resource.slug },
|
||||
params: { id: this.group.id, slug: this.group.slug },
|
||||
})
|
||||
}
|
||||
if (this.group.myRole === 'owner') {
|
||||
routes.push({
|
||||
label: this.$t('admin.settings.name'),
|
||||
path: `/group/edit/${this.group.id}`,
|
||||
icon: 'edit',
|
||||
})
|
||||
if (this.resource.myRole === 'owner') {
|
||||
routes.push({
|
||||
label: this.$t('admin.settings.name'),
|
||||
path: `/group/edit/${this.resource.id}`,
|
||||
icon: 'edit',
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return routes
|
||||
|
||||
@ -58,12 +58,7 @@
|
||||
<div v-else class="categories-placeholder"></div>
|
||||
<!-- group context menu -->
|
||||
<client-only>
|
||||
<group-content-menu
|
||||
:usage="'groupProfile'"
|
||||
:resourceType="'group'"
|
||||
:resource="group"
|
||||
:group="group"
|
||||
/>
|
||||
<group-content-menu :usage="'groupTeaser'" :group="group || {}" placement="bottom-end" />
|
||||
</client-only>
|
||||
</footer>
|
||||
<footer class="footer">
|
||||
|
||||
@ -18,10 +18,10 @@
|
||||
<!-- Menu -->
|
||||
<client-only>
|
||||
<group-content-menu
|
||||
v-if="isGroupOwner"
|
||||
class="group-content-menu"
|
||||
:usage="'groupProfile'"
|
||||
:resourceType="'group'"
|
||||
:resource="group || {}"
|
||||
:group="group || {}"
|
||||
placement="bottom-end"
|
||||
/>
|
||||
<!-- TODO: implement later on -->
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user