Adds collapse on filters sidebar

This commit is contained in:
weryques 2018-04-30 17:58:43 -03:00
parent fc1daab3dd
commit 5cd0d6ec17
6 changed files with 2471 additions and 2438 deletions

4806
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,10 @@
<button <button
v-if="selectedCollections.length > 0" v-if="selectedCollections.length > 0"
class="button field is-danger" class="button field is-danger"
@click="deleteSelectedCollections()"><span>{{ $i18n.get('instruction_delete_selected_collections') }} </span><b-icon icon="delete"/></button> @click="deleteSelectedCollections()">
<span>{{ $i18n.get('instruction_delete_selected_collections') }} </span>
<b-icon icon="delete"/>
</button>
</b-field> </b-field>
<b-table <b-table
v-if="totalCollections > 0" v-if="totalCollections > 0"

View File

@ -26,7 +26,9 @@
</b-dropdown-item> </b-dropdown-item>
<b-dropdown-item>{{ $i18n.get('add_items_bulk') }} <b-dropdown-item>{{ $i18n.get('add_items_bulk') }}
</b-dropdown-item> </b-dropdown-item>
<b-dropdown-item>{{ $i18n.get('add_items_external_source') }}<br><small class="is-small">{{ $i18n.get() }}</small></b-dropdown-item> <b-dropdown-item>{{ $i18n.get('add_items_external_source') }}<br>
<small class="is-small">{{ $i18n.get() }}</small>
</b-dropdown-item>
</b-dropdown> </b-dropdown>
</div> </div>
@ -42,29 +44,46 @@
<b-loading <b-loading
:is-full-page="false" :is-full-page="false"
:active.sync="isLoadingFilters"/> :active.sync="isLoadingFilters"/>
<h3>{{ $i18n.get('filters') }}</h3>
<filters-items-list <h3 class="has-text-weight-semibold">
v-if="!isLoadingFilters && filters.length > 0" {{ $i18n.get('filters') }}
:filters="filters"/> </h3>
<section <b-collapse :open="false">
v-else <p
class="is-grouped-centered section"> slot="trigger"
<div class="content has-text-gray has-text-centered"> class="is-small is-size-7 has-text-primary">
<p> {{ $i18n.get('expand_all') }}
<b-icon <b-icon
icon="filter-outline" icon="menu-down"
size="is-large"/> size="is-small" />
</p> </p>
<p>{{ $i18n.get('info_there_is_no_filter' ) }}</p>
<router-link <br>
id="button-create-filter"
:to="isRepositoryLevel ? $routerHelper.getNewFilterPath() : $routerHelper.getNewCollectionFilterPath(collectionId)" <filters-items-list
tag="button" v-if="!isLoadingFilters && filters.length > 0"
class="button is-secondary is-centered"> :filters="filters"/>
{{ $i18n.getFrom('filters', 'new_item') }}
</router-link> <section
</div> v-else
</section> class="is-grouped-centered section">
<div class="content has-text-gray has-text-centered">
<p>
<b-icon
icon="filter-outline"
size="is-large"/>
</p>
<p>{{ $i18n.get('info_there_is_no_filter' ) }}</p>
<router-link
id="button-create-filter"
:to="isRepositoryLevel ? $routerHelper.getNewFilterPath() : $routerHelper.getNewCollectionFilterPath(collectionId)"
tag="button"
class="button is-secondary is-centered">
{{ $i18n.getFrom('filters', 'new_item') }}
</router-link>
</div>
</section>
</b-collapse>
</aside> </aside>
<div class="column"> <div class="column">
<div class="table-container above-subheader"> <div class="table-container above-subheader">

View File

@ -38,6 +38,7 @@ return [
'add_one_item' => __( 'Add one item', 'tainacan' ), 'add_one_item' => __( 'Add one item', 'tainacan' ),
'add_items_bulk' => __( 'Add items in bulk', 'tainacan' ), 'add_items_bulk' => __( 'Add items in bulk', 'tainacan' ),
'add_items_external_source' => __( 'Add items from an external source', 'tainacan' ), 'add_items_external_source' => __( 'Add items from an external source', 'tainacan' ),
'expand_all' => __( 'Expand all', 'tainacan' ),
// Wordpress Status // Wordpress Status
'publish' => __( 'Publish', 'tainacan' ), 'publish' => __( 'Publish', 'tainacan' ),

View File

@ -5,6 +5,7 @@
size="is-small" size="is-small"
v-model="date_init" v-model="date_init"
@input="validate_values()" @input="validate_values()"
:readonly="false"
icon="calendar-today"/> icon="calendar-today"/>
<br> <br>
<b-datepicker <b-datepicker
@ -12,6 +13,7 @@
v-model="date_end" v-model="date_end"
@input="validate_values()" @input="validate_values()"
@focus="isTouched = true" @focus="isTouched = true"
:readonly="false"
icon="calendar-today"/> icon="calendar-today"/>
<br> <br>
</div> </div>

View File

@ -1,16 +1,24 @@
<template> <template>
<b-field <b-field
:label="filter.name"
:message="getErrorMessage" :message="getErrorMessage"
:type="filterTypeMessage"> :type="filterTypeMessage">
<div> <b-collapse :open="false">
<component <label slot="trigger">
:id="filter.filter_type_object.component + '-' + filter.slug" <b-icon
:is="filter.filter_type_object.component" icon="menu-down"
:filter="filter" size="is-small" />
:query="query" {{ filter.name }}
@input="listen( $event )"/> </label>
</div>
<div>
<component
:id="filter.filter_type_object.component + '-' + filter.slug"
:is="filter.filter_type_object.component"
:filter="filter"
:query="query"
@input="listen( $event )"/>
</div>
</b-collapse>
</b-field> </b-field>
</template> </template>