Commit d89bf1ab authored by Nick's avatar Nick

feat: browse tags localization

parent 2fcbe4a3
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
) )
v-icon(color='red', :left='$vuetify.breakpoint.lgAndUp') mdi-close v-icon(color='red', :left='$vuetify.breakpoint.lgAndUp') mdi-close
span.white--text(v-if='$vuetify.breakpoint.lgAndUp') {{ $t('common:actions.close') }} span.white--text(v-if='$vuetify.breakpoint.lgAndUp') {{ $t('common:actions.close') }}
v-divider(vertical)
v-content v-content
component(:is='currentEditor', :save='save') component(:is='currentEditor', :save='save')
editor-modal-properties(v-model='dialogProps') editor-modal-properties(v-model='dialogProps')
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
v-content.grey(:class='$vuetify.theme.dark ? `darken-4-d5` : `lighten-3`') v-content.grey(:class='$vuetify.theme.dark ? `darken-4-d5` : `lighten-3`')
v-toolbar(color='primary', dark, flat, height='58') v-toolbar(color='primary', dark, flat, height='58')
template(v-if='selection.length > 0') template(v-if='selection.length > 0')
.overline.mr-3.animated.fadeInLeft Current Selection .overline.mr-3.animated.fadeInLeft {{$t('tags:currentSelection')}}
v-chip.mr-3.primary--text( v-chip.mr-3.primary--text(
v-for='tag of tagsSelected' v-for='tag of tagsSelected'
:key='`tagSelected-` + tag.tag' :key='`tagSelected-` + tag.tag'
...@@ -35,14 +35,14 @@ ...@@ -35,14 +35,14 @@
@click='selection = []' @click='selection = []'
) )
v-icon(left) mdi-close v-icon(left) mdi-close
span Clear Selection span {{$t('tags:clearSelection')}}
template(v-else) template(v-else)
v-icon.mr-3.animated.fadeInRight mdi-arrow-left v-icon.mr-3.animated.fadeInRight mdi-arrow-left
.overline.animated.fadeInRight Select one or more tags .overline.animated.fadeInRight {{$t('tags:selectOneMoreTags')}}
v-toolbar(:color='$vuetify.theme.dark ? `grey darken-4-l5` : `grey lighten-4`', flat, height='58') v-toolbar(:color='$vuetify.theme.dark ? `grey darken-4-l5` : `grey lighten-4`', flat, height='58')
v-text-field.tags-search( v-text-field.tags-search(
v-model='innerSearch' v-model='innerSearch'
label='Search within results...' :label='$t(`tags:searchWithinResultsPlaceholder`)'
solo solo
hide-details hide-details
flat flat
...@@ -55,13 +55,13 @@ ...@@ -55,13 +55,13 @@
) )
template(v-if='locales.length > 1') template(v-if='locales.length > 1')
v-divider.mx-3(vertical) v-divider.mx-3(vertical)
.overline Locale .overline {{$t('tags:locale')}}
v-select.ml-2( v-select.ml-2(
:items='locales' :items='locales'
v-model='locale' v-model='locale'
:background-color='$vuetify.theme.dark ? `grey darken-3` : `white`' :background-color='$vuetify.theme.dark ? `grey darken-3` : `white`'
hide-details hide-details
label='Locale' :label='$t(`tags:locale`)'
item-text='name' item-text='name'
item-value='code' item-value='code'
rounded rounded
...@@ -71,13 +71,13 @@ ...@@ -71,13 +71,13 @@
style='max-width: 170px;' style='max-width: 170px;'
) )
v-divider.mx-3(vertical) v-divider.mx-3(vertical)
.overline Order By .overline {{$t('tags:orderBy')}}
v-select.ml-2( v-select.ml-2(
:items='orderByItems' :items='orderByItems'
v-model='orderBy' v-model='orderBy'
:background-color='$vuetify.theme.dark ? `grey darken-3` : `white`' :background-color='$vuetify.theme.dark ? `grey darken-3` : `white`'
hide-details hide-details
label='Order By' :label='$t(`tags:orderBy`)'
rounded rounded
single-line single-line
dense dense
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
v-divider v-divider
.text-center.pt-10(v-if='selection.length < 1') .text-center.pt-10(v-if='selection.length < 1')
img(src='/svg/icon-price-tag.svg') img(src='/svg/icon-price-tag.svg')
.subtitle-2.grey--text Select one or more tags on the left. .subtitle-2.grey--text {{$t('tags:selectOneMoreTagsHint')}}
.px-5.py-2(v-else) .px-5.py-2(v-else)
v-data-iterator( v-data-iterator(
:items='pages' :items='pages'
...@@ -109,15 +109,15 @@ ...@@ -109,15 +109,15 @@
size='96' size='96'
width='2' width='2'
) )
.subtitle-2.grey--text.mt-5 Retrieving page results... .subtitle-2.grey--text.mt-5 {{$t('tags:retrievingResultsLoading')}}
template(v-slot:no-data) template(v-slot:no-data)
.text-center.pt-10 .text-center.pt-10
img(src='/svg/icon-info.svg') img(src='/svg/icon-info.svg')
.subtitle-2.grey--text Couldn't find any page with the selected tags. .subtitle-2.grey--text {{$t('tags:noResults')}}
template(v-slot:no-results) template(v-slot:no-results)
.text-center.pt-10 .text-center.pt-10
img(src='/svg/icon-info.svg') img(src='/svg/icon-info.svg')
.subtitle-2.grey--text Couldn't find any page matching the current filtering options. .subtitle-2.grey--text {{$t('tags:noResultsWithFilter')}}
template(v-slot:default='props') template(v-slot:default='props')
v-row(align='stretch') v-row(align='stretch')
v-col( v-col(
...@@ -135,7 +135,8 @@ ...@@ -135,7 +135,8 @@
.d-flex.flex-row.align-center .d-flex.flex-row.align-center
.body-1: strong.primary--text {{item.title}} .body-1: strong.primary--text {{item.title}}
v-spacer v-spacer
.caption Last updated {{item.updatedAt | moment('from')}} i18next.caption(tag='div', path='tags:pageLastUpdated')
span(place='date') {{item.updatedAt | moment('from')}}
.body-2.grey--text {{item.description || '---'}} .body-2.grey--text {{item.description || '---'}}
v-divider.my-2 v-divider.my-2
.d-flex.flex-row.align-center .d-flex.flex-row.align-center
...@@ -165,6 +166,7 @@ const router = new VueRouter({ ...@@ -165,6 +166,7 @@ const router = new VueRouter({
}) })
export default { export default {
i18nOptions: { namespaces: 'tags' },
data() { data() {
return { return {
tags: [], tags: [],
...@@ -173,13 +175,6 @@ export default { ...@@ -173,13 +175,6 @@ export default {
locale: 'any', locale: 'any',
locales: [], locales: [],
orderBy: 'title', orderBy: 'title',
orderByItems: [
{ text: 'Creation Date', value: 'createdAt' },
{ text: 'ID', value: 'id' },
{ text: 'Last Modified', value: 'updatedAt' },
{ text: 'Path', value: 'path' },
{ text: 'Title', value: 'title' }
],
orderByDirection: 0, orderByDirection: 0,
pagination: { pagination: {
page: 1, page: 1,
...@@ -223,6 +218,15 @@ export default { ...@@ -223,6 +218,15 @@ export default {
}, },
pageTotal () { pageTotal () {
return Math.ceil(this.pages.length / this.pagination.itemsPerPage) return Math.ceil(this.pages.length / this.pagination.itemsPerPage)
},
orderByItems () {
return [
{ text: this.$t('tags:orderByField.creationDate'), value: 'createdAt' },
{ text: this.$t('tags:orderByField.ID'), value: 'id' },
{ text: this.$t('tags:orderByField.lastModified'), value: 'updatedAt' },
{ text: this.$t('tags:orderByField.path'), value: 'path' },
{ text: this.$t('tags:orderByField.title'), value: 'title' }
]
} }
}, },
watch: { watch: {
...@@ -243,7 +247,7 @@ export default { ...@@ -243,7 +247,7 @@ export default {
this.$store.commit('page/SET_MODE', 'tags') this.$store.commit('page/SET_MODE', 'tags')
this.locales = _.concat( this.locales = _.concat(
[{name: 'Any', code: 'any'}], [{name: this.$t('tags:localeAny'), code: 'any'}],
(siteLangs.length > 0 ? siteLangs : []) (siteLangs.length > 0 ? siteLangs : [])
) )
...@@ -257,7 +261,6 @@ export default { ...@@ -257,7 +261,6 @@ export default {
this.selection.push(tag) this.selection.push(tag)
} }
this.rebuildURL() this.rebuildURL()
console.info(this.$refs.dude)
}, },
isSelected (tag) { isSelected (tag) {
return _.includes(this.selection, tag) return _.includes(this.selection, tag)
......
...@@ -182,7 +182,7 @@ ...@@ -182,7 +182,7 @@
"@babel/preset-env": "^7.6.0", "@babel/preset-env": "^7.6.0",
"@mdi/font": "4.3.95", "@mdi/font": "4.3.95",
"@panter/vue-i18next": "0.15.1", "@panter/vue-i18next": "0.15.1",
"@requarks/ckeditor5": "12.4.0-wiki.11", "@requarks/ckeditor5": "12.4.0-wiki.14",
"@vue/babel-preset-app": "3.11.0", "@vue/babel-preset-app": "3.11.0",
"animate-sass": "0.8.2", "animate-sass": "0.8.2",
"animated-number-vue": "1.0.0", "animated-number-vue": "1.0.0",
......
This diff was suppressed by a .gitattributes entry.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment