Merge pull request #5248 from Ocelot-Social-Community/create-topics-menu

feat: Topics Menu
This commit is contained in:
Moriz Wahl 2022-09-06 13:28:15 +02:00 committed by GitHub
commit 60fabe587b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 86 additions and 26 deletions

View File

@ -0,0 +1,58 @@
<template>
<dropdown ref="menu" placement="top-start" :offset="8" class="filter-menu">
<base-button
slot="default"
:filled="filterActive"
:ghost="!filterActive"
slot-scope="{ toggleMenu }"
@click.prevent="toggleMenu()"
>
<ds-text uppercase>{{ $t('admin.categories.name') }}</ds-text>
</base-button>
<template slot="popover">
<div class="filter-menu-options">
<h2 class="title">{{ $t('filter-menu.filter-by') }}</h2>
<categories-filter v-if="categoriesActive" />
</div>
</template>
</dropdown>
</template>
<script>
import Dropdown from '~/components/Dropdown'
import { mapGetters } from 'vuex'
import CategoriesFilter from './CategoriesFilter'
export default {
name: 'CategoriesMenu',
components: {
Dropdown,
CategoriesFilter,
},
props: {
placement: { type: String },
offset: { type: [String, Number] },
},
data() {
return {
categoriesActive: this.$env.CATEGORIES_ACTIVE,
}
},
computed: {
...mapGetters({
filterActive: 'posts/isActive',
}),
},
}
</script>
<style lang="scss">
.filter-menu-options {
max-width: $size-max-width-filter-menu;
padding: $space-small $space-x-small;
> .title {
font-size: $font-size-large;
}
}
</style>

View File

