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

This commit is contained in:
weryques 2018-05-02 14:11:25 -03:00
commit 14b51ed6f8
9 changed files with 684 additions and 647 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
<template>
<div class="page-container">
<div>
<div class="tainacan-page-title">
<h2>{{ $i18n.get('title_item_edition') }}</h2>
<a
@ -15,8 +15,50 @@
label-width="120px">
<div class="columns">
<div class="column is-4">
<!-- Status -------------------------------- -->
<label class="section-label">{{ $i18n.get('label_status') }}</label>
<span class="required-field-asterisk">*</span>
<help-button
:title="$i18n.getHelperTitle('items', 'status')"
:message="$i18n.getHelperMessage('items', 'status')"/>
<div class="document-box">
<div class="field">
<b-select
v-model="form.status"
:placeholder="$i18n.get('instruction_select_a_status')">
<option
:id="`status-option-${statusOption.value}`"
v-for="statusOption in statusOptions"
:key="statusOption.value"
:value="statusOption.value"
:disabled="statusOption.disabled">{{ statusOption.label }}
</option>
</b-select>
<p
v-if="item.status == 'auto-draft'"
class="help is-danger">
{{ $i18n.get('info_item_not_saved') }}
</p>
</div>
<div class="field is-grouped">
<div class="control">
<button
id="button-submit-item-creation"
@click.prevent="onSubmit"
class="button is-success">
{{ $i18n.get('save') }}
</button>
</div>
</div>
<p class="help is-danger">{{ formErrorMessage }}</p>
</div>
<!-- Document -------------------------------- -->
<label class="section-label">{{ form.document != undefined && form.document != null && form.document != '' ? $i18n.get('label_document') : $i18n.get('label_document_empty') }}</label>
<help-button
:title="$i18n.getHelperTitle('items', 'document')"
:message="$i18n.getHelperMessage('items', 'document')"/>
<div class="document-box">
<div
v-if="form.document != undefined && form.document != null &&
@ -160,6 +202,9 @@
<!-- Thumbnail -------------------------------- -->
<label class="section-label">{{ $i18n.get('label_thumbnail') }}</label>
<help-button
:title="$i18n.getHelperTitle('items', 'featured_img_id')"
:message="$i18n.getHelperMessage('items', 'featured_img_id')"/>
<div class="document-box">
<div class="thumbnail-field">
<a
@ -223,54 +268,15 @@
:icon=" collapseAll ? 'menu-down' : 'menu-right'" />
</a>
<!-- Status -------------------------------- -->
<b-field
:addons="false"
:label="$i18n.get('label_status')">
<help-button
:title="$i18n.getHelperTitle('items', 'status')"
:message="$i18n.getHelperMessage('items', 'status')"/>
<b-select
id="status-select"
v-model="form.status"
:placeholder="$i18n.get('instruction_select_a_status')">
<option
:id="`status-option-${statusOption.value}`"
v-for="statusOption in statusOptions"
:key="statusOption.value"
:value="statusOption.value"
:disabled="statusOption.disabled">{{ statusOption.label }}
</option>
</b-select>
</b-field>
<!-- Fields from Collection-------------------------------- -->
<tainacan-form-item
v-for="(field, index) in fieldList"
v-for="(field, index) of fieldList"
:key="index"
:field="field"
:is-collapsed="!fieldCollapses[index]" />
</div>
</div>
<div class="field is-grouped form-submit">
<div class="control">
<button
id="button-cancel-item-creation"
class="button is-outlined"
type="button"
@click="cancelBack">{{ $i18n.get('cancel') }}</button>
</div>
<div class="control">
<button
id="button-submit-item-creation"
@click.prevent="onSubmit"
class="button is-success"
>{{ $i18n.get('save') }}</button>
</div>
</div>
<p class="help is-danger">{{ formErrorMessage }}</p>
</form>
<b-loading
@ -341,7 +347,6 @@ export default {
]),
...mapGetters('item',[
'getFields',
'getItem',
'getAttachments'
]),
onSubmit() {
@ -394,7 +399,7 @@ export default {
this.form.document_type = this.item.document_type;
this.loadMetadata();
})
.catch(error => this.$console.error(error));
},
@ -443,9 +448,6 @@ export default {
this.form.document = '';
this.updateItemDocument({ item_id: this.itemId, document: this.form.document, document_type: this.form.document_type });
},
cancelBack(){
this.$router.push(this.$routerHelper.getCollectionPath(this.collectionId));
},
deleteThumbnail() {
this.updateThumbnail({itemId: this.itemId, thumbnailId: 0})
.then(() => {
@ -512,7 +514,7 @@ export default {
},
computed: {
fieldList() {
return this.getFields();
return JSON.parse(JSON.stringify(this.getFields()));
},
attachmentsList(){
return this.getAttachments();

View File

@ -1,6 +1,7 @@
<template>
<div>
<tainacan-filter-item
<tainacan-filter-item
v-show="!isMenuCompressed"
:query="getQuery"
v-for="(filter, index) in filters"
:key="index"

View File

@ -2,7 +2,14 @@
<div :class="{'primary-page': isRepositoryLevel, 'page-container': isRepositoryLevel, 'page-container-small' :!isRepositoryLevel }">
<!-- SEARCH AND FILTERS --------------------- -->
<aside class="filters-menu">
<button
id="filter-menu-compress-button"
@click="isFiltersMenuCompressed = !isFiltersMenuCompressed">
<b-icon :icon="isFiltersMenuCompressed ? 'menu-right' : 'menu-left'" />
</button>
<aside
v-show="!isFiltersMenuCompressed"
class="filters-menu">
<b-loading
:is-full-page="false"
:active.sync="isLoadingFilters"/>
@ -31,7 +38,9 @@
</section>
</aside>
<div class="to-right">
<div
class="items-list-area"
:class="{ 'spaced-to-right': !isFiltersMenuCompressed }">
<!-- SEARCH CONTROL ------------------------- -->
<div class="sub-header">
<b-loading
@ -102,7 +111,8 @@
isLoadingItems: false,
isLoadingFilters: false,
isLoadingFields: false,
hasFiltered: false
hasFiltered: false,
isFiltersMenuCompressed: false
}
},
props: {
@ -293,6 +303,9 @@
height: 100%;
max-height: 100%;
overflow-y: auto;
visibility: visible;
display: block;
transition: visibility 0.5s ease, display 0.5s ease;
.label {
font-size: 12px;
@ -301,7 +314,11 @@
}
.to-right{
.items-list-area {
margin-left: 0;
transition: margin-left 0.5s ease;
}
.spaced-to-right {
margin-left: $filter-menu-width;
}
@ -320,6 +337,26 @@
}
}
#filter-menu-compress-button {
position: absolute;
z-index: 9;
top: 152px;
left: 0px;
max-width: 23px;
height: 21px;
width: 23px;
border: none;
background-color: $primary-light;
color: $tertiary;
padding: 0px;
border-top-right-radius: 2px;
border-bottom-right-radius: 2px;
.icon {
margin-top: -1px;
}
}
</style>

View File

@ -4,7 +4,7 @@
<tainacan-subheader :id="collectionId"/>
<router-view
:collection-id="collectionId"
class="page-container"/>
class="page-container page-container-small"/>
</section>
</div>
</template>

View File

@ -64,15 +64,18 @@ html {
}
}
.page-container-small{
padding: $page-small-top-padding $page-small-side-padding;
height: calc(100% - 82px);
overflow-y: auto;
}
.page-container-narrow{
padding: $page-small-top-padding $page-small-side-padding;
@media screen and (max-width: 769px) {
padding: $page-mobile-top-padding $page-mobile-side-padding;
}
}
.tainacan-page-title, .tainacan-modal-title {
h1, h2 {
font-size: 20px;
@ -140,6 +143,9 @@ html {
.button.is-outlined {
color: $tertiary;
}
&.has-only-save {
justify-content: end !important;
}
}
.label {
font-weight: normal;
@ -377,6 +383,9 @@ html {
.wp-core-ui {
a:focus{ box-shadow: none; }
}
.media-modal-backdrop {
z-index: 9999999 !important;
}
.media-modal {
left: 100px;
top: 100px;
@ -384,122 +393,127 @@ html {
right: 100px;
background-color: white;
z-index: 99999999999 !important;
.media-modal-content {
background-color: white;
margin: 42px 60px;
box-shadow: none;
}
.media-frame-title {
border-bottom: 1px solid #298596 !important;
margin-bottom: 60px !important;
box-shadow: none !important;
h1, h2 {
font-size: 20px;
font-weight: 500;
color: $tertiary;
display: inline-block;
margin-bottom: 3px;
}
}
.media-frame-router {
margin-top: 28px;
a.media-menu-item.active {
border-top: none;
border-left: none;
border-right: none;
border-bottom: 3px solid $primary;
}
}
.media-frame-content {
margin-top: 30px;
.attachments-browser .attachments, .media-toolbar {
padding: 12px;
right: 270px;
.media-toolbar-primary {
max-width: 30%;
}
.media-toolbar-secondary {
max-width: 70%;
}
.attachment {
padding: 12px;
}
.attachment.details {
box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 14px $primary-light;
}
.attachment.details .check, .wp-core-ui .attachment.selected .check:focus, .wp-core-ui .media-frame.mode-grid .attachment.selected .check {
background-color: $primary-light;
box-shadow: 0 0 0 1px #fff,0 0 0 2px $primary-light;
}
}
.media-sidebar {
background-color: white;
width: 238px;
}
.crop-content{
.imgareaselect-outer {
background-color: white;
opacity: 0.6;
}
}
}
.media-frame-toolbar .media-toolbar {
bottom: initial;
margin-top: -1px;
padding: 28px 0px;
}
.media-button.button-primary {
background-color: $success;
border: none;
box-shadow: none;
color: #fff;
text-decoration: none;
text-shadow: none;
}
.media-button.button-primary[disabled] {
color: #66c6e4 !important;
background: $success !important;
border-color: none!important;
box-shadow: none !important;
text-shadow: none !important;
cursor: default;
}
.media-button.button-secondary {
color: $tertiary;
border-color: #999;
background: white;
box-shadow: none;
vertical-align: middle;
}
.button-hero {
background-color: $secondary;
border: none;
box-shadow: none;
color: #fff;
text-decoration: none;
text-shadow: none;
font-size: 14px;
height: 46px;
line-height: 20px !important;
padding: 0 36px;
&:hover{
background-color: #339daf;
color: white;
}
}
}
.media-modal-backdrop {
z-index: 9999999 !important;
}
// .media-modal {
// left: 100px;
// top: 100px;
// bottom: 100px;
// right: 100px;
// background-color: white;
// z-index: 99999999999 !important;
// .media-modal-content {
// background-color: white;
// margin: 42px 60px;
// box-shadow: none;
// }
// .media-frame-title {
// border-bottom: 1px solid #298596 !important;
// margin-bottom: 60px !important;
// box-shadow: none !important;
// h1, h2 {
// font-size: 20px;
// font-weight: 500;
// color: $tertiary;
// display: inline-block;
// margin-bottom: 3px;
// }
// }
// .media-frame-router {
// margin-top: 28px;
// a.media-menu-item.active {
// border-top: none;
// border-left: none;
// border-right: none;
// border-bottom: 3px solid $primary;
// }
// }
// .media-frame-content {
// margin-top: 30px;
// .attachments-browser .attachments, .media-toolbar {
// padding: 12px;
// right: 270px;
// .media-toolbar-primary {
// max-width: 30%;
// }
// .media-toolbar-secondary {
// max-width: 70%;
// }
// .attachment {
// padding: 12px;
// }
// .attachment.details {
// box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 14px $primary-light;
// }
// .attachment.details .check, .wp-core-ui .attachment.selected .check:focus, .wp-core-ui .media-frame.mode-grid .attachment.selected .check {
// background-color: $primary-light;
// box-shadow: 0 0 0 1px #fff,0 0 0 2px $primary-light;
// }
// }
// .media-sidebar {
// background-color: white;
// width: 238px;
// }
// .crop-content{
// .imgareaselect-outer {
// background-color: white;
// opacity: 0.6;
// }
// }
// }
// .media-frame-toolbar .media-toolbar {
// bottom: initial;
// margin-top: -1px;
// padding: 28px 0px;
// }
// .media-button.button-primary {
// background-color: $success;
// border: none;
// box-shadow: none;
// color: #fff;
// text-decoration: none;
// text-shadow: none;
// }
// .media-button.button-primary[disabled] {
// color: #66c6e4 !important;
// background: $success !important;
// border-color: none!important;
// box-shadow: none !important;
// text-shadow: none !important;
// cursor: default;
// }
// .media-button.button-secondary {
// color: $tertiary;
// border-color: #999;
// background: white;
// box-shadow: none;
// vertical-align: middle;
// }
// .button-hero {
// background-color: $secondary;
// border: none;
// box-shadow: none;
// color: #fff;
// text-decoration: none;
// text-shadow: none;
// font-size: 14px;
// height: 46px;
// line-height: 20px !important;
// padding: 0 36px;
// &:hover{
// background-color: #339daf;
// color: white;
// }
// }
// }

View File

@ -200,6 +200,7 @@ return [
'info_no_page_found' => __( 'No page was found with this name.', 'tainacan' ),
'info_no_user_found' => __( 'No user was found with this name.', 'tainacan' ),
'info_no_item_found' => __( 'No item was found here with these filters.', 'tainacan' ),
'info_item_not_saved' => __( 'Warning: Item not saved.', 'tainacan' ),
'info_no_moderator_on_collection' => __( "This collection doesn't have any moderator yet.", 'tainacan' ),
'info_error_deleting_collection' => __( 'Error on deleting collection.', 'tainacan' ),
'info_error_deleting_category' => __( 'Error on deleting category', 'tainacan' ),

View File

@ -97,12 +97,12 @@ export const deleteField = ({commit}, {collectionId, fieldId, isRepositoryLevel}
});
};
export const updateCollectionFieldsOrder = ({commit, dispatch}, {collectionId, fieldsOrder}) => {
export const updateCollectionFieldsOrder = ({ dispatch }, {collectionId, fieldsOrder}) => {
return new Promise((resolve, reject) => {
axios.tainacan.patch('/collections/' + collectionId, {
fields_order: fieldsOrder
}).then(res => {
// dispatch('collection/setCollection', res.data, {root: true});
//dispatch('collection/setCollection', res.data, {root: true});
resolve(res.data);
}).catch(error => {
reject(error.response);

View File

@ -89,7 +89,7 @@ export const sendItem = ( { commit }, { collection_id, status }) => {
status: status
})
.then( res => {
commit('setItem', { collection_id: collection_id, status: status });
commit('setItem', res.data);
resolve( res.data );
})
.catch(error => {