mirror of
https://framagit.org/les/gancio.git
synced 2025-02-01 00:52:01 +01:00
feat(fedi/collections): add instances as potential filter in collections
This commit is contained in:
parent
07fcbbd4ce
commit
7a6101be7b
1 changed files with 30 additions and 7 deletions
|
@ -10,7 +10,7 @@ v-container
|
|||
|
||||
v-btn(color='primary' text @click='newCollection') <v-icon v-text='mdiPlus'></v-icon> {{ $t('admin.new_collection') }}
|
||||
|
||||
v-dialog(v-model='dialog' width='800' destroy-on-close :fullscreen='$vuetify.breakpoint.xsOnly')
|
||||
v-dialog(v-model='dialog' width='900' destroy-on-close :fullscreen='$vuetify.breakpoint.xsOnly')
|
||||
v-card
|
||||
v-card-title {{ $t('admin.edit_collection') }}
|
||||
v-card-text
|
||||
|
@ -27,7 +27,25 @@ v-container
|
|||
h3(v-else class='text-h5' v-text='collection.name')
|
||||
|
||||
v-row
|
||||
v-col(cols=5)
|
||||
v-col(cols=4)
|
||||
v-autocomplete(v-model='filterActors'
|
||||
cache-items
|
||||
:prepend-icon="mdiTagMultiple"
|
||||
chips small-chips multiple deletable-chips hide-no-data hide-selected persistent-hint
|
||||
:disabled="!collection.id"
|
||||
placeholder='Local'
|
||||
@input.native='searchActors'
|
||||
@focus='searchActors'
|
||||
item-text='ap_id'
|
||||
item-value='ap_id'
|
||||
:delimiters="[',', ';']"
|
||||
:items="actors"
|
||||
:label="$t('common.actors')")
|
||||
template(v-slot:selection="{ item, on, attrs, selected, parent }")
|
||||
v-chip(v-bind="attrs" close :close-icon='mdiCloseCircle' @click:close='parent.selectItem(item)'
|
||||
:input-value="selected" label small) {{ item }}
|
||||
|
||||
v-col(cols=4)
|
||||
v-autocomplete(v-model='filterTags'
|
||||
cache-items
|
||||
:prepend-inner-icon="mdiTagMultiple"
|
||||
|
@ -43,7 +61,7 @@ v-container
|
|||
v-chip(v-bind="attrs" close :close-icon='mdiCloseCircle' @click:close='parent.selectItem(item)'
|
||||
:input-value="selected" label small) {{ item }}
|
||||
|
||||
v-col(cols=5)
|
||||
v-col(cols=4)
|
||||
v-autocomplete(v-model='filterPlaces'
|
||||
cache-items
|
||||
:prepend-inner-icon="mdiMapMarker"
|
||||
|
@ -68,7 +86,6 @@ v-container
|
|||
//- v-list-item-title(v-text='item.name')
|
||||
//- v-list-item-subtitle(v-text='item.address')
|
||||
|
||||
v-col(cols=2)
|
||||
v-btn(color='primary' :loading='loading' text @click='addFilter' :disabled='loading || !collection.id || !filterPlaces.length && !filterTags.length') add <v-icon v-text='mdiPlus'></v-icon>
|
||||
|
||||
v-data-table(
|
||||
|
@ -129,6 +146,8 @@ export default {
|
|||
collection: { name: '', id: null },
|
||||
filterTags: [],
|
||||
filterPlaces: [],
|
||||
filterActors: [],
|
||||
actors: [],
|
||||
tags: [],
|
||||
places: [],
|
||||
collections: [],
|
||||
|
@ -142,6 +161,7 @@ export default {
|
|||
{ value: 'actions', text: this.$t('common.actions'), align: 'right', width: 150 }
|
||||
],
|
||||
filterHeaders: [
|
||||
{ value: 'actors', text: this.$t('common.actors') },
|
||||
{ value: 'tags', text: this.$t('common.tags') },
|
||||
{ value: 'places', text: this.$t('common.places') },
|
||||
{ value: 'actions', text: this.$t('common.actions'), align: 'right' }
|
||||
|
@ -159,6 +179,9 @@ export default {
|
|||
searchPlaces: debounce(async function (ev) {
|
||||
this.places = await this.$axios.$get(`/place?search=${ev.target.value}`)
|
||||
}, 100),
|
||||
searchActors: debounce(async function (ev) {
|
||||
this.actors = await this.$axios.$get(`/instances/friendly?search=${ev.target.value}`)
|
||||
}, 100),
|
||||
collectionFilters(collection) {
|
||||
return collection.filters.map(f => {
|
||||
const tags = f.tags?.join(', ')
|
||||
|
|
Loading…
Reference in a new issue