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

This commit is contained in:
weryques 2018-06-04 16:32:57 -03:00
commit 2a59bf0cb0
15 changed files with 201 additions and 58 deletions

View File

@ -195,14 +195,17 @@
if (formNotSaved) {
this.$dialog.confirm({
title: this.$i18n.get('label_warning'),
message: this.$i18n.get('info_warning_category_not_saved'),
onConfirm: () => {
next();
},
cancelText: this.$i18n.get('cancel'),
confirmText: this.$i18n.get('continue'),
type: 'is-secondary'
});
onConfirm: () => {
next();
},
icon: 'alert-circle',
hasIcon: true,
cancelText: this.$i18n.get('cancel'),
confirmText: this.$i18n.get('continue'),
type: 'is-success'
});
} else {
next()
}

View File

@ -301,6 +301,7 @@
class="control"
custom>
<b-checkbox
v-if="registeredViewModes[viewMode] != undefined"
@input="updateViewModeslist(viewMode)"
:value="checkIfViewModeEnabled(viewMode)">
{{ registeredViewModes[viewMode].label }}
@ -326,6 +327,7 @@
@focus="clearErrors('default_view_mode')">
<option
v-for="(viewMode, index) of form.enabled_view_modes"
v-if="registeredViewModes[viewMode] != undefined"
:key="index"
:value="viewMode">{{ registeredViewModes[viewMode].label }}
</option>

View File

@ -676,14 +676,17 @@ export default {
beforeRouteLeave ( to, from, next ) {
if (this.item.status == 'auto-draft') {
this.$dialog.confirm({
title: this.$i18n.get('label_warning'),
message: this.$i18n.get('info_warning_item_not_saved'),
onConfirm: () => {
next();
},
cancelText: this.$i18n.get('cancel'),
confirmText: this.$i18n.get('continue'),
type: 'is-secondary'
});
onConfirm: () => {
next();
},
icon: 'alert-circle',
hasIcon: true,
cancelText: this.$i18n.get('cancel'),
confirmText: this.$i18n.get('continue'),
type: 'is-success'
});
} else {
next()
}

View File

@ -180,6 +180,7 @@
},
deleteOneCategory(categoryId) {
this.$dialog.confirm({
title: this.$i18n.get('label_warning'),
message: this.$i18n.get('info_warning_category_delete'),
onConfirm: () => {
this.deleteCategory(categoryId)
@ -205,11 +206,15 @@
// queue: true
// });
});
}
},
icon: 'alert-circle',
hasIcon: true,
type: 'is-success'
});
},
deleteSelectedCategories() {
this.$dialog.confirm({
title: this.$i18n.get('label_warning'),
message: this.$i18n.get('info_warning_selected_categories_delete'),
onConfirm: () => {
@ -237,7 +242,10 @@
}
}
this.allCategoriesOnPageSelected = false;
}
},
icon: 'alert-circle',
hasIcon: true,
type: 'is-success'
});
},
goToCategoryPage(categoryId) {

View File

@ -230,6 +230,7 @@ export default {
},
deleteOneCollection(collectionId) {
this.$dialog.confirm({
title: this.$i18n.get('label_warning'),
message: this.isOnTrash ? this.$i18n.get('info_warning_collection_delete') : this.$i18n.get('info_warning_collection_trash'),
onConfirm: () => {
this.deleteCollection({ collectionId: collectionId, isPermanently: this.isOnTrash })
@ -254,11 +255,15 @@ export default {
// queue: true
// })
});
}
},
icon: 'alert-circle',
hasIcon: true,
type: 'is-success'
});
},
deleteSelectedCollections() {
this.$dialog.confirm({
title: this.$i18n.get('label_warning'),
message: this.isOnTrash ? this.$i18n.get('info_warning_selected_collections_delete') : this.$i18n.get('info_warning_selected_collections_trash'),
onConfirm: () => {
@ -286,7 +291,10 @@ export default {
}
}
this.allCollectionsOnPageSelected = false;
}
},
icon: 'alert-circle',
hasIcon: true,
type: 'is-success'
});
},
goToCollectionPage(collectionId) {

View File

@ -195,15 +195,18 @@ export default {
}
if ((this.openedFieldId != '' && this.openedFieldId != undefined) || hasUnsavedForms ) {
this.$dialog.confirm({
title: this.$i18n.get('label_warning'),
message: this.$i18n.get('info_warning_fields_not_saved'),
onConfirm: () => {
this.onEditionCanceled();
next();
},
cancelText: this.$i18n.get('cancel'),
confirmText: this.$i18n.get('continue'),
type: 'is-secondary'
});
onConfirm: () => {
this.onEditionCanceled();
next();
},
icon: 'alert-circle',
hasIcon: true,
cancelText: this.$i18n.get('cancel'),
confirmText: this.$i18n.get('continue'),
type: 'is-success'
});
} else {
next()
}

