mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Show categories translated in all places and even in tooltips
Show `#` symbol in front of hashtags. Minor design changes on posts more info page.
This commit is contained in:
parent
714c658844
commit
22a005eb1c
@ -1,15 +1,15 @@
|
|||||||
import { shallowMount, createLocalVue } from '@vue/test-utils'
|
import { shallowMount, createLocalVue } from '@vue/test-utils'
|
||||||
import Styleguide from '@human-connection/styleguide'
|
import Styleguide from '@human-connection/styleguide'
|
||||||
import Tag from './'
|
import Hashtag from './Hashtag'
|
||||||
|
|
||||||
const localVue = createLocalVue()
|
const localVue = createLocalVue()
|
||||||
localVue.use(Styleguide)
|
localVue.use(Styleguide)
|
||||||
|
|
||||||
describe('Tag', () => {
|
describe('Hashtag', () => {
|
||||||
let id
|
let id
|
||||||
|
|
||||||
let Wrapper = () => {
|
let Wrapper = () => {
|
||||||
return shallowMount(Tag, {
|
return shallowMount(Hashtag, {
|
||||||
localVue,
|
localVue,
|
||||||
propsData: {
|
propsData: {
|
||||||
id,
|
id,
|
||||||
@ -1,13 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<ds-tag>
|
<ds-tag>#{{ id }}</ds-tag>
|
||||||
<ds-icon name="tag" />
|
|
||||||
{{ id }}
|
|
||||||
</ds-tag>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'HcTag',
|
name: 'HcHashtag',
|
||||||
props: {
|
props: {
|
||||||
id: { type: String, required: true },
|
id: { type: String, required: true },
|
||||||
},
|
},
|
||||||
@ -3,5 +3,5 @@
|
|||||||
Tag "Liebe"
|
Tag "Liebe"
|
||||||
|
|
||||||
```
|
```
|
||||||
<hc-tag name="Liebe" />
|
<hc-hashtag name="Liebe" />
|
||||||
```
|
```
|
||||||
@ -35,7 +35,7 @@
|
|||||||
v-for="category in post.categories"
|
v-for="category in post.categories"
|
||||||
:key="category.id"
|
:key="category.id"
|
||||||
v-tooltip="{
|
v-tooltip="{
|
||||||
content: category.name,
|
content: $t(`contribution.category.name.${category.slug}`),
|
||||||
placement: 'bottom-start',
|
placement: 'bottom-start',
|
||||||
delay: { show: 500 },
|
delay: { show: 500 },
|
||||||
}"
|
}"
|
||||||
|
|||||||
@ -52,6 +52,7 @@ export const postFragment = lang => gql`
|
|||||||
}
|
}
|
||||||
categories {
|
categories {
|
||||||
id
|
id
|
||||||
|
slug
|
||||||
name
|
name
|
||||||
icon
|
icon
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,16 +29,15 @@
|
|||||||
<hc-category
|
<hc-category
|
||||||
v-for="category in post.categories"
|
v-for="category in post.categories"
|
||||||
:key="category.id"
|
:key="category.id"
|
||||||
v-tooltip="{ content: category.name, placement: 'top-start', delay: { show: 300 } }"
|
|
||||||
:icon="category.icon"
|
:icon="category.icon"
|
||||||
:name="category.name"
|
:name="$t(`contribution.category.name.${category.slug}`)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<ds-space margin-bottom="small" />
|
<ds-space margin-bottom="small" />
|
||||||
<!-- Tags -->
|
<!-- Tags -->
|
||||||
<div v-if="post.tags && post.tags.length" class="tags">
|
<div v-if="post.tags && post.tags.length" class="tags">
|
||||||
<ds-space margin="xx-small" />
|
<ds-space margin="xx-small" />
|
||||||
<hc-tag v-for="tag in post.tags" :key="tag.id" :id="tag.id" />
|
<hc-hashtag v-for="tag in post.tags" :key="tag.id" :id="tag.id" />
|
||||||
</div>
|
</div>
|
||||||
<ds-space margin-top="x-large">
|
<ds-space margin-top="x-large">
|
||||||
<ds-flex :gutter="{ lg: 'small' }">
|
<ds-flex :gutter="{ lg: 'small' }">
|
||||||
@ -77,7 +76,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import ContentViewer from '~/components/Editor/ContentViewer'
|
import ContentViewer from '~/components/Editor/ContentViewer'
|
||||||
import HcCategory from '~/components/Category'
|
import HcCategory from '~/components/Category'
|
||||||
import HcTag from '~/components/Tag'
|
import HcHashtag from '~/components/Hashtag/Hashtag'
|
||||||
import ContentMenu from '~/components/ContentMenu'
|
import ContentMenu from '~/components/ContentMenu'
|
||||||
import HcUser from '~/components/User/User'
|
import HcUser from '~/components/User/User'
|
||||||
import HcShoutButton from '~/components/ShoutButton.vue'
|
import HcShoutButton from '~/components/ShoutButton.vue'
|
||||||
@ -94,8 +93,8 @@ export default {
|
|||||||
mode: 'out-in',
|
mode: 'out-in',
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
HcTag,
|
|
||||||
HcCategory,
|
HcCategory,
|
||||||
|
HcHashtag,
|
||||||
HcUser,
|
HcUser,
|
||||||
HcShoutButton,
|
HcShoutButton,
|
||||||
ContentMenu,
|
ContentMenu,
|
||||||
|
|||||||
@ -7,30 +7,17 @@
|
|||||||
<!-- <ds-icon name="compass" /> -->
|
<!-- <ds-icon name="compass" /> -->
|
||||||
{{ $t('post.moreInfo.titleOfCategoriesSection') }}
|
{{ $t('post.moreInfo.titleOfCategoriesSection') }}
|
||||||
</h3>
|
</h3>
|
||||||
<div class="tags">
|
<hc-category
|
||||||
<ds-icon
|
v-for="category in post.categories"
|
||||||
v-for="category in post.categories"
|
:key="category.id"
|
||||||
:key="category.id"
|
:icon="category.icon"
|
||||||
v-tooltip="{ content: category.name, placement: 'top-start', delay: { show: 300 } }"
|
:name="$t(`contribution.category.name.${category.slug}`)"
|
||||||
:name="category.icon"
|
/>
|
||||||
size="large"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!--<ds-tag
|
|
||||||
v-for="category in post.categories"
|
|
||||||
:key="category.id"><ds-icon :name="category.icon" /> {{ category.name }}</ds-tag>-->
|
|
||||||
</div>
|
|
||||||
<template v-if="post.tags && post.tags.length">
|
<template v-if="post.tags && post.tags.length">
|
||||||
<h3>
|
<h3>
|
||||||
<!-- <ds-icon name="tags" /> -->
|
|
||||||
{{ $t('post.moreInfo.titleOfHashtagsSection') }}
|
{{ $t('post.moreInfo.titleOfHashtagsSection') }}
|
||||||
</h3>
|
</h3>
|
||||||
<div class="tags">
|
<hc-hashtag v-for="tag in post.tags" :key="tag.id" :id="tag.id" />
|
||||||
<ds-tag v-for="tag in post.tags" :key="tag.id">
|
|
||||||
<ds-icon name="tag" />
|
|
||||||
{{ tag.name }}
|
|
||||||
</ds-tag>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
<h3>{{ $t('post.moreInfo.titleOfRelatedContributionsSection') }}</h3>
|
<h3>{{ $t('post.moreInfo.titleOfRelatedContributionsSection') }}</h3>
|
||||||
<ds-section>
|
<ds-section>
|
||||||
@ -49,8 +36,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import HcPostCard from '~/components/PostCard'
|
|
||||||
import HcEmpty from '~/components/Empty.vue'
|
import HcEmpty from '~/components/Empty.vue'
|
||||||
|
import HcPostCard from '~/components/PostCard'
|
||||||
|
import HcCategory from '~/components/Category'
|
||||||
|
import HcHashtag from '~/components/Hashtag/Hashtag'
|
||||||
import { relatedContributions } from '~/graphql/PostQuery'
|
import { relatedContributions } from '~/graphql/PostQuery'
|
||||||
import MasonryGrid from '~/components/MasonryGrid/MasonryGrid.vue'
|
import MasonryGrid from '~/components/MasonryGrid/MasonryGrid.vue'
|
||||||
import MasonryGridItem from '~/components/MasonryGrid/MasonryGridItem.vue'
|
import MasonryGridItem from '~/components/MasonryGrid/MasonryGridItem.vue'
|
||||||
@ -62,6 +51,8 @@ export default {
|
|||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
HcPostCard,
|
HcPostCard,
|
||||||
|
HcCategory,
|
||||||
|
HcHashtag,
|
||||||
HcEmpty,
|
HcEmpty,
|
||||||
MasonryGrid,
|
MasonryGrid,
|
||||||
MasonryGridItem,
|
MasonryGridItem,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user