Merge conflict of unsaved file.

This commit is contained in:
Mateus Machado Luna 2018-04-10 16:38:50 -03:00
parent e71feba62a
commit dca4f63647
10 changed files with 158 additions and 98 deletions

View File

@ -59,7 +59,7 @@
.is-secondary-content {
padding: 0px;
margin: 78px auto 0 auto;
margin: $header-height auto 0 auto;
position: relative;
overflow-y: auto;
@ -68,6 +68,11 @@
overflow-y: visible;
}
}
.columns {
margin-left: 0px;
margin-right: 0px;
}
}
</style>

View File

@ -224,7 +224,7 @@ export default {
.catch((errors) => {
for (let error of errors.errors) {
for (let field of Object.keys(error)){
eventBus.errors.push({ field_id: attribute, errors: error[field]});
eventBus.errors.push({ field_id: field, errors: error[field]});
}
}
this.formErrorMessage = errors.error_message;

View File

@ -5,19 +5,17 @@
:class="{'secondary-page': onSecondaryPage}">
<div class="level-left">
<div class="level-item">
<h1 class="has-text-weight-bold is-uppercase has-text-tertiary"><b-icon
<h1 class="has-text-weight-bold is-uppercase"><b-icon
size="is-small"
:icon="currentIcon"/>{{ pageTitle }}</h1>
<nav class="breadcrumbs">
<router-link
class="has-text-tertiary"
tag="a"
:to="$routerHelper.getCollectionsPath()">{{ $i18n.get('repository') }}</router-link> >
<span
v-for="(pathItem, index) in arrayRealPath"
:key="index">
<router-link
class="has-text-tertiary"
tag="a"
:to="'/' + arrayRealPath.slice(0, index + 1).join('/')">
{{ arrayViewPath[index] }}
@ -28,11 +26,13 @@
</div>
</div>
<div class="level-right">
<a class="level-item">
<b-icon icon="magnify"/>
</a>
<a
class="level-item has-text-tertiary"
class="level-item"
:href="wordpressAdmin">
<b-icon
icon="wordpress"/>
<b-icon icon="wordpress"/>
</a>
</div>
</div>
@ -145,7 +145,7 @@ export default {
// Tainacan Header
#tainacan-header {
background-color: $primary;
background-color: $secondary;
height: $header-height;
max-height: $header-height;
width: 100%;
@ -156,6 +156,7 @@ export default {
right: 0;
position: absolute;
z-index: 9;
color: white;
.icon {
padding-right: 1.3em;
@ -174,7 +175,7 @@ export default {
}
&.secondary-page {
.level-item {
margin-left: 310px;
margin-left: 87px;
}
}

View File

@ -33,7 +33,9 @@
:aria-label="$i18n.get('label_collection_fields')">
<b-icon
size="is-small"
icon="file-multiple"/> <span class="menu-text">{{ $i18n.getFrom('items', 'name') }}</span>
icon="file-multiple"/>
<br>
<span class="menu-text">{{ $i18n.getFrom('items', 'name') }}</span>
</router-link></li>
<li class="level-item"><router-link
tag="a"
@ -42,7 +44,9 @@
:aria-label="$i18n.getFrom('collections','edit_item')">
<b-icon
size="is-small"
icon="pencil"/> <span class="menu-text">{{ $i18n.get('edit') }}</span>
icon="pencil"/>
<br>
<span class="menu-text">{{ $i18n.get('edit') }}</span>
</router-link></li>
<li class="level-item"><router-link
tag="a"
@ -51,7 +55,9 @@
:aria-label="$i18n.get('label_collection_fields')">
<b-icon
size="is-small"
icon="format-list-checks"/> <span class="menu-text">{{ $i18n.getFrom('fields', 'name') }}</span>
icon="format-list-checks"/>
<br>
<span class="menu-text">{{ $i18n.getFrom('fields', 'name') }}</span>
</router-link></li>
<li class="level-item"><router-link
tag="a"
@ -60,7 +66,9 @@
:aria-label="$i18n.get('label_collection_filters')">
<b-icon
size="is-small"
icon="filter"/> <span class="menu-text">{{ $i18n.getFrom('filters', 'name') }}</span>
icon="filter"/>
<br>
<span class="menu-text">{{ $i18n.getFrom('filters', 'name') }}</span>
</router-link></li>
</ul>
@ -82,14 +90,23 @@ export default {
currentIcon: ''
}
},
props: {
id: Number
},
watch: {
'$route' (to) {
this.activeRoute = to.name;
this.onSecondaryPage = (to.params.collectionId != undefined);
this.pageTitle = this.$route.meta.title;
this.currentIcon = this.$route.meta.icon;
this.arrayRealPath = to.path.split("/");
this.arrayRealPath = this.arrayRealPath.filter((item) => item.length != 0);
this.generateViewPath();
}
},
created () {
this.activeRoute = this.$route.name;
},
methods: {
...mapActions('collection', [
'fetchCollectionName'
@ -150,19 +167,9 @@ export default {
}
}
},
watch: {
'$route' (to) {
this.onSecondaryPage = (to.params.collectionId != undefined);
this.pageTitle = this.$route.meta.title;
this.currentIcon = this.$route.meta.icon;
this.arrayRealPath = to.path.split("/");
this.arrayRealPath = this.arrayRealPath.filter((item) => item.length != 0);
this.generateViewPath();
}
},
created() {
this.activeRoute = this.$route.name;
this.onSecondaryPage = (this.$route.params.collectionId != undefined);
this.pageTitle = this.$route.meta.title;
this.currentIcon = this.$route.meta.icon;
@ -180,17 +187,17 @@ export default {
@import "../../scss/_variables.scss";
// Tainacan Header
#tainacan-header {
#tainacan-subheader {
background-color: $primary-lighter;
height: $header-height;
max-height: $header-height;
height: $subheader-height;
max-height: $subheader-height;
width: 100%;
border-bottom: 0.5px solid #ddd;
padding: 1.0em;
margin: 0px;
vertical-align: middle;
left: 0;
right: 0;
position: absolute;
z-index: 9;
.icon {
@ -205,12 +212,57 @@ export default {
.level-left {
.level-item {
display: inline-block;
margin-left: 268px;
margin-left: 45px;
}
}
&.secondary-page {
.level-item {
margin-left: 310px;
li{
a {
color: $secondary;
text-align: center;
white-space: nowrap;
overflow: hidden;
padding: 1.0em 1.8em;
line-height: 1.5em;
border-radius: 0px;
-webkit-transition: padding 0.3s linear; /* Safari */
transition: padding 0.3s linear;
}
a:hover {
background-color: rgba(255,255,255,0.4);
color: $tertiary;
}
a.is-active {
background-color: rgba(255,255,255,0.6);
color: $tertiary;
}
.icon {
margin: 0;
padding: 0;
}
.menu-text {
opacity: 1;
visibility: visible;
transition: opacity 0.3s linear, visibility 0.3s linear;
-webkit-transition: opacity 0.3s linear, visibility 0.3s linear;
}
}
@media screen and (max-width: 769px) {
width: 100% !important;
max-width: 100% !important;
ul {
flex-flow: wrap;
display: flex;
align-items: stretch;
justify-content: space-evenly;
a {
padding: 0.5em 0.7em !important;
text-align: center;
}
.menu-text {
padding-left: 0.3em !important;
}
}
}
@ -221,14 +273,7 @@ export default {
margin-left: 30px;
}
}
.level-right {
display: none;
}
top: 206px;
&.secondary-page {
top: 237px !important;
}
margin-bottom: 0px !important;
}

View File

@ -15,7 +15,7 @@
custom>
<b-checkbox
v-model="column.visible"
:native-value="column.slug">
:native-value="column.field">
{{ column.name }}
</b-checkbox>
</b-dropdown-item>

View File

@ -20,21 +20,21 @@
:table-fields="tableFields"
:pref-table-fields="prefTableFields"/>
</div>
<div class="columns above-subheader">
<aside
class="column filters-menu"
v-if="items.length > 0">
<div class="columns">
<aside class="column filters-menu">
<h3>{{ $i18n.get('filters') }}</h3>
<filters-items-list />
</aside>
<div class="column table-container">
<items-list
:collection-id="collectionId"
:table-fields="tableFields"
:items="items"
:is-loading="isLoading"/>
<!-- Pagination Footer -->
<pagination v-if="items.length > 0"/>
<div class="column">
<div class="table-container above-subheader">
<items-list
:collection-id="collectionId"
:table-fields="tableFields"
:items="items"
:is-loading="isLoading"/>
<!-- Pagination Footer -->
<pagination v-if="items.length > 0"/>
</div>
</div>
</div>
</div>
@ -121,9 +121,14 @@ export default {
@import '../../scss/_variables.scss';
.page-container-small>.columns {
margin-top: 0;
}
.sub-header {
max-height: $header-height;
height: $header-height;
max-height: $subheader-height;
height: $subheader-height;
margin-left: -$page-small-side-padding;
margin-right: -$page-small-side-padding;
margin-top: -$page-small-top-padding;
@ -147,35 +152,35 @@ export default {
margin-bottom: 0;
margin-top: 0;
min-height: 100%;
height: auto;
height: auto;
}
.filters-menu {
min-width: $side-menu-width;
max-width: $side-menu-width;
background-color: $primary-lighter;
margin-left: -$page-small-side-padding;
padding: $page-small-side-padding;
.label {
font-size: 12px;
font-weight: normal;
}
.filters-menu {
min-width: $side-menu-width;
max-width: $side-menu-width;
background-color: $tainacan-input-color;
margin-left: -$page-small-side-padding;
padding: $page-small-side-padding;
.label {
font-size: 12px;
font-weight: normal;
}
}
.table-container {
margin-right: -$page-small-side-padding;
padding: 3em 2.5em;
}
@media screen and (max-width: 769px) {
.filters-menu {
display: none;
}
.table-container {
margin-right: -$page-small-side-padding;
padding: 3em 2.5em;
}
@media screen and (max-width: 769px) {
.filters-menu {
display: none;
}
.table-container {
margin-right: 0;
padding: .85em 0em;
}
margin-right: 0;
padding: .85em 0em;
}
}

View File

@ -1,14 +1,14 @@
<template>
<div class="columns is-fullheight">
<secondary-menu :id="collectionId"/>
<section class="column is-secondary-content">
<tainacan-subheader :id="collectionId"/>
<router-view class="page-container"/>
</section>
</div>
</template>
<script>
import SecondaryMenu from '../../components/navigation/secondary-menu.vue';
import TainacanSubheader from '../../components/navigation/tainacan-subheader.vue';
export default {
name: 'CollectionPage',
@ -18,7 +18,7 @@ export default {
}
},
components: {
SecondaryMenu
TainacanSubheader
},
created(){
this.collectionId = parseInt(this.$route.params.collectionId);

View File

@ -53,9 +53,10 @@ $colors: map-merge($colors, $addColors);
$size-small: 0.85em; // 0.75em on Bulma.
// Tainacan Header and side menus
$header-height: 78px;
$header-height: 58px;
$subheader-height: 78px;
$side-menu-width: 222px;
$page-height: calc(100% - 78px);
$page-height: calc(100% - 58px);
// Overall Pages padding:
$page-side-padding: 4em;

View File

@ -96,7 +96,9 @@ class TAINACAN_REST_Controller extends WP_REST_Controller {
'perpage' => 'posts_per_page',
'paged' => 'paged',
'postin' => 'post__in',
'relation' => 'relation'
'relation' => 'relation',
'meta_key' => 'meta_key',
'meta_type' => 'meta_type'
];
$meta_query = [
@ -380,6 +382,8 @@ class TAINACAN_REST_Controller extends WP_REST_Controller {
'slug',
'include_slugs',
'title',
'meta_value',
'meta_value_num'
),
);

View File

@ -35,18 +35,17 @@ export const setItemsPerPage = ({ commit }, page ) => {
// Sorting queries
export const setOrderBy = ({ commit }, orderBy ) => {
if (orderBy.field_type == 'Tainacan\\Field_Types\\Numeric') {
commit('addMetaQuery', {
field_id: orderBy.id
});
// Primitive Types: string, date, item, term, compound
if (orderBy.field_type_object.primitive_type == 'float' || orderBy.field_type_object.primitive_type == 'int') {
commit('setPostQueryAttribute', { attr: 'meta_key', value: orderBy.id } );
commit('setPostQueryAttribute', { attr: 'orderby', value: 'meta_value_num' } );
} else if (orderBy.field_type == orderBy.field_type_object.core) {
} else if (orderBy.field_type_object.primitive_type == 'date') {
commit('setPostQueryAttribute', { attr: 'meta_key', value: orderBy.id } );
commit('setPostQueryAttribute', { attr: 'meta_type', value: 'DATETIME' } );
commit('setPostQueryAttribute', { attr: 'orderby', value: 'meta_value' } );
} else if (orderBy.field_type_object.core) {
commit('setPostQueryAttribute', { attr: 'orderby', value: orderBy.field_type_object.related_mapped_prop } );
} else {
commit('addMetaQuery', {
field_id: orderBy.id
});
commit('setPostQueryAttribute', { attr: 'meta_key', value: orderBy.id } );
commit('setPostQueryAttribute', { attr: 'orderby', value: 'meta_value' } );
}