cleaning export

This commit is contained in:
les
2020-11-13 00:13:44 +01:00
parent c41c930f70
commit 95e473d531
12 changed files with 134 additions and 112 deletions

View File

@@ -1,5 +1,5 @@
<template lang='pug'>
v-card(color='secondary')
v-card(:color='isDialog ? "secondary" : null')
v-card-title(v-text="$t('common.follow_me_title')")
v-card-text
p(v-html="$t('event.follow_me_description', { title: settings.title, account: `@${settings.instance_name}@${domain}`})")
@@ -22,9 +22,8 @@ import url from 'url'
export default {
name: 'FollowMe',
props: [
{ isDialog: { type: Boolean, default: false }}
],
props:
{ isDialog: { type: Boolean, default: false } },
data () {
return {
instance_hostname: '',

View File

@@ -3,11 +3,11 @@ div#list
p(v-if='title') {{title}}
v-timeline(dense)
v-timeline-item(
v-for='event in events'
v-for='event in computedEvents'
:key='`${event.id}_${event.start_datetime}`')
div {{event|when}}
a(:href='`/event/${event.id}`' target='_blank') {{event.title}}
small.float-right @{{event.place.name}}
.text-subtitle {{event|when}}
.text-subtitle.float-right @{{event.place.name}}
a.text-h5(:href='`/event/${event.id}`' target='_blank') {{event.title}}
</template>
<script>
@@ -44,6 +44,12 @@ export default {
type: Boolean,
default: true
}
},
computed: {
computedEvents () {
if (!this.maxEvents) { return this.events }
return this.events.slice(0, this.maxEvents)
}
}
}
</script>

View File

@@ -6,11 +6,6 @@
:label="$t('event.show_recurrent')"
@change="v => $emit('showrecurrent', v)")
v-switch.mt-0(
v-if='pastFilter' inset color='primary'
:label="$t('event.show_past')"
@change="v => $emit('showpast', v)")
v-autocomplete.mt-0(
:label='$t("common.search")'
:items='keywords'
@@ -36,7 +31,7 @@
</template>
<script>
import { mapState, mapActions } from 'vuex'
import { mapState } from 'vuex'
export default {
name: 'Search',
props: {
@@ -51,20 +46,20 @@ export default {
}
},
computed: {
...mapState(['tags', 'places', , 'settings']),
...mapState(['tags', 'places', 'settings']),
selectedFilters () {
const tags = this.tags.filter(t => this.filters.tags.includes(t.tag)).map(t => ({ type: 'tag', label: t.tag, weigth: t.weigth, id: t.tag }))
const places = this.places.filter(p => this.filters.places.includes(p.id))
.map(p => ({ type: 'place', label: p.name, weigth: p.weigth, id: p.id }))
const keywords = tags.concat(places).sort((a, b) => b.weigth - a.weigth)
return keywords
return keywords
},
keywords () {
const tags = this.tags.map(t => ({ type: 'tag', label: t.tag, weigth: t.weigth, id: t.tag }))
const places = this.places.map(p => ({ type: 'place', label: p.name, weigth: p.weigth, id: p.id }))
const keywords = tags.concat(places).sort((a, b) => b.weigth - a.weigth)
return keywords
},
}
},
methods: {
change (filters) {
@@ -73,7 +68,7 @@ export default {
places: filters.filter(p => p.type === 'place').map(p => p.id)
}
this.$emit('update', filters)
},
}
}
}
</script>