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

This commit is contained in:
weryques 2018-03-21 14:29:50 -03:00
commit 4766afd180
9 changed files with 298 additions and 74 deletions

View File

@ -16,7 +16,9 @@
:addons="false" :addons="false"
:type="formErrors['description'] != undefined ? 'is-danger' : ''" :type="formErrors['description'] != undefined ? 'is-danger' : ''"
:message="formErrors['description'] != undefined ? formErrors['description'] : ''"> :message="formErrors['description'] != undefined ? formErrors['description'] : ''">
<label class="label">{{$i18n.get('label_description')}} <a class="help-button"><b-icon size="is-small" icon="help-circle-outline"></b-icon></a></label> <label class="label">{{$i18n.get('label_description')}} <a class="help-button"><b-icon size="is-small" icon="help-circle-outline"></b-icon>
<!-- <help-tooltip title="Ajuda Gente!" message="Este é um exemplo de mensagem de ajuda. Aqui vai um monte de informações úteis."></help-tooltip> -->
</a></label>
<b-input type="textarea" name="description" v-model="editForm.description" @focus="clearErrors('description')" ></b-input> <b-input type="textarea" name="description" v-model="editForm.description" @focus="clearErrors('description')" ></b-input>
</b-field> </b-field>
@ -46,6 +48,9 @@
</div> </div>
</b-field> </b-field>
<br> <br>
<b-field
:addons="false"
:label="$i18n.get('label_options')">
<b-field <b-field
:type="formErrors['required'] != undefined ? 'is-danger' : ''" :type="formErrors['required'] != undefined ? 'is-danger' : ''"
:message="formErrors['required'] != undefined ? formErrors['required'] : ''"> :message="formErrors['required'] != undefined ? formErrors['required'] : ''">
@ -87,8 +92,7 @@
</b-checkbox> </b-checkbox>
<a class="help-button"><b-icon size="is-small" icon="help-circle-outline"></b-icon></a> <a class="help-button"><b-icon size="is-small" icon="help-circle-outline"></b-icon></a>
</b-field> </b-field>
</b-field>
<div v-if="(!Array.isArray(editForm.field_type_options))" class="separator"></div>
<component <component
:errors="formErrors['field_type_options']" :errors="formErrors['field_type_options']"
@ -113,6 +117,7 @@
<script> <script>
import { mapActions } from 'vuex'; import { mapActions } from 'vuex';
import HelpTooltip from '../other/help-tooltip.vue';
export default { export default {
name: 'FieldEditionForm', name: 'FieldEditionForm',
@ -132,6 +137,9 @@ export default {
isRepositoryLevel: false, isRepositoryLevel: false,
collectionId: '' collectionId: ''
}, },
components: {
HelpTooltip
},
created() { created() {
this.editForm = this.editedField; this.editForm = this.editedField;
this.oldForm = JSON.parse(JSON.stringify(this.originalField)); this.oldForm = JSON.parse(JSON.stringify(this.originalField));
@ -220,13 +228,6 @@ export default {
border-top: 1px solid $draggable-border-color; border-top: 1px solid $draggable-border-color;
border-bottom: 1px solid $draggable-border-color; border-bottom: 1px solid $draggable-border-color;
margin-top: 1.0em; margin-top: 1.0em;
.separator {
background-color: $draggable-border-color;
margin: 1.8em 0;
height: 1px;
width: 75%;
}
} }
</style> </style>

View File

@ -30,7 +30,7 @@
<grip-icon></grip-icon> <grip-icon></grip-icon>
<span <span
class="field-name" class="field-name"
:class="{'is-danger': formWithErrors == field.id || field.status == 'auto-draft' || (editForms[field.id] != undefined && editForms[field.id].saved != true) }"> :class="{'is-danger': formWithErrors == field.id }">
{{ field.name }} {{ field.name }}
</span> </span>
<span <span
@ -129,6 +129,27 @@ export default {
FieldEditionForm, FieldEditionForm,
GripIcon GripIcon
}, },
beforeRouteLeave ( to, from, next ) {
let hasUnsavedForms = false;
for (let editForm in this.editForms) {
if (!this.editForms[editForm].saved)
hasUnsavedForms = true;
}
if ((this.openedFieldId != '' && this.openedFieldId != undefined) || hasUnsavedForms ) {
this.$dialog.confirm({
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'
});
} else {
next()
}
},
methods: { methods: {
...mapActions('fields', [ ...mapActions('fields', [
'fetchFieldTypes', 'fetchFieldTypes',
@ -209,6 +230,7 @@ export default {
// Opening collapse // Opening collapse
} else { } else {
this.openedFieldId = field.id; this.openedFieldId = field.id;
// First time opening // First time opening
if (this.editForms[this.openedFieldId] == undefined) { if (this.editForms[this.openedFieldId] == undefined) {

View File

@ -153,6 +153,27 @@ export default {
FilterEditionForm, FilterEditionForm,
GripIcon GripIcon
}, },
beforeRouteLeave ( to, from, next ) {
let hasUnsavedForms = false;
for (let editForm in this.editForms) {
if (!this.editForms[editForm].saved)
hasUnsavedForms = true;
}
if ((this.openedFilterId != '' && this.openedFilterId != undefined) || hasUnsavedForms ) {
this.$dialog.confirm({
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'
});
} else {
next()
}
},
methods: { methods: {
...mapActions('filter', [ ...mapActions('filter', [
'fetchFilterTypes', 'fetchFilterTypes',

View File

@ -0,0 +1,71 @@
<template>
<div class="help-tooltip">
<div class="help-tooltip-header">
<h5>{{ title }}</h5>
</div>
<div class="help-tooltip-body">
<p>{{ message }}</p>
</div>
</div>
</template>
<script>
export default {
name: 'HelpTooltip',
props: {
title: '',
message: ''
}
}
</script>
<style lang="scss">
.help-tooltip {
color: #000;
background-color: #e8f9f5;
border: 1px solid #338591;
border-radius: 10px;
margin: 0;
position: absolute;
z-index: 99999999999999;
top: 0%;
display: block;
.help-tooltip-header {
padding: 0.8em 1.2em 0.6em 1.2em;
border-bottom: 1px solid #909293;
font-size: 18px;
font-weight: bold;
}
.help-tooltip-body {
padding: 1.2em;
font-size: 11px;
}
&:after,
&:before {
content: "";
display: block;
position: absolute;
left: 10%;
width: 0;
height: 0;
border-style: solid;
}
&:after {
border-color: #e8f9f5 transparent transparent transparent;
border-right-width: 20px;
border-top-width: 16px;
border-left-width: 20px;
}
&:before {
border-color: #338591 transparent transparent transparent;
border-right-width: 20px;
border-top-width: 16px;
border-left-width: 20px;
bottom: -20px;
}
}
</style>

View File

@ -77,6 +77,7 @@ html {
// Input components used in forms are gray in Tainacan // Input components used in forms are gray in Tainacan
.tainacan-form { .tainacan-form {
color: black;
.form-submit { .form-submit {
justify-content: space-between !important; justify-content: space-between !important;
padding: 1em 1.2em 0.4em 1.2em; padding: 1em 1.2em 0.4em 1.2em;
@ -98,11 +99,12 @@ html {
color: $danger; color: $danger;
} }
} }
.help-button { a.help-button, a.help-button i, a.help-button i::before{
i, i::before { font-size: 0.9em !important; } font-size: 0.9em !important;
color: $gray; color: $gray;
&:hover { &:hover {
color: $primary; color: $primary !important;
i, i::before {color: $primary !important;}
} }
} }
.input, .textarea { .input, .textarea {
@ -119,19 +121,14 @@ html {
} }
.radio { .radio {
margin-bottom: 0.2em; margin-bottom: 0.2em;
.control-label {
padding-left: 0.8em;
font-size: 14px;
}
} }
.checkbox { .checkbox {
margin-bottom: 0.2em; margin-bottom: 0.2em;
.control-label {
padding-left: 0.8em;
font-size: 14px;
} }
.control-label { // The value part in checkbox, radio and switches
color: black;
padding-left: 0.8em;
font-size: 12px;
} }
.select { .select {
padding-top: 0px !important; padding-top: 0px !important;
@ -215,9 +212,6 @@ html {
} }
} }
.switch { .switch {
.control-label{
color: black;
}
input[type="checkbox"] + .check { input[type="checkbox"] + .check {
background-color: transparent; background-color: transparent;
border: 1.6px solid $gray; border: 1.6px solid $gray;

View File

@ -1,6 +1,7 @@
<?php <?php
return [ return [
<<<<<<< HEAD
// Tainacan common terms // Tainacan common terms
'repository' => __( 'Repository', 'tainacan' ), 'repository' => __( 'Repository', 'tainacan' ),
'collections' => __( 'Collections', 'tainacan' ), 'collections' => __( 'Collections', 'tainacan' ),
@ -15,6 +16,35 @@ return [
'filter' => __( 'Filter', 'tainacan' ), 'filter' => __( 'Filter', 'tainacan' ),
'category' => __( 'Category', 'tainacan' ), 'category' => __( 'Category', 'tainacan' ),
'event' => __( 'Event', 'tainacan' ), 'event' => __( 'Event', 'tainacan' ),
=======
// Tainacan common terms
'repository' => __('Repository', 'tainacan'),
'collections' => __('Collections', 'tainacan'),
'items' => __('Items', 'tainacan'),
'fields' => __('Fields', 'tainacan'),
'filters' => __('Filters', 'tainacan'),
'categories' => __('Categories', 'tainacan'),
'events' => __('Events', 'tainacan'),
'collection' => __('Collection', 'tainacan'),
'item' => __('Item', 'tainacan'),
'field' => __('Field', 'tainacan'),
'filter' => __('Filter', 'tainacan'),
'category' => __('Category', 'tainacan'),
'event' => __('Event', 'tainacan'),
// Actions
'edit' => __('Edit', 'tainacan'),
'new' => __('New', 'tainacan'),
'import' => __('Import', 'tainacan'),
'export' => __('Export', 'tainacan'),
'cancel' => __('Cancel', 'tainacan'),
'save' => __('Save', 'tainacan'),
'next' => __('Next', 'tainacan'),
'see' => __('See', 'tainacan'),
'search' => __('Search', 'tainacan'),
'advanced_search' => __('Advanced Search', 'tainacan'),
'continue' => __('Continue', 'tainacan'),
>>>>>>> b40fd2e6c01f7f0c9da528b7b29b860bf201bf78
// Actions // Actions
'edit' => __( 'Edit', 'tainacan' ), 'edit' => __( 'Edit', 'tainacan' ),
@ -37,6 +67,7 @@ return [
'publish_visibility' => __( 'Visible to everyone', 'tainacan' ), 'publish_visibility' => __( 'Visible to everyone', 'tainacan' ),
'private_visibility' => __( 'Visible only for editors', 'tainacan' ), 'private_visibility' => __( 'Visible only for editors', 'tainacan' ),
<<<<<<< HEAD
// Page Titles (used mainly on Router) // Page Titles (used mainly on Router)
'title_collections_page' => __( 'Collections Page', 'tainacan' ), 'title_collections_page' => __( 'Collections Page', 'tainacan' ),
'title_items_page' => __( 'Items Page', 'tainacan' ), 'title_items_page' => __( 'Items Page', 'tainacan' ),
@ -48,6 +79,60 @@ return [
'title_collection_page' => __( 'Collection Page', 'tainacan' ), 'title_collection_page' => __( 'Collection Page', 'tainacan' ),
'title_item_page' => __( 'Item Page', 'tainacan' ), 'title_item_page' => __( 'Item Page', 'tainacan' ),
'title_field_page' => __( 'Field Page', 'tainacan' ), 'title_field_page' => __( 'Field Page', 'tainacan' ),
=======
// Labels (used mainly on Aria Labels and Inputs)
'label_menu' => __('Menu', 'tainacan'),
'label_main_menu' => __('Main Menu', 'tainacan'),
'label_collection_menu' => __('Collection Menu', 'tainacan'),
'label_title' => __('Title', 'tainacan'),
'label_actions' => __('Actions', 'tainacan'),
'label_name' => __('Name', 'tainacan'),
'label_description' => __('Description', 'tainacan'),
'label_status' => __('Status', 'tainacan'),
'label_slug' => __('Slug', 'tainacan'),
'label_image' => __('Image', 'tainacan'),
'label_thumbnail' => __('Thumbnail', 'tainacan'),
'label_button_view' => __('Button View', 'tainacan'),
'label_button_edit' => __('Button Edit', 'tainacan'),
'label_button_delete' => __('Button Delete', 'tainacan'),
'label_button_edit_thumb' => __('Button Edit Thumbnail', 'tainacan'),
'label_button_delete_thumb' => __('Button Delete Thumbnail', 'tainacan'),
'label_collections_per_page' => __('Collections per Page:', 'tainacan'),
'label_items_per_page' => __('Items per Page:', 'tainacan'),
'label_active_fields' => __('Active Fields', 'tainacan'),
'label_available_fields' => __('Available Fields', 'tainacan'),
'label_available_field_types' => __('Available Field Types', 'tainacan'),
'label_active_filters' => __('Active Filters', 'tainacan'),
'label_filter_type' => __('Filter Type', 'tainacan'),
'label_available_filters' => __('Available Filters', 'tainacan'),
'label_available_filter_types' => __('Available Filter Types', 'tainacan'),
'label_per_page' => __('per Page', 'tainacan'),
'label_table_fields' => __('Fields on table', 'tainacan'),
'label_required' => __('Required', 'tainacan'),
'label_allow_multiple' => __('Allow multiple values', 'tainacan'),
'label_default_value' => __('Default value', 'tainacan'),
'label_unique_value' => __('Unique value', 'tainacan'),
'label_yes' => __('Yes', 'tainacan'),
'label_no' => __('No', 'tainacan'),
'label_collection_related' => __('Collection Related', 'tainacan'),
'label_fields_for_search' => __('Fields for search', 'tainacan'),
'label_allow_repeated_items' => __('Allow repeated items', 'tainacan'),
'label_select_category' => __('Select category', 'tainacan'),
'label_select_category_input_type' => __('Input type', 'tainacan'),
'label_category_allow_new_terms' => __('Allow new terms', 'tainacan'),
'label_selectbox_init' => __('Select', 'tainacan'),
'lavel_insert_options' => __('Insert options', 'tainacan'),
'lavel_options' => __('Options', 'tainacan'),
'label_attachments' => __('Attachments', 'tainacan'),
'label_enabled' => __('Enabled', 'tainacan'),
'label_disabled' => __('Disabled', 'tainacan'),
'label_creation' => __('Creation', 'tainacan'),
'label_collection_items' => __('Collection Items', 'tainacan'),
'label_collection_fields' => __('Collection Fields', 'tainacan'),
'label_collection_filters' => __('Collection Filters', 'tainacan'),
'label_parent_term' => __('Parent Term', 'tainacan'),
'label_add_new_term' => __('Add New Term', 'tainacan'),
>>>>>>> b40fd2e6c01f7f0c9da528b7b29b860bf201bf78
/* translators: alkdjklasdj laksjd klsadj */ /* translators: alkdjklasdj laksjd klsadj */
'title_filter_page' => __( 'Filter Page', 'tainacan' ), 'title_filter_page' => __( 'Filter Page', 'tainacan' ),
@ -64,6 +149,7 @@ return [
'title_filter_edition' => __( 'Filter Edition Page', 'tainacan' ), 'title_filter_edition' => __( 'Filter Edition Page', 'tainacan' ),
'title_collection_fields_edition' => __( 'Collection Fields Edition Page', 'tainacan' ), 'title_collection_fields_edition' => __( 'Collection Fields Edition Page', 'tainacan' ),
<<<<<<< HEAD
// Labels (used mainly on Aria Labels and Inputs) // Labels (used mainly on Aria Labels and Inputs)
'label_menu' => __( 'Menu', 'tainacan' ), 'label_menu' => __( 'Menu', 'tainacan' ),
'label_main_menu' => __( 'Main Menu', 'tainacan' ), 'label_main_menu' => __( 'Main Menu', 'tainacan' ),
@ -116,6 +202,30 @@ return [
'label_collection_filters' => __( 'Collection Filters', 'tainacan' ), 'label_collection_filters' => __( 'Collection Filters', 'tainacan' ),
'label_parent_term' => __( 'Parent Term', 'tainacan' ), 'label_parent_term' => __( 'Parent Term', 'tainacan' ),
'label_add_new_term' => __( 'Add New Term', 'tainacan' ), 'label_add_new_term' => __( 'Add New Term', 'tainacan' ),
=======
// Info. Other feedback to user.
'info_name_is_required' => __('Name is required.', 'tainacan'),
'info_no_collection_created' => __('No collection was created in this repository.', 'tainacan'),
'info_no_item_created' => __('No item was created in this collection.', 'tainacan'),
'info_error_deleting_collection' => __('Error on deleting collection.', 'tainacan'),
'info_collection_deleted' => __('Collection deleted.', 'tainacan'),
'info_item_deleted' => __('Item deleted.', 'tainacan'),
'info_warning_collection_delete' => __('Do you really want to delete this collection?', 'tainacan'),
'info_warning_item_delete' => __('Do you really want to delete this item?', 'tainacan'),
'info_warning_selected_collections_delete' => __('Do you really want to delete the selected collections?', 'tainacan'),
'info_warning_selected_items_delete' => __('Do you really want to delete the selected items?', 'tainacan'),
'info_warning_collection_related' => __('The field Collection related is required', 'tainacan'),
'info_warning_no_fields_found' => __('No fields found in this collection', 'tainacan'),
'info_showing_items' => __('Showing items ', 'tainacan'),
'info_showing_collections' => __('Showing collections ', 'tainacan'),
'info_to' => __(' to ', 'tainacan'),
'info_of' => __(' of ', 'tainacan'),
'info_created_by' => __('Created by: ', 'tainacan'),
'info_date' => __('Date: ', 'tainacan'),
'info_not_saved' => __('Not saved ', 'tainacan'),
'info_warning_fields_not_saved' => __('Are you sure? There are fields not saved, changes will be lost.', 'tainacan'),
'info_warning_filters_not_saved' => __('Are you sure? There are filters not saved, changes will be lost.', 'tainacan'),
>>>>>>> b40fd2e6c01f7f0c9da528b7b29b860bf201bf78
// Instructions. More complex sentences to guide user and placeholders // Instructions. More complex sentences to guide user and placeholders
'instruction_dragndrop_fields_collection' => __( 'Drag and drop Fields here to Collection.', 'tainacan' ), 'instruction_dragndrop_fields_collection' => __( 'Drag and drop Fields here to Collection.', 'tainacan' ),

View File

@ -64,14 +64,17 @@
</b-field> </b-field>
<b-field :addons="false"> <b-field :addons="false">
<label class="label">
{{ $i18n.get('label_category_allow_new_terms') }}
<a class="help-button"><b-icon size="is-small" icon="help-circle-outline"></b-icon></a>
</label>
<div class="block"> <div class="block">
<b-checkbox v-model="allow_new_terms" <b-checkbox v-model="allow_new_terms"
@input="emitValues()" @input="emitValues()"
true-value="yes" true-value="yes"
false-value="no"> false-value="no">
{{ $i18n.get('label_category_allow_new_terms') }} {{ labelNewTerms() }}
</b-checkbox> </b-checkbox>
<a class="help-button"><b-icon size="is-small" icon="help-circle-outline"></b-icon></a>
</div> </div>
</b-field> </b-field>

View File

@ -55,15 +55,17 @@
<b-field :addons="false"> <b-field :addons="false">
<label class="label">
{{ $i18n.get('label_allow_repeated_items') }}
<a class="help-button"><b-icon size="is-small" icon="help-circle-outline"></b-icon></a>
</label>
<div class="block"> <div class="block">
<b-checkbox v-model="modelRepeated" <b-checkbox v-model="modelRepeated"
@input="emitValues()" @input="emitValues()"
true-value="yes" true-value="yes"
false-value="no"> false-value="no">
{{ $i18n.get('label_allow_repeated_items') }} {{ labelRepeated() }}
</b-checkbox> </b-checkbox>
<a class="help-button"><b-icon size="is-small" icon="help-circle-outline"></b-icon></a>
</div> </div>
</b-field> </b-field>
</section> </section>

View File

@ -6,7 +6,7 @@
:message="optionMessage" :message="optionMessage"
> >
<label class="label"> <label class="label">
{{ $i18n.get('label_options') }}<span :class="optionType" >&nbsp;*&nbsp;</span> {{ $i18n.get('lavel_insert_options') }}<span :class="optionType" >&nbsp;*&nbsp;</span>
<a class="help-button"><b-icon size="is-small" icon="help-circle-outline"></b-icon></a> <a class="help-button"><b-icon size="is-small" icon="help-circle-outline"></b-icon></a>
</label> </label>
<b-taginput <b-taginput