Merge branch 'develop' of https://github.com/tainacan/tainacan into develop

This commit is contained in:
weryques 2018-05-14 15:06:14 -03:00
commit adfcd9a2e7
5 changed files with 57 additions and 24 deletions

View File

@ -15,13 +15,28 @@
:active.sync="isLoadingFilters"/>
<b-field class="margin-1">
<b-input
<div class="control is-small is-clearfix">
<input
class="input is-small"
:placeholder=" $i18n.get('instruction_search_collection') "
type="search"
size="is-small"
icon="magnify"
@input="updateSearch($event)"
:value="searchQuery"/>
autocomplete="on"
:value="searchQuery"
@input="futureSearchQuery = $event.target.value"
@keyup.enter="updateSearch()">
</div>
<p class="control">
<button
id="collection-search-button"
type="submit"
class="button"
@click="updateSearch()">
<b-icon
icon="magnify"
size="is-small"/>
</button>
</p>
</b-field>
<!-- <a class="is-size-7 is-secondary is-pulled-right">Busca avançada</a> -->
@ -85,7 +100,9 @@
:pref-table-fields="prefTableFields"
:is-on-theme="isOnTheme"/>
</div>
<div class="tabs">
<div
v-if="!isOnTheme"
class="tabs">
<ul>
<li
@click="onChangeTab('')"
@ -164,6 +181,7 @@
isFiltersMenuCompressed: false,
collapseAll: false,
isOnTheme: false,
futureSearchQuery: ''
}
},
props: {
@ -195,9 +213,9 @@
'getSearchQuery',
'getStatus'
]),
updateSearch(searchQuery) {
this.$eventBusSearch.setSearchQuery(searchQuery)
},
updateSearch() {
this.$eventBusSearch.setSearchQuery(this.futureSearchQuery);
},
onChangeTab(status) {
this.$eventBusSearch.setStatus(status);
}
@ -382,6 +400,14 @@
height: auto;
}
#collection-search-button {
border-radius: 0px !important;
padding: 0px 8px !important;
&:focus, &:active {
border-color: none !important;
}
}
.filters-menu {
position: relative;
width: $filter-menu-width;

View File

@ -167,23 +167,15 @@ a:hover {
}
}
.input, .textarea {
font-size: 14px;
border: none;
border-radius: 1px !important;
background-color: $tainacan-input-background;
color: $tainacan-input-color;
box-shadow: none;
transition: background-color 0.1s;
&.is-danger {
background-color: #e7dede;
}
&:focus, &:active {
box-shadow: none !important;
background-color: white;
border: 1px solid $tainacan-input-background !important;
}
}
.control{
&.has-content {
@ -280,6 +272,18 @@ a:hover {
line-height: 20px !important;
font-size: 14px !important;
}
.input, .textarea {
font-size: 14px;
border: none;
border-radius: 1px !important;
box-shadow: none !important;
&:focus, &:active {
box-shadow: none !important;
background-color: white;
border: 1px solid $tainacan-input-background !important;
}
}
.select {
padding-top: 0px !important;

View File

@ -125,7 +125,9 @@ export default {
line-height: 20px !important;
font-size: 14px !important;
}
#collection-search-button {
height: 25px !important;
}
.select {
padding-top: 0px !important;
select {

View File

@ -29,7 +29,7 @@ export default {
'$route' () {
if (this.$route.params.collectionId)
this.collectionId = parseInt(this.$route.params.collectionId);
if (this.$route.name == null || this.$route.name == undefined || this.$route.name == 'CollectionItemsPage' || this.$route.name == 'ItemsPage') {
if (this.$route.query.perpage == undefined)
this.$route.query.perpage = 12;
@ -39,10 +39,11 @@ export default {
this.$route.query.order = 'DESC';
if (this.$route.query.orderby == undefined)
this.$route.query.orderby = 'date';
this.$store.dispatch('search/set_postquery', this.$route.query);
this.loadItems();
}
}
},
methods: {
@ -103,14 +104,14 @@ export default {
this.updateURLQueries();
},
updateURLQueries() {
this.$router.push({ query: {} });
this.$router.push({ query: {}});
this.$router.push({ query: this.$store.getters['search/getPostQuery'] });
},
updateStoreFromURL() {
this.$store.dispatch('search/set_postquery', this.$route.query);
},
loadItems() {
this.$emit( 'isLoadingItems', true);
this.$store.dispatch('collection/fetchItems', this.collectionId).then((res) => {
this.$emit( 'isLoadingItems', false);

View File

@ -18,7 +18,7 @@ export const fetchItems = ({ rootGetters, dispatch, commit }, collectionId) => {
if (collectionId == undefined)
endpoint = '/items?context=edit&'
axios.tainacan.get(endpoint + qs.stringify(postQueries) )
.then(res => {
let items = res.data;