v-container
v-card-title {{ $t('common.collections') }}
v-spacer
v-text-field(v-model='search'
:append-icon='mdiMagnify' outlined rounded
:label="$t('common.search')"
single-line hide-details)
v-card-subtitle(v-html="$t('admin.collections_description')")
v-btn(color='primary' text @click='newCollection') {{ $t('admin.new_collection') }}
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
v-form(v-model='valid' ref='form' @submit.prevent.native='saveCollection')
v-text-field(
v-if='!collection.id'
:rules="[$validators.required('common.name')]"
:label="$t('common.name')"
v-model='collection.name'
:placeholder='$t("common.name")')
template(v-slot:append-outer v-if='!collection.id')
v-btn(text @click='saveCollection' color='primary' :loading='loading'
:disabled='!valid || loading || !!collection.id') {{ $t('common.save') }}
h3(v-else class='text-h5' v-text='collection.name')
v-row
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"
chips small-chips multiple deletable-chips hide-no-data hide-selected persistent-hint
:disabled="!collection.id"
placeholder='All'
@input.native='searchTags'
@focus='searchTags'
:delimiters="[',', ';']"
:items="tags"
:label="$t('common.tags')")
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='filterPlaces'
cache-items
:prepend-inner-icon="mdiMapMarker"
chips small-chips multiple deletable-chips hide-no-data hide-selected persistent-hint
auto-select-first
clearable
return-object
item-text='name'
:disabled="!collection.id"
@input.native="searchPlaces"
@focus='searchPlaces'
:delimiters="[',', ';']"
:items="places"
:label="$t('common.places')")
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.name }}
//- template(v-slot:item="{ item, attrs, on }")
//- v-list-item(v-bind='attrs' v-on='on')
//- v-list-item-content(two-line)
//- v-list-item-title(v-text='item.name')
//- v-list-item-subtitle(v-text='item.address')
v-btn(color='primary' :loading='loading' text @click='addFilter' :disabled='loading || !collection.id || !filterPlaces.length && !filterTags.length') add
v-data-table(
:headers='filterHeaders'
:items='filters'
:hide-default-footer='filters.length < 5'
:header-props='{ sortIcon: mdiChevronDown }'
:footer-props='{ prevIcon: mdiChevronLeft, nextIcon: mdiChevronRight }')
template(v-slot:item.actions='{ item }')
v-btn(@click='removeFilter(item)' color='error' icon)
v-icon(v-text='mdiDeleteForever')
template(v-slot:item.tags='{ item }')
v-chip.ma-1(small label v-for='tag in item.tags' v-text='tag' :key='tag')
template(v-slot:item.places='{ item }')
v-chip.ma-1(small label v-for='place in item.places' v-text='place.name' :key='place.id' )
v-card-actions
v-spacer
v-btn(@click='dialog = false' outlined color='warning') {{ $t('common.close') }}
v-card-text
v-data-table(
:headers='collectionHeaders'
:items='collections'
:hide-default-footer='collections.length < 5'
:header-props='{ sortIcon: mdiChevronDown }'
:footer-props='{ prevIcon: mdiChevronLeft, nextIcon: mdiChevronRight }'
:search='search'
)
template(v-slot:item.filters='{ item }')
span {{ collectionFilters(item) }}
template(v-slot:item.pin='{ item }')
v-switch.float-right(:input-value='item.isTop' @change="togglePinCollection(item)" inset hide-details)
template(v-slot:item.actions='{ item }')
v-btn(@click='editCollection(item)' color='primary' icon)
v-icon(v-text='mdiPencil')
v-btn(@click='removeCollection(item)' color='error' icon)
v-icon(v-text='mdiDeleteForever')