@ -14,7 +14,6 @@
<div class="filter-menu-options">
<h2 class="title">{{ $t('filter-menu.filter-by') }}</h2>
<following-filter />
<categories-filter v-if="categoriesActive" />
</div>
<div class="filter-menu-options">
<h2 class="title">{{ $t('filter-menu.order-by') }}</h2>
@ -29,24 +28,17 @@ import Dropdown from '~/components/Dropdown'
import { mapGetters } from 'vuex'
import FollowingFilter from './FollowingFilter'
import OrderByFilter from './OrderByFilter'
import CategoriesFilter from './CategoriesFilter'
export default {
components: {
Dropdown,
FollowingFilter,
CategoriesFilter,
OrderByFilter,
},
props: {
placement: { type: String },
offset: { type: [String, Number] },
},
data() {
return {
categoriesActive: this.$env.CATEGORIES_ACTIVE,
}
},
computed: {
...mapGetters({
filterActive: 'posts/isActive',

View File

@ -15,6 +15,13 @@
>
<base-button icon="bars" @click="toggleMobileMenuView" circle />
</ds-flex-item>
<ds-flex-item
v-if="categoriesActive && isLoggedIn"
:class="{ 'hide-mobile-menu': !toggleMobileMenu }"
style="flex-grow: 0; flex-basis: auto"
>
<categories-menu></categories-menu>
</ds-flex-item>
<ds-flex-item
:width="{ base: '45%', sm: '45%', md: '45%', lg: '50%' }"
:class="{ 'hide-mobile-menu': !toggleMobileMenu }"
@ -90,6 +97,7 @@ import FilterMenu from '~/components/FilterMenu/FilterMenu.vue'
import PageFooter from '~/components/PageFooter/PageFooter'
import AvatarMenu from '~/components/AvatarMenu/AvatarMenu'
import InviteButton from '~/components/InviteButton/InviteButton'
import CategoriesMenu from '~/components/FilterMenu/CategoriesMenu.vue'
export default {
components: {
@ -102,6 +110,7 @@ export default {
FilterMenu,
PageFooter,
InviteButton,
CategoriesMenu,
},
mixins: [seo],
data() {
@ -109,6 +118,7 @@ export default {
mobileSearchVisible: false,
toggleMobileMenu: false,
inviteRegistration: this.$env.INVITE_REGISTRATION === true, // for 'false' in .env INVITE_REGISTRATION is of type undefined and not(!) boolean false, because of internal handling,
categoriesActive: this.$env.CATEGORIES_ACTIVE,
}
},
computed: {

View File

@ -11,7 +11,7 @@
"admin": {
"categories": {
"categoryName": "Name",
"name": "Kategorien",
"name": "Themen",
"postCount": "Beiträge"
},
"dashboard": {
@ -98,7 +98,7 @@
}
},
"common": {
"category": "Kategorie ::: Kategorien",
"category": "Thema ::: Themen",
"comment": "Kommentar ::: Kommentare",
"letsTalk": "Miteinander reden",
"loading": "wird geladen",
@ -113,7 +113,7 @@
"takeAction": "Aktiv werden",
"user": "Benutzer ::: Benutzer",
"validations": {
"categories": "es müssen eine bis drei Kategorien ausgewählt werden",
"categories": "es müssen eine bis drei Themen ausgewählt werden",
"email": "muss eine gültige E-Mail-Adresse sein",
"url": "muss eine gültige URL sein"
},
@ -214,7 +214,7 @@
"amount-shouts": "{amount} recommendations",
"amount-views": "{amount} views",
"categories": {
"infoSelectedNoOfMaxCategories": "{chosen} von {max} Kategorien ausgewählt"
"infoSelectedNoOfMaxCategories": "{chosen} von {max} Themen ausgewählt"
},
"category": {
"name": {
@ -348,7 +348,7 @@
},
"filter-menu": {
"all": "Alle",
"categories": "Themenkategorien",
"categories": "Themen",
"emotions": "Emotionen",
"filter-by": "Filtern nach ...",
"following": "Benutzern, denen ich folge",
@ -470,7 +470,7 @@
"noDecision": "Keine Entscheidung!",
"numberOfUsers": "{count} Nutzern",
"previousDecision": "Vorherige Entscheidung:",
"reasonCategory": "Kategorie",
"reasonCategory": "Thema",
"reasonDescription": "Beschreibung",
"reportedOn": "Datum",
"status": "Aktueller Status",
@ -587,8 +587,8 @@
},
"reason": {
"category": {
"invalid": "Bitte wähle eine gültige Kategorie aus",
"label": "Wähle eine Kategorie:",
"invalid": "Bitte wähle ein gültiges Thema aus",
"label": "Wähle ein Thema:",
"options": {
"advert_products_services_commercial": "Bewerben von Produkten und Dienstleistungen mit kommerzieller Absicht.",
"criminal_behavior_violation_german_law": "Strafbares Verhalten bzw. Verstoß gegen deutsches Recht.",
@ -599,7 +599,7 @@
"other": "Andere …",
"pornographic_content_links": "Das Senden oder Verlinken eindeutig pornografischen Materials."
},
"placeholder": "Kategorie …"
"placeholder": "Thema …"
},
"description": {
"label": "Bitte erkläre: Warum möchtest Du dies melden?",

View File

@ -11,7 +11,7 @@
"admin": {
"categories": {
"categoryName": "Name",
"name": "Categories",
"name": "Topics",
"postCount": "Posts"
},
"dashboard": {
@ -98,7 +98,7 @@
}
},
"common": {
"category": "Category ::: Categories",
"category": "Topic ::: Topics",
"comment": "Comment ::: Comments",
"letsTalk": "Let`s Talk",
"loading": "loading",
@ -113,7 +113,7 @@
"takeAction": "Take Action",
"user": "User ::: Users",
"validations": {
"categories": "at least one and at most three categories must be selected",
"categories": "at least one and at most three topics must be selected",
"email": "must be a valid e-mail address",
"url": "must be a valid URL"
},
@ -214,7 +214,7 @@
"amount-shouts": "{amount} recommendations",
"amount-views": "{amount} views",
"categories": {
"infoSelectedNoOfMaxCategories": "{chosen} of {max} categories selected"
"infoSelectedNoOfMaxCategories": "{chosen} of {max} topics selected"
},
"category": {
"name": {
@ -348,7 +348,7 @@
},
"filter-menu": {
"all": "All",
"categories": "Categories of Content",
"categories": "Topics",
"emotions": "Emotions",
"filter-by": "Filter by ...",
"following": "Users I follow",
@ -470,7 +470,7 @@
"noDecision": "No decision!",
"numberOfUsers": "{count} users",
"previousDecision": "Previous decision:",
"reasonCategory": "Category",
"reasonCategory": "Topic",
"reasonDescription": "Description",
"reportedOn": "Date",
"status": "Current status",
@ -587,8 +587,8 @@
},
"reason": {
"category": {
"invalid": "Please select a valid category",
"label": "Select a category:",
"invalid": "Please select a valid topic",
"label": "Select a topic:",
"options": {
"advert_products_services_commercial": "Advertising products and services with commercial intent.",
"criminal_behavior_violation_german_law": "Criminal behavior or violation of German law.",
@ -599,7 +599,7 @@
"other": "Other …",
"pornographic_content_links": "Posting or linking of clearly pornographic material."
},
"placeholder": "Category …"
"placeholder": "Topic …"
},
"description": {
"label": "Please explain: Why you like to report this?",