View File

@ -222,15 +222,18 @@ export default {
}
if ((this.openedFilterId != '' && this.openedFilterId != undefined) || hasUnsavedForms ) {
this.$dialog.confirm({
title: this.$i18n.get('label_warning'),
message: this.$i18n.get('info_warning_filters_not_saved'),
onConfirm: () => {
this.onEditionCanceled();
next();
},
cancelText: this.$i18n.get('cancel'),
confirmText: this.$i18n.get('continue'),
type: 'is-secondary'
});
onConfirm: () => {
this.onEditionCanceled();
next();
},
icon: 'alert-circle',
hasIcon: true,
cancelText: this.$i18n.get('cancel'),
confirmText: this.$i18n.get('continue'),
type: 'is-success'
});
} else {
next()
}

View File

@ -214,6 +214,7 @@ export default {
},
deleteOneItem(itemId) {
this.$dialog.confirm({
title: this.$i18n.get('label_warning'),
message: this.isOnTrash ? this.$i18n.get('info_warning_item_delete') : this.$i18n.get('info_warning_item_trash'),
onConfirm: () => {
this.deleteItem({ itemId: itemId, isPermanently: this.isOnTrash })
@ -239,11 +240,15 @@ export default {
// queue: true
// })
});
}
},
icon: 'alert-circle',
hasIcon: true,
type: 'is-success'
});
},
deleteSelectedItems() {
this.$dialog.confirm({
title: this.$i18n.get('label_warning'),
message: this.isOnTrash ? this.$i18n.get('info_warning_selected_items_delete') : this.$i18n.get('info_warning_selected_items_trash'),
onConfirm: () => {
@ -275,7 +280,10 @@ export default {
}
}
this.allItemsOnPageSelected = false;
}
},
icon: 'alert-circle',
hasIcon: true,
type: 'is-success'
});
},
goToItemPage(item) {

View File

@ -213,13 +213,16 @@ export default {
// Checks if user is deleting a term with unsaved info.
if (term.id == 'new' || !term.saved || term.opened) {
this.$dialog.confirm({
title: this.$i18n.get('label_warning'),
message: this.$i18n.get('info_warning_terms_not_saved'),
onCancel: () => { return },
onConfirm: () => { this.removeTerm(term);},
cancelText: this.$i18n.get('cancel'),
confirmText: this.$i18n.get('continue'),
type: 'is-secondary'
});
onCancel: () => { return },
onConfirm: () => { this.removeTerm(term); },
icon: 'alert-circle',
hasIcon: true,
cancelText: this.$i18n.get('cancel'),
confirmText: this.$i18n.get('continue'),
type: 'is-success'
});
} else{
this.removeTerm(term);
}

View File

