mirror of
https://framagit.org/les/gancio.git
synced 2025-02-01 00:52:01 +01:00
fix feed with filters
This commit is contained in:
parent
2018cc0e1e
commit
dc94f433b9
2 changed files with 20 additions and 4 deletions
|
@ -42,7 +42,7 @@
|
||||||
i.el-icon-switch-button
|
i.el-icon-switch-button
|
||||||
span {{$t('common.logout')}}
|
span {{$t('common.logout')}}
|
||||||
|
|
||||||
el-menu-item(type='text' v-clipboard:copy='`${settings.baseurl}/feed/rss`' v-clipboard:success='copyLink')
|
el-menu-item(type='text' v-clipboard:copy='feedLink' v-clipboard:success='copyLink')
|
||||||
v-icon(color='orange' name='rss')
|
v-icon(color='orange' name='rss')
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
@ -53,10 +53,26 @@ import { mapState } from 'vuex'
|
||||||
export default {
|
export default {
|
||||||
name: 'Nav',
|
name: 'Nav',
|
||||||
computed: {
|
computed: {
|
||||||
|
...mapState(['filters', 'settings']),
|
||||||
|
feedLink () {
|
||||||
|
const tags = this.filters.tags.join(',')
|
||||||
|
const places = this.filters.places.join(',')
|
||||||
|
let query = ''
|
||||||
|
if (tags || places) {
|
||||||
|
query = '?'
|
||||||
|
if (tags) {
|
||||||
|
query += 'tags=' + tags
|
||||||
|
if (places) { query += '&places=' + places }
|
||||||
|
} else {
|
||||||
|
query += 'places=' + places
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return `${this.settings.baseurl}/feed/rss${query}`
|
||||||
|
},
|
||||||
could_add () {
|
could_add () {
|
||||||
return (this.$auth.loggedIn || this.settings.allow_anon_event)
|
return (this.$auth.loggedIn || this.settings.allow_anon_event)
|
||||||
},
|
},
|
||||||
...mapState(['filters', 'settings'])
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
copyLink () {
|
copyLink () {
|
||||||
|
|
|
@ -99,8 +99,8 @@ export default {
|
||||||
return `<iframe style='border: 0px; width: 100%;' src="${this.settings.baseurl}/embed/list?${params.join('&')}"></iframe>`
|
return `<iframe style='border: 0px; width: 100%;' src="${this.settings.baseurl}/embed/list?${params.join('&')}"></iframe>`
|
||||||
},
|
},
|
||||||
link () {
|
link () {
|
||||||
const tags = this.filters.tags.map(t => t.id).join(',')
|
const tags = this.filters.tags.join(',')
|
||||||
const places = this.filters.places.map(p => p.id).join(',')
|
const places = this.filters.places.join(',')
|
||||||
let query = ''
|
let query = ''
|
||||||
if (tags || places) {
|
if (tags || places) {
|
||||||
query = '?'
|
query = '?'
|
||||||
|
|
Loading…
Reference in a new issue