mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2026-01-20 20:01:22 +00:00
Use locale for location name
This commit is contained in:
parent
2eb77149ed
commit
7a383c88f1
@ -1,80 +1,89 @@
|
||||
import gql from 'graphql-tag'
|
||||
|
||||
export default gql(`
|
||||
query User($slug: String!, $first: Int, $offset: Int) {
|
||||
User(slug: $slug) {
|
||||
id
|
||||
name
|
||||
avatar
|
||||
about
|
||||
locationName
|
||||
location {
|
||||
name
|
||||
}
|
||||
createdAt
|
||||
badges {
|
||||
id
|
||||
key
|
||||
icon
|
||||
}
|
||||
badgesCount
|
||||
shoutedCount
|
||||
commentsCount
|
||||
followingCount
|
||||
following(first: 7) {
|
||||
export default app => {
|
||||
const lang = app.$i18n.locale().toUpperCase()
|
||||
return gql(`
|
||||
query User($slug: String!, $first: Int, $offset: Int) {
|
||||
User(slug: $slug) {
|
||||
id
|
||||
name
|
||||
slug
|
||||
avatar
|
||||
followedByCount
|
||||
contributionsCount
|
||||
commentsCount
|
||||
about
|
||||
locationName
|
||||
location {
|
||||
name: name${lang}
|
||||
}
|
||||
createdAt
|
||||
badges {
|
||||
id
|
||||
key
|
||||
icon
|
||||
}
|
||||
}
|
||||
followedByCount
|
||||
followedBy(first: 7) {
|
||||
id
|
||||
name
|
||||
slug
|
||||
avatar
|
||||
followedByCount
|
||||
contributionsCount
|
||||
commentsCount
|
||||
badges {
|
||||
id
|
||||
key
|
||||
icon
|
||||
}
|
||||
}
|
||||
contributionsCount
|
||||
contributions(first: $first, offset: $offset, orderBy: createdAt_desc) {
|
||||
id
|
||||
slug
|
||||
title
|
||||
contentExcerpt
|
||||
badgesCount
|
||||
shoutedCount
|
||||
commentsCount
|
||||
deleted
|
||||
image
|
||||
createdAt
|
||||
categories {
|
||||
followingCount
|
||||
following(first: 7) {
|
||||
id
|
||||
name
|
||||
icon
|
||||
}
|
||||
author {
|
||||
id
|
||||
slug
|
||||
avatar
|
||||
name
|
||||
followedByCount
|
||||
contributionsCount
|
||||
commentsCount
|
||||
badges {
|
||||
id
|
||||
key
|
||||
icon
|
||||
}
|
||||
location {
|
||||
name: name${lang}
|
||||
}
|
||||
}
|
||||
followedByCount
|
||||
followedBy(first: 7) {
|
||||
id
|
||||
name
|
||||
slug
|
||||
avatar
|
||||
followedByCount
|
||||
contributionsCount
|
||||
commentsCount
|
||||
badges {
|
||||
id
|
||||
key
|
||||
icon
|
||||
}
|
||||
location {
|
||||
name: name${lang}
|
||||
}
|
||||
}
|
||||
contributionsCount
|
||||
contributions(first: $first, offset: $offset, orderBy: createdAt_desc) {
|
||||
id
|
||||
slug
|
||||
title
|
||||
contentExcerpt
|
||||
shoutedCount
|
||||
commentsCount
|
||||
deleted
|
||||
image
|
||||
createdAt
|
||||
categories {
|
||||
id
|
||||
name
|
||||
icon
|
||||
}
|
||||
author {
|
||||
id
|
||||
avatar
|
||||
name
|
||||
location {
|
||||
name: name${lang}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`)
|
||||
`)
|
||||
}
|
||||
|
||||
@ -62,6 +62,7 @@ module.exports = {
|
||||
*/
|
||||
plugins: [
|
||||
{ src: '~/plugins/i18n.js', ssr: true },
|
||||
{ src: '~/plugins/axios.js', ssr: false },
|
||||
{ src: '~/plugins/keep-alive.js', ssr: false },
|
||||
{ src: '~/plugins/design-system.js', ssr: true },
|
||||
{ src: '~/plugins/vue-directives.js', ssr: false },
|
||||
|
||||
@ -79,43 +79,45 @@ export default {
|
||||
},
|
||||
apollo: {
|
||||
Post: {
|
||||
query: gql(`
|
||||
query Post($first: Int, $offset: Int) {
|
||||
Post(first: $first, offset: $offset) {
|
||||
id
|
||||
title
|
||||
contentExcerpt
|
||||
createdAt
|
||||
slug
|
||||
image
|
||||
author {
|
||||
query() {
|
||||
return gql(`
|
||||
query Post($first: Int, $offset: Int) {
|
||||
Post(first: $first, offset: $offset) {
|
||||
id
|
||||
avatar
|
||||
title
|
||||
contentExcerpt
|
||||
createdAt
|
||||
slug
|
||||
name
|
||||
contributionsCount
|
||||
shoutedCount
|
||||
commentsCount
|
||||
followedByCount
|
||||
location {
|
||||
name
|
||||
}
|
||||
badges {
|
||||
image
|
||||
author {
|
||||
id
|
||||
key
|
||||
avatar
|
||||
slug
|
||||
name
|
||||
contributionsCount
|
||||
shoutedCount
|
||||
commentsCount
|
||||
followedByCount
|
||||
location {
|
||||
name: name${this.$i18n.locale().toUpperCase()}
|
||||
}
|
||||
badges {
|
||||
id
|
||||
key
|
||||
icon
|
||||
}
|
||||
}
|
||||
commentsCount
|
||||
categories {
|
||||
id
|
||||
name
|
||||
icon
|
||||
}
|
||||
shoutedCount
|
||||
}
|
||||
commentsCount
|
||||
categories {
|
||||
id
|
||||
name
|
||||
icon
|
||||
}
|
||||
shoutedCount
|
||||
}
|
||||
}
|
||||
`),
|
||||
`)
|
||||
},
|
||||
variables() {
|
||||
return {
|
||||
first: this.pageSize,
|
||||
|
||||
@ -143,42 +143,16 @@ export default {
|
||||
},
|
||||
apollo: {
|
||||
Post: {
|
||||
query: gql(`
|
||||
query Post($slug: String!) {
|
||||
Post(slug: $slug) {
|
||||
id
|
||||
title
|
||||
content
|
||||
createdAt
|
||||
slug
|
||||
image
|
||||
author {
|
||||
query() {
|
||||
return gql(`
|
||||
query Post($slug: String!) {
|
||||
Post(slug: $slug) {
|
||||
id
|
||||
slug
|
||||
name
|
||||
avatar
|
||||
shoutedCount
|
||||
contributionsCount
|
||||
commentsCount
|
||||
followedByCount
|
||||
location {
|
||||
name
|
||||
}
|
||||
badges {
|
||||
id
|
||||
key
|
||||
icon
|
||||
}
|
||||
}
|
||||
tags {
|
||||
name
|
||||
}
|
||||
commentsCount
|
||||
comments(orderBy: createdAt_desc) {
|
||||
id
|
||||
contentExcerpt
|
||||
title
|
||||
content
|
||||
createdAt
|
||||
deleted
|
||||
slug
|
||||
image
|
||||
author {
|
||||
id
|
||||
slug
|
||||
@ -189,24 +163,52 @@ export default {
|
||||
commentsCount
|
||||
followedByCount
|
||||
location {
|
||||
name
|
||||
}
|
||||
name: name${this.$i18n.locale().toUpperCase()}
|
||||
}
|
||||
badges {
|
||||
id
|
||||
key
|
||||
icon
|
||||
}
|
||||
}
|
||||
tags {
|
||||
name
|
||||
}
|
||||
commentsCount
|
||||
comments(orderBy: createdAt_desc) {
|
||||
id
|
||||
contentExcerpt
|
||||
createdAt
|
||||
deleted
|
||||
author {
|
||||
id
|
||||
slug
|
||||
name
|
||||
avatar
|
||||
shoutedCount
|
||||
contributionsCount
|
||||
commentsCount
|
||||
followedByCount
|
||||
location {
|
||||
name: name${this.$i18n.locale().toUpperCase()}
|
||||
}
|
||||
badges {
|
||||
id
|
||||
key
|
||||
icon
|
||||
}
|
||||
}
|
||||
}
|
||||
categories {
|
||||
id
|
||||
name
|
||||
icon
|
||||
}
|
||||
shoutedCount
|
||||
}
|
||||
categories {
|
||||
id
|
||||
name
|
||||
icon
|
||||
}
|
||||
shoutedCount
|
||||
}
|
||||
}
|
||||
`),
|
||||
`)
|
||||
},
|
||||
variables() {
|
||||
return {
|
||||
slug: this.$route.params.slug
|
||||
|
||||
@ -73,54 +73,56 @@ export default {
|
||||
},
|
||||
apollo: {
|
||||
Post: {
|
||||
query: gql(`
|
||||
query Post($slug: String!) {
|
||||
Post(slug: $slug) {
|
||||
id
|
||||
title
|
||||
tags {
|
||||
id
|
||||
name
|
||||
}
|
||||
categories {
|
||||
id
|
||||
name
|
||||
icon
|
||||
}
|
||||
relatedContributions(first: 2) {
|
||||
query() {
|
||||
return gql(`
|
||||
query Post($slug: String!) {
|
||||
Post(slug: $slug) {
|
||||
id
|
||||
title
|
||||
slug
|
||||
contentExcerpt
|
||||
shoutedCount
|
||||
commentsCount
|
||||
tags {
|
||||
id
|
||||
name
|
||||
}
|
||||
categories {
|
||||
id
|
||||
name
|
||||
icon
|
||||
}
|
||||
author {
|
||||
relatedContributions(first: 2) {
|
||||
id
|
||||
name
|
||||
title
|
||||
slug
|
||||
avatar
|
||||
contributionsCount
|
||||
followedByCount
|
||||
contentExcerpt
|
||||
shoutedCount
|
||||
commentsCount
|
||||
location {
|
||||
name
|
||||
}
|
||||
badges {
|
||||
categories {
|
||||
id
|
||||
key
|
||||
name
|
||||
icon
|
||||
}
|
||||
author {
|
||||
id
|
||||
name
|
||||
slug
|
||||
avatar
|
||||
contributionsCount
|
||||
followedByCount
|
||||
commentsCount
|
||||
location {
|
||||
name: name${this.$i18n.locale().toUpperCase()}
|
||||
}
|
||||
badges {
|
||||
id
|
||||
key
|
||||
icon
|
||||
}
|
||||
}
|
||||
}
|
||||
shoutedCount
|
||||
}
|
||||
shoutedCount
|
||||
}
|
||||
}
|
||||
`),
|
||||
`)
|
||||
},
|
||||
variables() {
|
||||
return {
|
||||
slug: this.$route.params.slug
|
||||
|
||||
@ -360,7 +360,9 @@ export default {
|
||||
},
|
||||
apollo: {
|
||||
User: {
|
||||
query: require('~/graphql/UserProfileQuery.js').default,
|
||||
query() {
|
||||
return require('~/graphql/UserProfileQuery.js').default(this)
|
||||
},
|
||||
variables() {
|
||||
return {
|
||||
slug: this.$route.params.slug,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user