@ -69,9 +69,7 @@
tag="a"
to="/events"
:class="activeRoute == 'EventsPage' ? 'is-active':''">
<b-icon
size="is-small"
icon="flash"/>
<activities-icon />
<span class="menu-text">{{ $i18n.get('events') }}</span>
</router-link>
</li>
@ -81,13 +79,17 @@
</template>
<script>
export default {
name: 'PrimaryMenu',
props: {
isMenuCompressed: false,
activeRoute: '/collections'
}
}
import ActivitiesIcon from '../other/activities-icon.vue';
export default {
name: 'PrimaryMenu',
props: {
isMenuCompressed: false,
activeRoute: '/collections'
},
components: {
ActivitiesIcon
},
}
</script>
<style lang="scss" scoped>
@ -121,10 +123,19 @@
border-radius: 0px;
-webkit-transition: padding 0.2s linear; /* Safari */
transition: padding 0.2s linear;
.activities-icon {
fill: white;
}
}
a:hover, a.is-active {
background-color: $primary;
color: $tertiary;
.activities-icon {
fill: $tertiary;
}
}
a:focus {
box-shadow: none;

View File

@ -83,9 +83,7 @@
:to="{ path: $routerHelper.getCollectionEventsPath(id) }"
:class="activeRoute == 'CollectionEventsPage' ? 'is-active':''"
:aria-label="$i18n.get('label_collection_events')">
<b-icon
size="is-small"
icon="flash"/>
<activities-icon />
<br>
<span class="menu-text">{{ $i18n.get('events') }}</span>
</router-link>
@ -97,6 +95,7 @@
<script>
import { mapActions, mapGetters } from 'vuex';
import ActivitiesIcon from '../other/activities-icon.vue';
export default {
name: 'TainacanSubheader',
@ -109,6 +108,9 @@ export default {
activeRouteName: '',
}
},
components: {
ActivitiesIcon
},
props: {
id: Number,
},

View File

@ -0,0 +1,32 @@
<template>
<svg
xmlns="http://www.w3.org/2000/svg"
x="0px"
y="0px"
width="20"
height="20"
viewBox="0 0 24 24"
class="activities-icon"
xml:space="preserve">
<path
d="M20,11c0,1-0.2,2.1-0.5,3h-2.2c0.4-0.9,0.7-1.9,0.7-3c0-3.9-3.1-7-7-7s-7,3.1-7,7c0,3.5,2.6,6.5,6,6.9v2
c-4.5-0.5-8-4.3-8-8.9c0-5,4-9,9-9S20,6,20,11z M14,22h-2v-2h2V22z M14,18h-2v-2h2V18z M22,22h-6v-2h6V22z M22,18h-6v-2h6V18z M12,6
h-2l0,6l2.7,2H16l-4-3V6z"/>
</svg>
</template>
<script>
export default {
name: 'ActivitiesIcon'
}
</script>
<style type="text/scss">
svg.activities-icon {
margin-bottom: -5px;
fill:#1E2F56;
}
</style>

View File

@ -1,4 +1,3 @@
// Tainacan modals
.tainacan-modal-title {
h1, h2 {
@ -35,9 +34,64 @@
padding: 80px 0em 0.4em 0em !important;
}
}
// Bulma modals customized for Tainacan
.dialog{
.modal-background {
background-color: rgba(0, 0, 0, 0.70);
}
.modal-card {
background-color: $modal-backgound-color;
color: $secondary;
border-radius: 10px;
.modal-background {
background-color: rgba(0, 0, 0, 0.70);
.modal-card-head, .modal-card-body, .modal-card-foot {
background-color: $modal-backgound-color;
color: $secondary;
border: none;
}
.modal-card-head {
p { color: $secondary; }
font-weight: normal;
padding: 30px 35px 0px 35px;
}
.modal-card-body {
padding: 16px 35px;
i {
color: white !important;
&::before {
background-color: $danger;
border-radius: 55px;
display: initial;
}
}
}
.modal-card-foot {
justify-content: space-between;
padding: 0px 35px 30px 35px;
.button {
border-radius: 6px !important;
font-weight: normal;
padding: 2px 15px !important;
margin-top: 0px !important;
margin-bottom: 0px !important;
height: inherit !important;
box-shadow: none !important;
display: inline-flex !important;
cursor: pointer;
font-size: 13px !important;
}
.button.is-success {
border: none;
}
.button:not(.is-success) {
background-color: white;
color: $tertiary;
border: 1px solid $gray-light;
}
}
}
}
// WordPress Media Modal customization

View File

@ -18,6 +18,7 @@ $primary-darker: darken($primary-dark, 5%);
$success: #25a189;
$success-invert: findColorInvert($success);
$modal-backgound-color: #bfd8dd;
$separator-color: #2b98a4;
$tainacan-input-color: #1d1d1d;
$tainacan-input-background: #e5e5e5;

View File

@ -197,6 +197,8 @@ return [
'label_default_view_mode' => __( 'Default view mode', 'tainacan' ),
'label_enabled_view_modes' => __( 'Enabled view modes', 'tainacan' ),
'label_view_modes_available' => __( 'View modes available on theme', 'tainacan' ),
'label_warning' => __( 'Warning', 'tainacan' ),
'label_error' => __( 'Erro', 'tainacan' ),
// Instructions. More complex sentences to guide user and placeholders
'instruction_delete_selected_collections' => __( 'Delete selected collections', 'tainacan' ),