MOAR LINTERS BABY. BRACE YOURSELVES.

This commit is contained in:
mateuswetah 2018-03-23 13:18:13 -03:00
parent a7923b0a4d
commit f0f1805e05
45 changed files with 1013 additions and 659 deletions

View File

@ -2,7 +2,7 @@ module.exports = {
extends: [
// add more generic rulesets here, such as:
'eslint:recommended',
'plugin:vue/essential'
'plugin:vue/strongly-recommended'
],
rules: {
// override/add rules settings here, such as:
@ -10,7 +10,7 @@ module.exports = {
"no-console": "warn",
"no-unused-vars": "warn",
"no-undef": "warn",
"vue/no-side-effects-in-computed-properties": "warn",
"vue/return-in-computed-property": "warn"
"vue/html-indent": "off",
"vue/require-default-prop": "off", // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/require-default-prop.md
}
}

View File

@ -1,9 +1,11 @@
<template>
<div id="tainacan-admin-app" class="columns is-fullheight">
<primary-menu></primary-menu>
<tainacan-header></tainacan-header>
<div
id="tainacan-admin-app"
class="columns is-fullheight">
<primary-menu/>
<tainacan-header/>
<div class="column is-main-content">
<router-view></router-view>
<router-view/>
</div>
</div>
</template>

View File

@ -1,8 +1,14 @@
<template>
<div>
<div class="page-container primary-page">
<b-tag v-if="category != null && category != undefined" :type="'is-' + getStatusColor(category.status)" v-text="category.status"></b-tag>
<form v-if="category != null && category != undefined" class="tainacan-form" label-width="120px">
<b-tag
v-if="category != null && category != undefined"
:type="'is-' + getStatusColor(category.status)"
v-text="category.status"/>
<form
v-if="category != null && category != undefined"
class="tainacan-form"
label-width="120px">
<!-- Name -------------------------------- -->
<b-field
@ -12,14 +18,12 @@
:message="editFormErrors['name'] != undefined ? editFormErrors['name'] : ''">
<help-button
:title="$i18n.getHelperTitle('categories', 'name')"
:message="$i18n.getHelperMessage('categories', 'name')">
</help-button>
:message="$i18n.getHelperMessage('categories', 'name')"/>
<b-input
id="tainacan-text-name"
v-model="form.name"
@focus="clearErrors('name')"
@blur="updateSlug()">
</b-input>
@blur="updateSlug()"/>
</b-field>
<!-- Description -------------------------------- -->
@ -30,14 +34,12 @@
:message="editFormErrors['description'] != undefined ? editFormErrors['description'] : ''">
<help-button
:title="$i18n.getHelperTitle('categories', 'description')"
:message="$i18n.getHelperMessage('categories', 'description')">
</help-button>
:message="$i18n.getHelperMessage('categories', 'description')"/>
<b-input
id="tainacan-text-description"
type="textarea"
v-model="form.description"
@focus="clearErrors('description')">
</b-input>
@focus="clearErrors('description')"/>
</b-field>
<!-- Status -------------------------------- -->
@ -48,8 +50,7 @@
:message="editFormErrors['status'] != undefined ? editFormErrors['status'] : ''">
<help-button
:title="$i18n.getHelperTitle('categories', 'status')"
:message="$i18n.getHelperMessage('categories', 'status')">
</help-button>
:message="$i18n.getHelperMessage('categories', 'status')"/>
<b-select
id="tainacan-select-status"
v-model="form.status"
@ -72,14 +73,12 @@
:message="editFormErrors['slug'] != undefined ? editFormErrors['slug'] : ''">
<help-button
:title="$i18n.getHelperTitle('categories', 'slug')"
:message="$i18n.getHelperMessage('categories', 'slug')">
</help-button>
:message="$i18n.getHelperMessage('categories', 'slug')"/>
<b-input
id="tainacan-text-slug"
v-model="form.slug"
@focus="clearErrors('slug')"
:disabled="isUpdatingSlug">
</b-input>
:disabled="isUpdatingSlug"/>
</b-field>
<!-- Allow Insert -->
@ -88,8 +87,7 @@
:label="$i18n.get('label_category_allow_new_terms')">
<help-button
:title="$i18n.getHelperTitle('categories', 'allow_insert')"
:message="$i18n.getHelperMessage('categories', 'allow_insert')">
</help-button>
:message="$i18n.getHelperMessage('categories', 'allow_insert')"/>
<div class="block" >
<b-checkbox
v-model="form.allowInsert"
@ -115,12 +113,12 @@
class="button is-success">{{ $i18n.get('save') }}</button>
</div>
</div>
<p class="help is-danger">{{formErrorMessage}}</p>
<p class="help is-danger">{{ formErrorMessage }}</p>
</form>
<b-loading
:active.sync="isLoading"
:canCancel="false"></b-loading>
:can-cancel="false"/>
</div>
</div>
</template>

View File

@ -1,7 +1,15 @@
<template>
<div class="page-container" :class="{'primary-page' : isNewCollection }">
<b-tag v-if="collection != null && collection != undefined" :type="'is-' + getStatusColor(collection.status)" v-text="collection.status"></b-tag>
<form v-if="collection != null && collection != undefined" class="tainacan-form" label-width="120px">
<div
class="page-container"
:class="{'primary-page' : isNewCollection }">
<b-tag
v-if="collection != null && collection != undefined"
:type="'is-' + getStatusColor(collection.status)"
v-text="collection.status"/>
<form
v-if="collection != null && collection != undefined"
class="tainacan-form"
label-width="120px">
<!-- Name -------------------------------- -->
<b-field
@ -11,13 +19,11 @@
:message="editFormErrors['name'] != undefined ? editFormErrors['name'] : ''">
<help-button
:title="$i18n.getHelperTitle('collections', 'name')"
:message="$i18n.getHelperMessage('collections', 'name')">
</help-button>
:message="$i18n.getHelperMessage('collections', 'name')"/>
<b-input
id="tainacan-text-name"
v-model="form.name"
@focus="clearErrors('name')">
</b-input>
@focus="clearErrors('name')"/>
</b-field>
<!-- Thumbnail -------------------------------- -->
@ -33,23 +39,29 @@
<div class="content has-text-centered">
<p>
<b-icon
icon="upload">
</b-icon>
icon="upload"/>
</p>
<p>{{ $i18n.get('instruction_image_upload_box') }}</p>
</div>
</b-upload>
<div v-else>
<figure class="image is-128x128">
<img :alt="$i18n.get('label_thumbnail')" :src="collection.featured_image"/>
<img
:alt="$i18n.get('label_thumbnail')"
:src="collection.featured_image">
</figure>
<div class="thumbnail-buttons-row">
<b-upload
model="thumbnail"
@input="uploadThumbnail($event)">
<a id="button-edit" :aria-label="$i18n.get('label_button_edit_thumb')"><b-icon icon="pencil"></b-icon></a>
model="thumbnail"
@input="uploadThumbnail($event)">
<a
id="button-edit"
:aria-label="$i18n.get('label_button_edit_thumb')"><b-icon icon="pencil"/></a>
</b-upload>
<a id="button-delete" :aria-label="$i18n.get('label_button_delete_thumb')" @click="deleteThumbnail()"><b-icon icon="delete"></b-icon></a>
<a
id="button-delete"
:aria-label="$i18n.get('label_button_delete_thumb')"
@click="deleteThumbnail()"><b-icon icon="delete"/></a>
</div>
</div>
</div>
@ -57,32 +69,29 @@
<!-- Description -------------------------------- -->
<b-field
:addons="false"
:label="$i18n.get('label_description')"
:type="editFormErrors['description'] != undefined ? 'is-danger' : ''"
:message="editFormErrors['description'] != undefined ? editFormErrors['description'] : ''">
:addons="false"
:label="$i18n.get('label_description')"
:type="editFormErrors['description'] != undefined ? 'is-danger' : ''"
:message="editFormErrors['description'] != undefined ? editFormErrors['description'] : ''">
<help-button
:title="$i18n.getHelperTitle('collections', 'description')"
:message="$i18n.getHelperMessage('collections', 'description')">
</help-button>
:title="$i18n.getHelperTitle('collections', 'description')"
:message="$i18n.getHelperMessage('collections', 'description')"/>
<b-input
id="tainacan-text-description"
type="textarea"
v-model="form.description"
@focus="clearErrors('description')">
</b-input>
@focus="clearErrors('description')"/>
</b-field>
<!-- Status -------------------------------- -->
<b-field
:addons="false"
:label="$i18n.get('label_status')"
:type="editFormErrors['status'] != undefined ? 'is-danger' : ''"
:message="editFormErrors['status'] != undefined ? editFormErrors['status'] : ''">
:addons="false"
:label="$i18n.get('label_status')"
:type="editFormErrors['status'] != undefined ? 'is-danger' : ''"
:message="editFormErrors['status'] != undefined ? editFormErrors['status'] : ''">
<help-button
:title="$i18n.getHelperTitle('collections', 'status')"
:message="$i18n.getHelperMessage('collections', 'status')">
</help-button>
:title="$i18n.getHelperTitle('collections', 'status')"
:message="$i18n.getHelperMessage('collections', 'status')"/>
<b-select
id="tainacan-select-status"
v-model="form.status"
@ -99,39 +108,39 @@
<!-- Slug -------------------------------- -->
<b-field
:addons="false"
:label="$i18n.get('label_slug')"
:type="editFormErrors['slug'] != undefined ? 'is-danger' : ''"
:message="editFormErrors['slug'] != undefined ? editFormErrors['slug'] : ''">
:addons="false"
:label="$i18n.get('label_slug')"
:type="editFormErrors['slug'] != undefined ? 'is-danger' : ''"
:message="editFormErrors['slug'] != undefined ? editFormErrors['slug'] : ''">
<help-button
:title="$i18n.getHelperTitle('collections', 'slug')"
:message="$i18n.getHelperMessage('collections', 'slug')">
</help-button>
:title="$i18n.getHelperTitle('collections', 'slug')"
:message="$i18n.getHelperMessage('collections', 'slug')"/>
<b-input
id="tainacan-text-slug"
v-model="form.slug"
@focus="clearErrors('slug')">
</b-input>
id="tainacan-text-slug"
v-model="form.slug"
@focus="clearErrors('slug')"/>
</b-field>
<div class="field is-grouped form-submit">
<div class="control">
<button
id="button-cancel-collection-creation"
class="button is-outlined"
type="button"
@click="cancelBack">{{ $i18n.get('cancel') }}</button>
id="button-cancel-collection-creation"
class="button is-outlined"
type="button"
@click="cancelBack">{{ $i18n.get('cancel') }}</button>
</div>
<div class="control">
<button
id="button-submit-collection-creation"
@click.prevent="onSubmit"
class="button is-success">{{ $i18n.get('save') }}</button>
id="button-submit-collection-creation"
@click.prevent="onSubmit"
class="button is-success">{{ $i18n.get('save') }}</button>
</div>
</div>
<p class="help is-danger">{{formErrorMessage}}</p>
<p class="help is-danger">{{ formErrorMessage }}</p>
</form>
<b-loading :active.sync="isLoading" :canCancel="false"></b-loading>
<b-loading
:active.sync="isLoading"
:can-cancel="false"/>
</div>
</template>

View File

@ -1,140 +1,152 @@
<template>
<form id="fieldEditForm" class="tainacan-form" v-on:submit.prevent="saveEdition(editForm)">
<form
id="fieldEditForm"
class="tainacan-form"
@submit.prevent="saveEdition(editForm)">
<b-field
:addons="false"
:type="formErrors['name'] != undefined ? 'is-danger' : ''"
:message="formErrors['name'] != undefined ? formErrors['name'] : ''">
:addons="false"
:type="formErrors['name'] != undefined ? 'is-danger' : ''"
:message="formErrors['name'] != undefined ? formErrors['name'] : ''">
<label class="label">
{{$i18n.get('label_name')}}
<span class="required-field-asterisk" :class="formErrors['name'] != undefined ? 'is-danger' : ''">*</span>
{{ $i18n.get('label_name') }}
<span
class="required-field-asterisk"
:class="formErrors['name'] != undefined ? 'is-danger' : ''">*</span>
<help-button
:title="$i18n.getHelperTitle('fields', 'name')"
:message="$i18n.getHelperMessage('fields', 'name')">
</help-button>
:title="$i18n.getHelperTitle('fields', 'name')"
:message="$i18n.getHelperMessage('fields', 'name')"/>
</label>
<b-input v-model="editForm.name" name="name" @focus="clearErrors('name')"></b-input>
<b-input
v-model="editForm.name"
name="name"
@focus="clearErrors('name')"/>
</b-field>
<b-field
:addons="false"
:type="formErrors['description'] != undefined ? 'is-danger' : ''"
:message="formErrors['description'] != undefined ? formErrors['description'] : ''">
:addons="false"
:type="formErrors['description'] != undefined ? 'is-danger' : ''"
:message="formErrors['description'] != undefined ? formErrors['description'] : ''">
<label class="label">
{{$i18n.get('label_description')}}
{{ $i18n.get('label_description') }}
<help-button
:title="$i18n.getHelperTitle('fields', 'description')"
:message="$i18n.getHelperMessage('fields', 'description')">
</help-button>
:title="$i18n.getHelperTitle('fields', 'description')"
:message="$i18n.getHelperMessage('fields', 'description')"/>
</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-field>
<b-field
:addons="false"
:type="formErrors['status'] != undefined ? 'is-danger' : ''"
:message="formErrors['status'] != undefined ? formErrors['status'] : ''">
:addons="false"
:type="formErrors['status'] != undefined ? 'is-danger' : ''"
:message="formErrors['status'] != undefined ? formErrors['status'] : ''">
<label class="label">
{{$i18n.get('label_status')}}
{{ $i18n.get('label_status') }}
<help-button
:title="$i18n.getHelperTitle('fields', 'status')"
:message="$i18n.getHelperMessage('fields', 'status')">
</help-button>
:title="$i18n.getHelperTitle('fields', 'status')"
:message="$i18n.getHelperMessage('fields', 'status')"/>
</label>
<div class="inline-block">
<b-radio
@focus="clearErrors('label_status')"
id="tainacan-select-status-publish"
name="status"
v-model="editForm.status"
native-value="publish">
@focus="clearErrors('label_status')"
id="tainacan-select-status-publish"
name="status"
v-model="editForm.status"
native-value="publish">
{{ $i18n.get('publish_visibility') }}
</b-radio>
<br>
<b-radio
@focus="clearErrors('label_status')"
id="tainacan-select-status-private"
name="status"
v-model="editForm.status"
native-value="private">
@focus="clearErrors('label_status')"
id="tainacan-select-status-private"
name="status"
v-model="editForm.status"
native-value="private">
{{ $i18n.get('private_visibility') }}
</b-radio>
</div>
</b-field>
<br>
<b-field
:addons="false"
:label="$i18n.get('label_options')">
:addons="false"
:label="$i18n.get('label_options')">
<b-field
:type="formErrors['required'] != undefined ? 'is-danger' : ''"
:message="formErrors['required'] != undefined ? formErrors['required'] : ''">
:type="formErrors['required'] != undefined ? 'is-danger' : ''"
:message="formErrors['required'] != undefined ? formErrors['required'] : ''">
<b-checkbox
@input="clearErrors('required')"
v-model="editForm.required"
true-value="yes"
false-value="no"
name="required">
@input="clearErrors('required')"
v-model="editForm.required"
true-value="yes"
false-value="no"
name="required">
{{ $i18n.get('label_required') }}
</b-checkbox>
<help-button
:title="$i18n.getHelperTitle('fields', 'required')"
:message="$i18n.getHelperMessage('fields', 'required')">
</help-button>
:title="$i18n.getHelperTitle('fields', 'required')"
:message="$i18n.getHelperMessage('fields', 'required')"/>
</b-field>
<b-field
:type="formErrors['multiple'] != undefined ? 'is-danger' : ''"
:message="formErrors['multiple'] != undefined ? formErrors['multiple'] : ''">
:type="formErrors['multiple'] != undefined ? 'is-danger' : ''"
:message="formErrors['multiple'] != undefined ? formErrors['multiple'] : ''">
<b-checkbox
@input="clearErrors('multiple')"
v-model="editForm.multiple"
true-value="yes"
false-value="no"
name="multiple">
@input="clearErrors('multiple')"
v-model="editForm.multiple"
true-value="yes"
false-value="no"
name="multiple">
{{ $i18n.get('label_allow_multiple') }}
</b-checkbox>
<help-button
:title="$i18n.getHelperTitle('fields', 'multiple')"
:message="$i18n.getHelperMessage('fields', 'multiple')">
</help-button>
:title="$i18n.getHelperTitle('fields', 'multiple')"
:message="$i18n.getHelperMessage('fields', 'multiple')"/>
</b-field>
<b-field
:type="formErrors['unique'] != undefined ? 'is-danger' : ''"
:message="formErrors['unique'] != undefined ? formErrors['unique'] : ''">
:type="formErrors['unique'] != undefined ? 'is-danger' : ''"
:message="formErrors['unique'] != undefined ? formErrors['unique'] : ''">
<b-checkbox
@input="clearErrors('unique')"
v-model="editForm.unique"
true-value="yes"
false-value="no"
name="collecion_key">
@input="clearErrors('unique')"
v-model="editForm.unique"
true-value="yes"
false-value="no"
name="collecion_key">
{{ $i18n.get('label_unique_value') }}
</b-checkbox>
<help-button
:title="$i18n.getHelperTitle('fields', 'unique')"
:message="$i18n.getHelperMessage('fields', 'unique')">
</help-button>
:message="$i18n.getHelperMessage('fields', 'unique')"/>
</b-field>
</b-field>
<component
:errors="formErrors['field_type_options']"
v-if="(editForm.field_type_object && editForm.field_type_object.form_component) || editForm.edit_form == ''"
:is="editForm.field_type_object.form_component"
:field="editForm"
v-model="editForm.field_type_options">
</component>
<div v-html="editForm.edit_form" v-else></div>
:errors="formErrors['field_type_options']"
v-if="(editForm.field_type_object && editForm.field_type_object.form_component) || editForm.edit_form == ''"
:is="editForm.field_type_object.form_component"
:field="editForm"
v-model="editForm.field_type_options"/>
<div
v-html="editForm.edit_form"
v-else/>
<div class="field is-grouped form-submit">
<div class="control">
<button class="button is-outlined" @click.prevent="cancelEdition()" slot="trigger">{{ $i18n.get('cancel')}}</button>
<button
class="button is-outlined"
@click.prevent="cancelEdition()"
slot="trigger">{{ $i18n.get('cancel') }}</button>
</div>
<div class="control">
<button class="button is-success" type="submit">{{ $i18n.get('save')}}</button>
<button
class="button is-success"
type="submit">{{ $i18n.get('save') }}</button>
</div>
</div>
<p class="help is-danger">{{formErrorMessage}}</p>
<p class="help is-danger">{{ formErrorMessage }}</p>
</form>
</template>
@ -154,8 +166,8 @@ export default {
},
props: {
index: '',
editedField: {},
originalField: '',
editedField: Object,
originalField: Object,
isRepositoryLevel: false,
collectionId: ''
},

View File

@ -1,85 +1,99 @@
<template>
<form id="filterEditForm" class="tainacan-form" v-on:submit.prevent="saveEdition(editForm)">
<form
id="filterEditForm"
class="tainacan-form"
@submit.prevent="saveEdition(editForm)">
<b-field
:addons="false"
:type="formErrors['name'] != undefined ? 'is-danger' : ''"
:message="formErrors['name'] != undefined ? formErrors['name'] : ''">
:addons="false"
:type="formErrors['name'] != undefined ? 'is-danger' : ''"
:message="formErrors['name'] != undefined ? formErrors['name'] : ''">
<label class="label">
{{$i18n.get('label_name')}}
<span class="required-field-asterisk" :class="formErrors['name'] != undefined ? 'is-danger' : ''">*</span>
{{ $i18n.get('label_name') }}
<span
class="required-field-asterisk"
:class="formErrors['name'] != undefined ? 'is-danger' : ''">*</span>
<help-button
:title="$i18n.getHelperTitle('filters', 'name')"
:message="$i18n.getHelperMessage('filters', 'name')">
</help-button>
:title="$i18n.getHelperTitle('filters', 'name')"
:message="$i18n.getHelperMessage('filters', 'name')"/>
</label>
<b-input v-model="editForm.name" name="name" @focus="clearErrors('name')"></b-input>
<b-input
v-model="editForm.name"
name="name"
@focus="clearErrors('name')"/>
</b-field>
<b-field
:addons="false"
:type="formErrors['description'] != undefined ? 'is-danger' : ''"
:message="formErrors['description'] != undefined ? formErrors['description'] : ''">
:addons="false"
:type="formErrors['description'] != undefined ? 'is-danger' : ''"
:message="formErrors['description'] != undefined ? formErrors['description'] : ''">
<label class="label">
{{$i18n.get('label_description')}}
{{ $i18n.get('label_description') }}
<help-button
:title="$i18n.getHelperTitle('filters', 'description')"
:message="$i18n.getHelperMessage('filters', 'description')">
</help-button>
:title="$i18n.getHelperTitle('filters', 'description')"
:message="$i18n.getHelperMessage('filters', 'description')"/>
</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-field>
<b-field
:addons="false"
:type="formErrors['status'] != undefined ? 'is-danger' : ''"
:message="formErrors['status'] != undefined ? formErrors['status'] : ''">
:addons="false"
:type="formErrors['status'] != undefined ? 'is-danger' : ''"
:message="formErrors['status'] != undefined ? formErrors['status'] : ''">
<label class="label">
{{$i18n.get('label_status')}}
{{ $i18n.get('label_status') }}
<help-button
:title="$i18n.getHelperTitle('filters', 'status')"
:message="$i18n.getHelperMessage('filters', 'status')">
</help-button>
:title="$i18n.getHelperTitle('filters', 'status')"
:message="$i18n.getHelperMessage('filters', 'status')"/>
</label>
<div class="inline-block">
<b-radio
@focus="clearErrors('label_status')"
id="tainacan-select-status-publish"
name="status"
v-model="editForm.status"
native-value="publish">
@focus="clearErrors('label_status')"
id="tainacan-select-status-publish"
name="status"
v-model="editForm.status"
native-value="publish">
{{ $i18n.get('publish_visibility') }}
</b-radio>
<br>
<b-radio
@focus="clearErrors('label_status')"
id="tainacan-select-status-private"
name="status"
v-model="editForm.status"
native-value="private">
@focus="clearErrors('label_status')"
id="tainacan-select-status-private"
name="status"
v-model="editForm.status"
native-value="private">
{{ $i18n.get('private_visibility') }}
</b-radio>
</div>
</b-field>
<component
:errors="formErrors['filter_type_options']"
v-if="(editForm.filter_type_object && editForm.filter_type_object.form_component) || editForm.edit_form == ''"
:is="editForm.filter_type_object.form_component"
:filter="editForm"
v-model="editForm.filter_type_options">
</component>
<div v-html="editForm.edit_form" v-else></div>
:errors="formErrors['filter_type_options']"
v-if="(editForm.filter_type_object && editForm.filter_type_object.form_component) || editForm.edit_form == ''"
:is="editForm.filter_type_object.form_component"
:filter="editForm"
v-model="editForm.filter_type_options"/>
<div
v-html="editForm.edit_form"
v-else/>
<div class="field is-grouped form-submit">
<div class="control">
<button class="button is-outlined" @click.prevent="cancelEdition()" slot="trigger">{{ $i18n.get('cancel')}}</button>
<button
class="button is-outlined"
@click.prevent="cancelEdition()"
slot="trigger">{{ $i18n.get('cancel') }}</button>
</div>
<div class="control">
<button class="button is-success" type="submit">{{ $i18n.get('save')}}</button>
<button
class="button is-success"
type="submit">{{ $i18n.get('save') }}</button>
</div>
</div>
<p class="help is-danger">{{formErrorMessage}}</p>
<p class="help is-danger">{{ formErrorMessage }}</p>
</form>
</template>
@ -99,8 +113,8 @@ export default {
},
props: {
index: '',
editedFilter: {},
originalFilter: {},
editedFilter: Object,
originalFilter: Object,
},
created() {

View File

@ -1,14 +1,19 @@
<template>
<div class="page-container">
<b-tag v-if="!isLoading" :type="'is-' + getStatusColor(item.status)" v-text="item.status"></b-tag>
<form v-if="!isLoading" class="tainacan-form" label-width="120px">
<b-tag
v-if="!isLoading"
:type="'is-' + getStatusColor(item.status)"
v-text="item.status"/>
<form
v-if="!isLoading"
class="tainacan-form"
label-width="120px">
<b-field
:addons="false"
:label="$i18n.get('label_status')">
:addons="false"
:label="$i18n.get('label_status')">
<help-button
:title="$i18n.getHelperTitle('items', 'status')"
:message="$i18n.getHelperMessage('items', 'status')">
</help-button>
:title="$i18n.getHelperTitle('items', 'status')"
:message="$i18n.getHelperMessage('items', 'status')"/>
<b-select
id="status-select"
v-model="form.status"
@ -27,30 +32,36 @@
<b-field :label="$i18n.get('label_image')">
<div class="thumbnail-field">
<b-upload
v-if="item.featured_image == undefined || item.featured_image == false"
v-model="thumbnail"
drag-drop
@input="uploadThumbnail($event)">
v-if="item.featured_image == undefined || item.featured_image == false"
v-model="thumbnail"
drag-drop
@input="uploadThumbnail($event)">
<div class="content has-text-centered">
<p>
<b-icon
icon="upload">
</b-icon>
icon="upload"/>
</p>
<p>{{ $i18n.get('instruction_image_upload_box') }}</p>
</div>
</b-upload>
<div v-else>
<figure class="image is-128x128">
<img :alt="$i18n.get('label_thumbnail')" :src="item.featured_image"/>
<img
:alt="$i18n.get('label_thumbnail')"
:src="item.featured_image">
</figure>
<div class="thumbnail-buttons-row">
<b-upload
model="thumbnail"
@input="uploadThumbnail($event)">
<a id="button-edit" :aria-label="$i18n.get('label_button_edit_thumb')"><b-icon icon="pencil"></a>
model="thumbnail"
@input="uploadThumbnail($event)">
<a
id="button-edit"
:aria-label="$i18n.get('label_button_edit_thumb')"><b-icon icon="pencil"/></a>
</b-upload>
<a id="button-delete" :aria-label="$i18n.get('label_button_delete_thumb')" @click="deleteThumbnail()"><b-icon icon="delete"></a>
<a
id="button-delete"
:aria-label="$i18n.get('label_button_delete_thumb')"
@click="deleteThumbnail()"><b-icon icon="delete"/></a>
</div>
</div>
</div>
@ -59,14 +70,15 @@
<!-- Fields from Collection-------------------------------- -->
<tainacan-form-item
v-for="(field, index) in fieldList"
v-bind:key="index"
:field="field"></tainacan-form-item>
:key="index"
:field="field"/>
<!-- Attachments ------------------------------------------ -->
<div class="columns is-multiline">
<div class="column is-4">
<b-field :label="$i18n.get('label_image')">
<b-upload v-model="form.files"
<b-upload
v-model="form.files"
multiple
drag-drop
@input="uploadAttachment($event)">
@ -75,8 +87,7 @@
<p>
<b-icon
icon="upload"
size="is-large">
</b-icon>
size="is-large"/>
</p>
<p>{{ $i18n.get('instruction_image_upload_box') }}</p>
</div>
@ -84,48 +95,52 @@
</b-upload>
</b-field>
<div class="uploaded-files">
<div v-for="(file, index) in form.files"
:key="index">
<div
v-for="(file, index) in form.files"
:key="index">
<span class="tag is-primary">
{{ file.name }}
<button class="delete is-small"
<button
class="delete is-small"
type="button"
@click="deleteFile(index)">
</button>
@click="deleteFile(index)"/>
</span>
<!-- <progress class="progress is-secondary" value="15" max="100">30%</progress> -->
</div>
</div>
</div>
<div class="column is-narrow"
<div
class="column is-narrow"
v-for="(attachment, index) of item.attachments"
:key="index">
<figure class="image is-128x128">
<img
:alt="attachment.title"
:src="attachment.url"/>
:alt="attachment.title"
:src="attachment.url">
</figure>
</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>
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" :disabled="formHasErrors">{{ $i18n.get('save') }}</button>
id="button-submit-item-creation"
@click.prevent="onSubmit"
class="button is-success"
:disabled="formHasErrors">{{ $i18n.get('save') }}</button>
</div>
</div>
</form>
<b-loading :active.sync="isLoading" :canCancel="false">
</div>
<b-loading
:active.sync="isLoading"
:can-cancel="false"/></div>
</template>
<script>

View File

@ -1,12 +1,14 @@
<template>
<div>
<b-field grouped group-multiline>
<b-field
grouped
group-multiline>
<button
v-if="selectedCategories.length > 0"
class="button field is-danger"
@click="deleteSelectedCategories()">
<span>{{ $i18n.get('instruction_delete_selected_categories') }} </span>
<b-icon icon="delete"></b-icon>
<b-icon icon="delete"/>
</button>
</b-field>
@ -43,7 +45,10 @@
property="description"
show-overflow-tooltip
field="props.row.description">
<router-link class="clickable-row" tag="span" :to="{path: $routerHelper.getCategoryPath(props.row.id)}">
<router-link
class="clickable-row"
tag="span"
:to="{path: $routerHelper.getCategoryPath(props.row.id)}">
{{ props.row.description }}
</router-link>
</b-table-column>
@ -58,13 +63,17 @@
id="button-edit"
:aria-label="$i18n.getFrom('categories','edit_item')"
@click.prevent.stop="goToCategoryEditPage(props.row.id)">
<b-icon type="is-gray" icon="pencil" ></b-icon>
<b-icon
type="is-gray"
icon="pencil" />
</a>
<a
id="button-delete"
:aria-label="$i18n.get('label_button_delete')"
@click.prevent.stop="deleteOneCategory(props.row.id)">
<b-icon type="is-gray" icon="delete" ></b-icon>
<b-icon
type="is-gray"
icon="delete" />
</a>
</b-table-column>
</template>
@ -77,12 +86,13 @@
<p>
<b-icon
icon="inbox"
size="is-large">
</b-icon>
size="is-large"/>
</p>
<p>{{ $i18n.get('info_no_category_created') }}</p>
<router-link tag="button" class="button is-secondary"
:to="{ path: $routerHelper.getNewCategoryPath() }">
<router-link
tag="button"
class="button is-secondary"
:to="{ path: $routerHelper.getNewCategoryPath() }">
{{ $i18n.get('new') + ' ' + $i18n.get('category') }}
</router-link>
</div>
@ -101,7 +111,7 @@
totalCategories: 0,
page: 1,
categoriesPerPage: 12,
categories: []
categories: Array
},
data() {
return {

View File

@ -1,7 +1,12 @@
<template>
<div>
<b-field grouped group-multiline>
<button v-if="selectedCollections.length > 0" class="button field is-danger" @click="deleteSelectedCollections()"><span>{{$i18n.get('instruction_delete_selected_collections')}} </span><b-icon icon="delete"></b-icon></button>
<b-field
grouped
group-multiline>
<button
v-if="selectedCollections.length > 0"
class="button field is-danger"
@click="deleteSelectedCollections()"><span>{{ $i18n.get('instruction_delete_selected_collections') }} </span><b-icon icon="delete"/></button>
</b-field>
<b-table
ref="collectionTable"
@ -15,33 +20,84 @@
backend-sorting>
<template slot-scope="props">
<b-table-column tabindex="0" :label="$i18n.get('label_thumbnail')" :aria-label="$i18n.get('label_thumbnail')" field="featured_image" width="55">
<template v-if="props.row.featured_image" slot-scope="scope">
<router-link tag="img" :to="{path: $routerHelper.getCollectionPath(props.row.id)}" class="table-thumb clickable-row" :src="`${props.row.featured_image}`"></router-link>
<b-table-column
tabindex="0"
:label="$i18n.get('label_thumbnail')"
:aria-label="$i18n.get('label_thumbnail')"
field="featured_image"
width="55">
<template
v-if="props.row.featured_image"
slot-scope="scope">
<router-link
tag="img"
:to="{path: $routerHelper.getCollectionPath(props.row.id)}"
class="table-thumb clickable-row"
:src="`${props.row.featured_image}`"/>
</template>
</b-table-column>
<b-table-column tabindex="0" :label="$i18n.get('label_name')" :aria-label="$i18n.get('label_name')" field="props.row.name">
<router-link class="clickable-row" tag="span" :to="{path: $routerHelper.getCollectionPath(props.row.id)}">
<b-table-column
tabindex="0"
:label="$i18n.get('label_name')"
:aria-label="$i18n.get('label_name')"
field="props.row.name">
<router-link
class="clickable-row"
tag="span"
:to="{path: $routerHelper.getCollectionPath(props.row.id)}">
{{ props.row.name }}
</router-link>
</b-table-column>
<b-table-column tabindex="0" :aria-label="$i18n.get('label_description')" :label="$i18n.get('label_description')" property="description" show-overflow-tooltip field="props.row.description">
<router-link class="clickable-row" tag="span" :to="{path: $routerHelper.getCollectionPath(props.row.id)}">
<b-table-column
tabindex="0"
:aria-label="$i18n.get('label_description')"
:label="$i18n.get('label_description')"
property="description"
show-overflow-tooltip
field="props.row.description">
<router-link
class="clickable-row"
tag="span"
:to="{path: $routerHelper.getCollectionPath(props.row.id)}">
{{ props.row.description }}
</router-link>
</b-table-column>
<b-table-column class="row-creation" tabindex="0" :aria-label="$i18n.get('label_creation') + ': ' + props.row.creation" :label="$i18n.get('label_creation')" property="creation" show-overflow-tooltip field="props.row.creation">
<router-link class="clickable-row" v-html="props.row.creation" tag="span" :to="{path: $routerHelper.getCollectionPath(props.row.id)}">
</router-link>
<b-table-column
class="row-creation"
tabindex="0"
:aria-label="$i18n.get('label_creation') + ': ' + props.row.creation"
:label="$i18n.get('label_creation')"
property="creation"
show-overflow-tooltip
field="props.row.creation">
<router-link
class="clickable-row"
v-html="props.row.creation"
tag="span"
:to="{path: $routerHelper.getCollectionPath(props.row.id)}"/>
</b-table-column>
<b-table-column tabindex="0" :label="$i18n.get('label_actions')" width="78" :aria-label="$i18n.get('label_actions')">
<b-table-column
tabindex="0"
:label="$i18n.get('label_actions')"
width="78"
:aria-label="$i18n.get('label_actions')">
<!-- <a id="button-view" :aria-label="$i18n.get('label_button_view')" @click.prevent.stop="goToCollectionPage(props.row.id)"><b-icon icon="eye"></a> -->
<a id="button-edit" :aria-label="$i18n.getFrom('collections','edit_item')" @click.prevent.stop="goToCollectionEditPage(props.row.id)"><b-icon type="is-gray" icon="pencil"></a>
<a id="button-delete" :aria-label="$i18n.get('label_button_delete')" @click.prevent.stop="deleteOneCollection(props.row.id)"><b-icon type="is-gray" icon="delete"></a>
<a
id="button-edit"
:aria-label="$i18n.getFrom('collections','edit_item')"
@click.prevent.stop="goToCollectionEditPage(props.row.id)"><b-icon
type="is-gray"
icon="pencil"/></a>
<a
id="button-delete"
:aria-label="$i18n.get('label_button_delete')"
@click.prevent.stop="deleteOneCollection(props.row.id)"><b-icon
type="is-gray"
icon="delete"/></a>
</b-table-column>
</template>
@ -52,12 +108,13 @@
<p>
<b-icon
icon="inbox"
size="is-large">
</b-icon>
size="is-large"/>
</p>
<p>{{$i18n.get('info_no_collection_created')}}</p>
<router-link tag="button" class="button is-primary"
:to="{ path: $routerHelper.getNewCollectionPath() }">
<p>{{ $i18n.get('info_no_collection_created') }}</p>
<router-link
tag="button"
class="button is-primary"
:to="{ path: $routerHelper.getNewCollectionPath() }">
{{ $i18n.getFrom('collections', 'new_item') }}
</router-link>
</div>
@ -83,7 +140,7 @@ export default {
totalCollections: 0,
page: 1,
collectionsPerPage: 12,
collections: []
collections: Array
},
methods: {
...mapActions('collection', [

View File

@ -1,77 +1,94 @@
<template>
<div>
<b-loading :active.sync="isLoadingFieldTypes"></b-loading>
<b-loading :active.sync="isLoadingFieldTypes"/>
<div class="page-title">
<h2>{{ isRepositoryLevel ? $i18n.get('instruction_dragndrop_fields_repository') : $i18n.get('instruction_dragndrop_fields_collection')}}</h2>
<h2>{{ isRepositoryLevel ? $i18n.get('instruction_dragndrop_fields_repository') : $i18n.get('instruction_dragndrop_fields_collection') }}</h2>
</div>
<div class="columns">
<div class="column">
<draggable
class="active-fields-area"
@change="handleChange"
:class="{'fields-area-receive': isDraggingFromAvailable}"
:list="activeFieldList"
:options="{
group: { name:'fields', pull: false, put: true },
sort: openedFieldId == '' || openedFieldId == undefined,
disabled: openedFieldId != '' && openedFieldId != undefined,
handle: '.handle',
ghostClass: 'sortable-ghost',
filter: 'not-sortable-item',
animation: '250'}">
class="active-fields-area"
@change="handleChange"
:class="{'fields-area-receive': isDraggingFromAvailable}"
:list="activeFieldList"
:options="{
group: { name:'fields', pull: false, put: true },
sort: openedFieldId == '' || openedFieldId == undefined,
disabled: openedFieldId != '' && openedFieldId != undefined,
handle: '.handle',
ghostClass: 'sortable-ghost',
filter: 'not-sortable-item',
animation: '250'}">
<div
class="active-field-item"
:class="{
'not-sortable-item': field.id == undefined || openedFieldId != '' ,
'not-focusable-item': openedFieldId == field.id,
'disabled-field': field.enabled == false}"
v-for="(field, index) in activeFieldList" :key="index">
class="active-field-item"
:class="{
'not-sortable-item': field.id == undefined || openedFieldId != '' ,
'not-focusable-item': openedFieldId == field.id,
'disabled-field': field.enabled == false
}"
v-for="(field, index) in activeFieldList"
:key="index">
<div class="handle">
<grip-icon></grip-icon>
<grip-icon/>
<span
class="field-name"
:class="{'is-danger': formWithErrors == field.id }">
{{ field.name }}
class="field-name"
:class="{'is-danger': formWithErrors == field.id }">
{{ field.name }}
</span>
<span
v-if="field.id != undefined"
class="label-details">
({{ $i18n.get(field.field_type_object.component) }})
<span class="not-saved" v-if="(editForms[field.id] != undefined && editForms[field.id].saved != true) || field.status == 'auto-draft'">
v-if="field.id != undefined"
class="label-details">
({{ $i18n.get(field.field_type_object.component) }})
<span
class="not-saved"
v-if="(editForms[field.id] != undefined && editForms[field.id].saved != true) || field.status == 'auto-draft'">
{{ $i18n.get('info_not_saved') }}
</span>
</span>
<span class="loading-spinner" v-if="field.id == undefined"></span>
<span class="controls" v-if="field.id !== undefined">
<b-switch size="is-small" v-model="field.enabled" @input="onChangeEnable($event, index)"></b-switch>
<a :style="{ visibility:
<span
class="loading-spinner"
v-if="field.id == undefined"/>
<span
class="controls"
v-if="field.id !== undefined">
<b-switch
size="is-small"
v-model="field.enabled"
@input="onChangeEnable($event, index)"/>
<a
:style="{ visibility:
field.collection_id != collectionId
? 'hidden' : 'visible'
}"
@click.prevent="editField(field)">
<b-icon type="is-gray" icon="pencil"></b-icon>
@click.prevent="editField(field)">
<b-icon
type="is-gray"
icon="pencil"/>
</a>
<a :style="{ visibility:
<a
:style="{ visibility:
field.collection_id != collectionId ||
field.field_type == 'Tainacan\\Field_Types\\Core_Title' ||
field.field_type == 'Tainacan\\Field_Types\\Core_Description'
? 'hidden' : 'visible'
}"
@click.prevent="removeField(field)">
<b-icon type="is-gray" icon="delete"></b-icon>
@click.prevent="removeField(field)">
<b-icon
type="is-gray"
icon="delete"/>
</a>
</span>
</div>
<div v-if="openedFieldId == field.id">
<field-edition-form
:collectionId="collectionId"
:isRepositoryLevel="isRepositoryLevel"
@onEditionFinished="onEditionFinished()"
@onEditionCanceled="onEditionCanceled()"
@onErrorFound="formWithErrors = field.id"
:index="index"
:originalField="field"
:editedField="editForms[field.id]"></field-edition-form>
:collection-id="collectionId"
:is-repository-level="isRepositoryLevel"
@onEditionFinished="onEditionFinished()"
@onEditionCanceled="onEditionCanceled()"
@onErrorFound="formWithErrors = field.id"
:index="index"
:original-field="field"
:edited-field="editForms[field.id]"/>
</div>
</div>
</draggable>
@ -79,23 +96,25 @@
<div class="column available-fields-area" >
<div class="field">
<h3 class="label">{{ $i18n.get('label_available_field_types')}}</h3>
<h3 class="label">{{ $i18n.get('label_available_field_types') }}</h3>
<draggable
:list="availableFieldList"
:options="{
sort: false,
group: { name:'fields', pull: 'clone', put: false, revertClone: true },
dragClass: 'sortable-drag'
}">
:list="availableFieldList"
:options="{
sort: false,
group: { name:'fields', pull: 'clone', put: false, revertClone: true },
dragClass: 'sortable-drag'
}">
<div
@click.prevent="addFieldViaButton(field)"
class="available-field-item"
:class="{ 'hightlighted-field' : hightlightedField == field.name }"
v-for="(field, index) in availableFieldList"
:key="index">
<grip-icon></grip-icon>
@click.prevent="addFieldViaButton(field)"
class="available-field-item"
:class="{ 'hightlighted-field' : hightlightedField == field.name }"
v-for="(field, index) in availableFieldList"
:key="index">
<grip-icon/>
<span class="field-name">{{ field.name }}</span>
<span class="loading-spinner" v-if="hightlightedField == field.name"></span>
<span
class="loading-spinner"
v-if="hightlightedField == field.name"/>
</div>
</draggable>
</div>

View File

@ -3,8 +3,8 @@
<tainacan-filters-list
:query="getPostQuery()"
v-for="(filter, index) in filters"
v-bind:key="index"
:filter="filter"></tainacan-filters-list>
:key="index"
:filter="filter"/>
</div>
</template>
<script>

View File

@ -1,120 +1,136 @@
<template>
<div>
<b-loading :active.sync="isLoadingFieldTypes"></b-loading>
<b-loading :active.sync="isLoadingFieldTypes"/>
<div class="page-title">
<h2>{{ isRepositoryLevel ? $i18n.get('instruction_dragndrop_filters_collection') : $i18n.get('instruction_dragndrop_filters_collection') }}</h2>
</div>
<div class="columns">
<div class="column">
<draggable
class="active-filters-area"
@change="handleChange"
:class="{'filters-area-receive': isDraggingFromAvailable}"
:list="activeFilterList"
:options="{
group: { name:'filters', pull: false, put: true },
sort: openedFilterId == '' || openedFilterId == undefined,
disabled: openedFilterId != '' && openedFilterId != undefined,
handle: '.handle',
ghostClass: 'sortable-ghost',
filter: 'not-sortable-item',
animation: '250'}">
class="active-filters-area"
@change="handleChange"
:class="{'filters-area-receive': isDraggingFromAvailable}"
:list="activeFilterList"
:options="{
group: { name:'filters', pull: false, put: true },
sort: openedFilterId == '' || openedFilterId == undefined,
disabled: openedFilterId != '' && openedFilterId != undefined,
handle: '.handle',
ghostClass: 'sortable-ghost',
filter: 'not-sortable-item',
animation: '250'}">
<div
class="active-filter-item"
:class="{
'not-sortable-item': filter.id == undefined || openedFilterId != '' || choosenField.name == filter.name,
'not-focusable-item': openedFilterId == filter.id,
'disabled-filter': filter.enabled == false
}"
v-for="(filter, index) in activeFilterList" :key="index">
<div class="handle">
<grip-icon></grip-icon>
<span
class="active-filter-item"
:class="{
'not-sortable-item': filter.id == undefined || openedFilterId != '' || choosenField.name == filter.name,
'not-focusable-item': openedFilterId == filter.id,
'disabled-filter': filter.enabled == false
}"
v-for="(filter, index) in activeFilterList"
:key="index">
<div class="handle">
<grip-icon/>
<span
class="filter-name"
:class="{'is-danger': formWithErrors == filter.id }">
{{ filter.name }}
</span>
<span
v-if="filter.filter_type_object != undefined"
class="label-details">
({{ $i18n.get(filter.filter_type_object.component) }})
<span class="not-saved" v-if="(editForms[filter.id] != undefined && editForms[filter.id].saved != true) ||filter.status == 'auto-draft'">
</span>
<span
v-if="filter.filter_type_object != undefined"
class="label-details">
({{ $i18n.get(filter.filter_type_object.component) }})
<span
class="not-saved"
v-if="(editForms[filter.id] != undefined && editForms[filter.id].saved != true) ||filter.status == 'auto-draft'">
{{ $i18n.get('info_not_saved') }}
</span>
</span>
<span class="loading-spinner" v-if="filter.id == undefined"></span>
<span class="controls" v-if="filter.filter_type != undefined">
<b-switch size="is-small" v-model="filter.enabled" @input="onChangeEnable($event, index)"></b-switch>
<a :style="{ visibility: filter.collection_id != collectionId ? 'hidden' : 'visible' }"
</span>
</span>
<span
class="loading-spinner"
v-if="filter.id == undefined"/>
<span
class="controls"
v-if="filter.filter_type != undefined">
<b-switch
size="is-small"
v-model="filter.enabled"
@input="onChangeEnable($event, index)"/>
<a
:style="{ visibility: filter.collection_id != collectionId ? 'hidden' : 'visible' }"
@click.prevent="editFilter(filter)">
<b-icon type="is-gray" icon="pencil"></b-icon>
</a>
<a :style="{ visibility: filter.collection_id != collectionId ? 'hidden' : 'visible' }"
<b-icon
type="is-gray"
icon="pencil"/>
</a>
<a
:style="{ visibility: filter.collection_id != collectionId ? 'hidden' : 'visible' }"
@click.prevent="removeFilter(filter)">
<b-icon type="is-gray" icon="delete"></b-icon>
</a>
</span>
</div>
<div v-if="choosenField.name == filter.name && openedFilterId == ''">
<form class="tainacan-form">
<b-field :label="$i18n.get('label_filter_type')">
<b-select
v-model="selectedFilterType"
:placeholder="$i18n.get('instruction_select_a_filter_type')">
<option
<b-icon
type="is-gray"
icon="delete"/>
</a>
</span>
</div>
<div v-if="choosenField.name == filter.name && openedFilterId == ''">
<form class="tainacan-form">
<b-field :label="$i18n.get('label_filter_type')">
<b-select
v-model="selectedFilterType"
:placeholder="$i18n.get('instruction_select_a_filter_type')">
<option
v-for="(filterType, index) in allowedFilterTypes"
:key="index"
:selected="index == 0"
:value="filterType">
{{ filterType.name }}</option>
</b-select>
</b-field>
<div class="field is-grouped form-submit">
<div class="control">
<button
</b-select>
</b-field>
<div class="field is-grouped form-submit">
<div class="control">
<button
class="button is-outlined"
@click.prevent="cancelFilterTypeSelection()"
slot="trigger">{{ $i18n.get('cancel')}}</button>
</div>
<div class="control">
<button
slot="trigger">{{ $i18n.get('cancel') }}</button>
</div>
<div class="control">
<button
class="button is-success"
type="submit"
:disabled="Object.keys(selectedFilterType).length == 0"
@click.prevent="confirmSelectedFilterType()">{{ $i18n.get('next')}}</button>
</div>
@click.prevent="confirmSelectedFilterType()">{{ $i18n.get('next') }}</button>
</div>
</form>
</div>
<b-field v-if="openedFilterId == filter.id">
<filter-edition-form
</div>
</form>
</div>
<b-field v-if="openedFilterId == filter.id">
<filter-edition-form
@onEditionFinished="onEditionFinished()"
@onEditionCanceled="onEditionCanceled()"
@onErrorFound="formWithErrors = filter.id"
:index="index"
:originalFilter="filter"
:editedFilter="editForms[openedFilterId]"></filter-edition-form>
</b-field>
</div>
:original-filter="filter"
:edited-filter="editForms[openedFilterId]"/>
</b-field>
</div>
</draggable>
</div>
<div class="column available-fields-area">
<div class="field">
<h3 class="label"> {{ $i18n.get('label_available_field_types') }}</h3>
<draggable
:list="availableFieldList"
:options="{
sort: false,
group: { name:'filters', pull: true, put: false, revertClone: true },
dragClass: 'sortable-drag'
}">
:list="availableFieldList"
:options="{
sort: false,
group: { name:'filters', pull: true, put: false, revertClone: true },
dragClass: 'sortable-drag'
}">
<div
class="available-field-item"
v-for="(field, index) in availableFieldList"
:key="index"
@click.prevent="addFieldViaButton(field, index)">
<grip-icon></grip-icon>
class="available-field-item"
v-for="(field, index) in availableFieldList"
:key="index"
@click.prevent="addFieldViaButton(field, index)">
<grip-icon/>
<span class="field-name">{{ field.name }}</span>
</div>
</draggable>

View File

@ -1,7 +1,14 @@
<template>
<div>
<b-field grouped group-multiline>
<button v-if="selectedItems.length > 0" class="button field is-danger" @click="deleteSelectedItems()"><span>{{$i18n.get('instruction_delete_selected_items')}} </span><b-icon icon="delete"></b-icon></button>
<b-field
grouped
group-multiline>
<button
v-if="selectedItems.length > 0"
class="button field is-danger"
@click="deleteSelectedItems()">
<span>{{ $i18n.get('instruction_delete_selected_items') }} </span><b-icon icon="delete"/>
</button>
</b-field>
<b-table
ref="itemsTable"
@ -15,27 +22,44 @@
selectable
backend-sorting>
<template slot-scope="props">
<b-table-column v-for="(column, index) in tableFields"
:key="index"
:label="column.label"
:visible="column.visible"
:width="column.field == 'row_actions' ? 78 : column.field == 'featured_image' ? 55 : undefined ">
<router-link tag="span" class="clickable-row" :to="{path: $routerHelper.getItemPath(collectionId, props.row.id)}">
<b-table-column
v-for="(column, index) in tableFields"
:key="index"
:label="column.label"
:visible="column.visible"
:width="column.field == 'row_actions' ? 78 : column.field == 'featured_image' ? 55 : undefined ">
<router-link
tag="span"
class="clickable-row"
:to="{path: $routerHelper.getItemPath(collectionId, props.row.id)}">
<template v-if="column.field != 'featured_image' && column.field != 'row_actions'">
{{ showValue( props.row.metadata[column.slug] ) }}
{{ showValue( props.row.metadata[column.slug] ) }}
</template>
</router-link>
<template v-if="column.field == 'featured_image'">
<router-link tag="img" class="table-thumb clickable-row" :to="{path: $routerHelper.getItemPath(collectionId, props.row.id)}" :src="props.row[column.slug]"></router-link>
<router-link
tag="img"
class="table-thumb clickable-row"
:to="{path: $routerHelper.getItemPath(collectionId, props.row.id)}"
:src="props.row[column.slug]"/>
</template>
<template v-if="column.field == 'row_actions'">
<!-- <a id="button-view" @click.prevent.stop="goToItemPage(props.row.id)"><b-icon icon="eye"></a> -->
<a id="button-edit" :aria-label="$i18n.getFrom('items','edit_item')" @click="goToItemEditPage(props.row.id)"><b-icon type="is-gray" icon="pencil"></a>
<a id="button-delete" :aria-label="$i18n.get('label_button_delete')" @click="deleteOneItem(props.row.id)"><b-icon type="is-gray" icon="delete"></a>
<a
id="button-edit"
:aria-label="$i18n.getFrom('items','edit_item')"
@click="goToItemEditPage(props.row.id)"><b-icon
type="is-gray"
icon="pencil"/></a>
<a
id="button-delete"
:aria-label="$i18n.get('label_button_delete')"
@click="deleteOneItem(props.row.id)"><b-icon
type="is-gray"
icon="delete"/></a>
</template>
</b-table-column>
@ -46,15 +70,15 @@
<div class="content has-text-grey has-text-centered">
<p>
<b-icon
icon="inbox"
size="is-large">
</b-icon>
icon="inbox"
size="is-large"/>
</p>
<p>{{$i18n.get('info_no_item_created')}}</p>
<p>{{ $i18n.get('info_no_item_created') }}</p>
<router-link
id="button-create"
tag="button" class="button is-primary"
:to="{ path: $routerHelper.getNewItemPath(collectionId) }">
id="button-create"
tag="button"
class="button is-primary"
:to="{ path: $routerHelper.getNewItemPath(collectionId) }">
{{ $i18n.getFrom('items', 'new_item') }}
</router-link>
</div>
@ -76,12 +100,12 @@ export default {
},
props: {
collectionId: Number,
tableFields: [],
prefTableFields: [],
tableFields: Array,
prefTableFields: Array,
totalItems: 0,
page: 1,
itemsPerPage: 12,
items: [],
items: Array,
isLoading: false
},
methods: {

View File

@ -1,11 +1,25 @@
<template>
<nav id="primary-menu" :class="isCompressed ? 'is-compressed' : ''" role="navigation" :aria-label="$i18n.get('label_main_menu')" class="column is-sidebar-menu">
<nav
id="primary-menu"
:class="isCompressed ? 'is-compressed' : ''"
role="navigation"
:aria-label="$i18n.get('label_main_menu')"
class="column is-sidebar-menu">
<aside class="menu">
<div class="menu-header">
<ul class="menu-list"><li><router-link tag="a" to="/">
<b-icon size="is-medium" icon="chevron-left"></b-icon>
<img class="tainacan-logo" alt="Tainacan Logo" :src="logoHeader"/>
</router-link></li></ul>
<ul class="menu-list"><li>
<router-link
tag="a"
to="/">
<b-icon
size="is-medium"
icon="chevron-left"/>
<img
class="tainacan-logo"
alt="Tainacan Logo"
:src="logoHeader">
</router-link>
</li></ul>
</div>
<ul class="menu-list">
@ -15,32 +29,65 @@
:placeholder="$i18n.get('search')"
type="search"
size="is-small"
icon="magnify">
</b-input>
icon="magnify"/>
</b-field>
<router-link tag="a" to="">
<b-icon size="is-small" icon="magnify"></b-icon> <span class="menu-text">{{ $i18n.get('advanced_search')}}</span>
<router-link
tag="a"
to="">
<b-icon
size="is-small"
icon="magnify"/> <span class="menu-text">{{ $i18n.get('advanced_search') }}</span>
</router-link>
</li>
<li class="separator"></li>
<li><router-link tag="a" to="/collections" :class="activeRoute == 'CollectionsPage' || isCompressed ? 'is-active':''">
<b-icon size="is-small" icon="folder-multiple"></b-icon> <span class="menu-text">{{ $i18n.getFrom('collections', 'name') }}</span>
<li class="separator"/>
<li><router-link
tag="a"
to="/collections"
:class="activeRoute == 'CollectionsPage' || isCompressed ? 'is-active':''">
<b-icon
size="is-small"
icon="folder-multiple"/> <span class="menu-text">{{ $i18n.getFrom('collections', 'name') }}</span>
</router-link></li>
<li><router-link tag="a" to="/items" :class="activeRoute == 'ItemsPage' ? 'is-active':''">
<b-icon size="is-small" icon="file-multiple"></b-icon> <span class="menu-text">{{ $i18n.getFrom('items', 'name') }}</span>
<li><router-link
tag="a"
to="/items"
:class="activeRoute == 'ItemsPage' ? 'is-active':''">
<b-icon
size="is-small"
icon="file-multiple"/> <span class="menu-text">{{ $i18n.getFrom('items', 'name') }}</span>
</router-link></li>
<li class="separator"></li>
<li><router-link tag="a" to="/fields" :class="activeRoute == 'FieldsPage' ? 'is-active':''">
<b-icon size="is-small" icon="format-list-checks"></b-icon> <span class="menu-text">{{ $i18n.getFrom('fields', 'name') }}</span>
<li class="separator"/>
<li><router-link
tag="a"
to="/fields"
:class="activeRoute == 'FieldsPage' ? 'is-active':''">
<b-icon
size="is-small"
icon="format-list-checks"/> <span class="menu-text">{{ $i18n.getFrom('fields', 'name') }}</span>
</router-link></li>
<li><router-link tag="a" to="/filters" :class="activeRoute == 'FiltersPage' ? 'is-active':''">
<b-icon size="is-small" icon="filter"></b-icon> <span class="menu-text">{{ $i18n.getFrom('filters', 'name') }}</span>
<li><router-link
tag="a"
to="/filters"
:class="activeRoute == 'FiltersPage' ? 'is-active':''">
<b-icon
size="is-small"
icon="filter"/> <span class="menu-text">{{ $i18n.getFrom('filters', 'name') }}</span>
</router-link></li>
<li><router-link tag="a" to="/categories" :class="activeRoute == 'CategoriesPage' ? 'is-active':''">
<b-icon size="is-small" icon="shape"></b-icon> <span class="menu-text">{{ $i18n.getFrom('categories', 'name') }}</span>
<li><router-link
tag="a"
to="/categories"
:class="activeRoute == 'CategoriesPage' ? 'is-active':''">
<b-icon
size="is-small"
icon="shape"/> <span class="menu-text">{{ $i18n.getFrom('categories', 'name') }}</span>
</router-link></li>
<li><router-link tag="a" to="/events" :class="activeRoute == 'EventsPage' ? 'is-active':''">
<b-icon size="is-small" icon="bell"></b-icon> <span class="menu-text">{{ $i18n.get('events') }}</span>
<li><router-link
tag="a"
to="/events"
:class="activeRoute == 'EventsPage' ? 'is-active':''">
<b-icon
size="is-small"
icon="bell"/> <span class="menu-text">{{ $i18n.get('events') }}</span>
</router-link></li>
</ul>
</aside>

View File

@ -1,11 +1,25 @@
<template>
<nav id="secondary-menu" role="navigation" :aria-label="$i18n.get('label_collection_menu')" class="column is-sidebar-menu">
<nav
id="secondary-menu"
role="navigation"
:aria-label="$i18n.get('label_collection_menu')"
class="column is-sidebar-menu">
<aside class="menu">
<div class="menu-header">
<ul class="menu-list"><li><router-link tag="a" to="/" target='_blank'>
<b-icon size="is-medium" icon="chevron-left"></b-icon>
<img class="tainacan-logo" alt="Tainacan Logo" :src="logoHeader"/>
</router-link></li></ul>
<ul class="menu-list"><li>
<router-link
tag="a"
to="/"
target='_blank'>
<b-icon
size="is-medium"
icon="chevron-left"/>
<img
class="tainacan-logo"
alt="Tainacan Logo"
:src="logoHeader">
</router-link>
</li></ul>
</div>
<ul class="menu-list">
@ -15,41 +29,52 @@
:placeholder="$i18n.getFrom('items', 'search_items')"
type="search"
size="is-small"
icon="magnify">
</b-input>
icon="magnify"/>
</b-field>
<router-link tag="a" to="">
<b-icon size="is-small" icon="magnify"></b-icon> <span class="menu-text">{{ $i18n.get('advanced_search')}}</span>
<router-link
tag="a"
to="">
<b-icon
size="is-small"
icon="magnify"/> <span class="menu-text">{{ $i18n.get('advanced_search') }}</span>
</router-link>
</li>
<li class="separator"></li>
<li class="separator"/>
<li><router-link
tag="a"
:to="{ path: $routerHelper.getCollectionItemsPath(id, '') }"
:class="activeRoute == 'ItemPage' || activeRoute == 'CollectionItemsPage' || activeRoute == 'ItemEditionForm' || activeRoute == 'ItemCreatePage' ? 'is-active':''"
:aria-label="$i18n.get('label_collection_fields')">
<b-icon size="is-small" icon="file-multiple"></b-icon> <span class="menu-text">{{ $i18n.getFrom('items', 'name') }}</span>
<b-icon
size="is-small"
icon="file-multiple"/> <span class="menu-text">{{ $i18n.getFrom('items', 'name') }}</span>
</router-link></li>
<li><router-link
tag="a"
:to="{ path: $routerHelper.getCollectionEditPath(id) }"
:class="activeRoute == 'CollectionEditionForm' ? 'is-active':''"
:aria-label="$i18n.getFrom('collections','edit_item')">
<b-icon size="is-small" icon="pencil"></b-icon> <span class="menu-text">{{ $i18n.get('edit') }}</span>
<b-icon
size="is-small"
icon="pencil"/> <span class="menu-text">{{ $i18n.get('edit') }}</span>
</router-link></li>
<li><router-link
tag="a"
:to="{ path: $routerHelper.getCollectionFieldsPath(id) }"
:class="activeRoute == 'FieldsList' ? 'is-active':''"
:aria-label="$i18n.get('label_collection_fields')">
<b-icon size="is-small" icon="format-list-checks"></b-icon> <span class="menu-text">{{ $i18n.getFrom('fields', 'name') }}</span>
<b-icon
size="is-small"
icon="format-list-checks"/> <span class="menu-text">{{ $i18n.getFrom('fields', 'name') }}</span>
</router-link></li>
<li><router-link
tag="a"
:to="{ path: $routerHelper.getCollectionFiltersPath(id) }"
:class="activeRoute == 'FiltersList' ? 'is-active':''"
:aria-label="$i18n.get('label_collection_filters')">
<b-icon size="is-small" icon="filter"></b-icon> <span class="menu-text">{{ $i18n.getFrom('filters', 'name') }}</span>
<b-icon
size="is-small"
icon="filter"/> <span class="menu-text">{{ $i18n.getFrom('filters', 'name') }}</span>
</router-link></li>
</ul>
</aside>

View File

@ -1,15 +1,24 @@
<template>
<div id="tainacan-header" class="level" :class="{'secondary-page': onSecondaryPage}">
<div
id="tainacan-header"
class="level"
:class="{'secondary-page': onSecondaryPage}">
<div class="level-left">
<div class="level-item">
<h1 class="has-text-weight-bold is-uppercase has-text-primary"><b-icon size="is-small" :icon="currentIcon"></b-icon>{{pageTitle}}</h1>
<h1 class="has-text-weight-bold is-uppercase has-text-primary"><b-icon
size="is-small"
:icon="currentIcon"/>{{ pageTitle }}</h1>
<nav class="breadcrumbs">
<router-link tag="a" :to="$routerHelper.getCollectionsPath()">{{ $i18n.get('repository') }}</router-link> >
<span v-for="(pathItem, index) in arrayRealPath" :key="index">
<router-link
<router-link
tag="a"
:to="'/' + arrayRealPath.slice(0, index + 1).join('/')">
{{ arrayViewPath[index] }}
:to="$routerHelper.getCollectionsPath()">{{ $i18n.get('repository') }}</router-link> >
<span
v-for="(pathItem, index) in arrayRealPath"
:key="index">
<router-link
tag="a"
:to="'/' + arrayRealPath.slice(0, index + 1).join('/')">
{{ arrayViewPath[index] }}
</router-link>
<span v-if="index != arrayRealPath.length - 1"> > </span>
</span>
@ -17,8 +26,10 @@
</div>
</div>
<div class="level-right">
<a class="level-item" :href="wordpressAdmin">
<b-icon icon="close"></b-icon>
<a
class="level-item"
:href="wordpressAdmin">
<b-icon icon="close"/>
</a>
</div>
</div>

View File

@ -1,5 +1,46 @@
<template>
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 12.8 12.8" class="grip-icon"><circle cx="1.5" cy="1.5" r="1.5" class="undefined"/><circle cx="6.4" cy="1.5" r="1.5" class="undefined"/><circle cx="11.3" cy="1.5" r="1.5" class="undefined"/><circle cx="1.5" cy="6.4" r="1.5" class="undefined"/><circle cx="6.4" cy="6.4" r="1.5" class="undefined"/><circle cx="11.3" cy="6.4" r="1.5" class="undefined"/><circle cx="1.5" cy="11.3" r="1.5" class="undefined"/><circle cx="6.4" cy="11.3" r="1.5" class="undefined"/><circle cx="11.3" cy="11.3" r="1.5" class="undefined"/></svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="13"
height="13"
viewBox="0 0 12.8 12.8"
class="grip-icon"><circle
cx="1.5"
cy="1.5"
r="1.5"
class="undefined"/><circle
cx="6.4"
cy="1.5"
r="1.5"
class="undefined"/><circle
cx="11.3"
cy="1.5"
r="1.5"
class="undefined"/><circle
cx="1.5"
cy="6.4"
r="1.5"
class="undefined"/><circle
cx="6.4"
cy="6.4"
r="1.5"
class="undefined"/><circle
cx="11.3"
cy="6.4"
r="1.5"
class="undefined"/><circle
cx="1.5"
cy="11.3"
r="1.5"
class="undefined"/><circle
cx="6.4"
cy="11.3"
r="1.5"
class="undefined"/><circle
cx="11.3"
cy="11.3"
r="1.5"
class="undefined"/></svg>
</template>
<script>

View File

@ -1,9 +1,15 @@
<template>
<span class="help-wrapper">
<a class="help-button" @click="isOpened = !isOpened"><b-icon size="is-small" icon="help-circle-outline"></b-icon></a>
<div class="help-tooltip" :class="{ 'opened': isOpened }">
<a
class="help-button"
@click="isOpened = !isOpened"><b-icon
size="is-small"
icon="help-circle-outline"/></a>
<div
class="help-tooltip"
:class="{ 'opened': isOpened }">
<div class="help-tooltip-header">
<h5>{{ title }}</h5><a @click="isOpened = false"><b-icon icon="close"></b-icon></a>
<h5>{{ title }}</h5><a @click="isOpened = false"><b-icon icon="close"/></a>
</div>
<div class="help-tooltip-body">
<p>{{ (message != '' && message != undefined) ? message : $i18n.get('info_no_description_provided') }}</p>

View File

@ -1,10 +1,14 @@
<template>
<div>
<div class="primary-page page-container-small">
<div class="sub-header" v-if="totalCategories > 0">
<div
class="sub-header"
v-if="totalCategories > 0">
<div class="header-item">
<router-link tag="button" class="button is-secondary"
:to="{ path: $routerHelper.getNewCategoryPath() }">
<router-link
tag="button"
class="button is-secondary"
:to="{ path: $routerHelper.getNewCategoryPath() }">
{{ $i18n.get('new') + ' ' + $i18n.get('category') }}
</router-link>
</div>
@ -13,14 +17,15 @@
<div class="columns above-subheader">
<div class="column table-container">
<categories-list
:isLoading="isLoading"
:totalCategories="totalCategories"
:is-loading="isLoading"
:total-categories="totalCategories"
:page="page"
:categoriesPerPage="categoriesPerPage"
:categories="categories">
</categories-list>
:categories-per-page="categoriesPerPage"
:categories="categories"/>
<!-- Footer -->
<div class="table-footer" v-if="totalCategories > 0">
<div
class="table-footer"
v-if="totalCategories > 0">
<div class="shown-items">
{{
$i18n.get('info_showing_categories') +
@ -31,7 +36,9 @@
}}
</div>
<div class="items-per-page">
<b-field horizontal :label="$i18n.get('label_categories_per_page')">
<b-field
horizontal
:label="$i18n.get('label_categories_per_page')">
<b-select
:value="categoriesPerPage"
@input="onChangeCategoriesPerPage"
@ -50,8 +57,7 @@
:current.sync="page"
order="is-centered"
size="is-small"
:per-page="categoriesPerPage">
</b-pagination>
:per-page="categoriesPerPage"/>
</div>
</div>
</div>

View File

@ -2,8 +2,10 @@
<div class="primary-page page-container-small">
<div class="sub-header">
<div class="header-item">
<router-link tag="button" class="button is-secondary"
:to="{ path: $routerHelper.getNewCollectionPath() }">
<router-link
tag="button"
class="button is-secondary"
:to="{ path: $routerHelper.getNewCollectionPath() }">
{{ $i18n.getFrom('collections', 'new_item') }}
</router-link>
</div>
@ -14,12 +16,11 @@
</aside>
<div class="column table-container">
<collections-list
:isLoading="isLoading"
:totalCollections="totalCollections"
:page="page"
:collectionsPerPage="collectionsPerPage"
:collections="collections">
</collections-list>
:is-loading="isLoading"
:total-collections="totalCollections"
:page="page"
:collections-per-page="collectionsPerPage"
:collections="collections"/>
<!-- Footer -->
<div class="table-footer">
<div class="shown-items">
@ -32,7 +33,9 @@
}}
</div>
<div class="items-per-page">
<b-field horizontal :label="$i18n.get('label_collections_per_page')">
<b-field
horizontal
:label="$i18n.get('label_collections_per_page')">
<b-select
:value="collectionsPerPage"
@input="onChangeCollectionsPerPage"
@ -46,13 +49,12 @@
</div>
<div class="pagination">
<b-pagination
@change="onPageChange"
:total="totalCollections"
:current.sync="page"
order="is-centered"
size="is-small"
:per-page="collectionsPerPage">
</b-pagination>
@change="onPageChange"
:total="totalCollections"
:current.sync="page"
order="is-centered"
size="is-small"
:per-page="collectionsPerPage"/>
</div>
</div>
</div>

View File

@ -1,6 +1,6 @@
<template>
<div class="primary-page page-container">
<fields-list></fields-list>
<fields-list/>
</div>
</template>

View File

@ -1,6 +1,6 @@
<template>
<div class="primary-page page-container">
<filters-list></filters-list>
<filters-list/>
</div>
</template>

View File

@ -1,25 +1,34 @@
<template>
<div class="page-container-small" :class="{'primary-page': isRepositoryLevel}">
<div
class="page-container-small"
:class="{'primary-page': isRepositoryLevel}">
<div class="sub-header">
<div class="header-item">
<router-link tag="button" class="button is-secondary"
<router-link
tag="button"
class="button is-secondary"
:to="{ path: $routerHelper.getNewItemPath(collectionId) }">
{{ $i18n.getFrom('items', 'new_item') }}
</router-link>
</div>
<div class="header-item">
<b-dropdown>
<button class="button" slot="trigger" :disabled="items.length <= 0">
<span>{{$i18n.get('label_table_fields')}}</span>
<b-icon icon="menu-down"></b-icon>
<button
class="button"
slot="trigger"
:disabled="items.length <= 0">
<span>{{ $i18n.get('label_table_fields') }}</span>
<b-icon icon="menu-down"/>
</button>
<b-dropdown-item v-for="(column, index) in tableFields"
:key="index"
class="control" custom>
<b-dropdown-item
v-for="(column, index) in tableFields"
:key="index"
class="control"
custom>
<b-checkbox
@input="onChangeTableFields(column)"
v-model="column.visible"
:native-value="column.field">
@input="onChangeTableFields(column)"
v-model="column.visible"
:native-value="column.field">
{{ column.label }}
</b-checkbox>
</b-dropdown-item>
@ -29,19 +38,18 @@
<div class="columns above-subheader">
<aside class="column filters-menu">
<h3>{{ $i18n.get('filters') }}</h3>
<filters-items-list></filters-items-list>
<filters-items-list/>
</aside>
<div class="column table-container">
<items-list
:collection-id="collectionId"
:tableFields="tableFields"
:prefTableFields="prefTableFields"
:totalItems="totalItems"
:page="page"
:items="items"
:isLoading="isLoading"
:itemsPerPage="itemsPerPage">
</items-list>
:collection-id="collectionId"
:table-fields="tableFields"
:pref-table-fields="prefTableFields"
:total-items="totalItems"
:page="page"
:items="items"
:is-loading="isLoading"
:items-per-page="itemsPerPage"/>
<!-- Footer -->
<div class="table-footer">
<div class="shown-items">
@ -54,7 +62,9 @@
}}
</div>
<div class="items-per-page">
<b-field horizontal :label="$i18n.get('label_items_per_page')">
<b-field
horizontal
:label="$i18n.get('label_items_per_page')">
<b-select
:value="itemsPerPage"
@input="onChangeItemsPerPage"
@ -68,13 +78,12 @@
</div>
<div class="pagination">
<b-pagination
@change="onPageChange"
:total="totalItems"
:current.sync="page"
order="is-centered"
size="is-small"
:per-page="itemsPerPage">
</b-pagination>
@change="onPageChange"
:total="totalItems"
:current.sync="page"
order="is-centered"
size="is-small"
:per-page="itemsPerPage"/>
</div>
</div>
</div>

View File

@ -1,8 +1,8 @@
<template>
<div class="columns is-fullheight">
<secondary-menu :id="collectionId"></secondary-menu>
<secondary-menu :id="collectionId"/>
<section class="column is-secondary-content">
<router-view class="page-container"></router-view>
<router-view class="page-container"/>
</section>
</div>
</template>

View File

@ -1,12 +1,17 @@
<template>
<div>
<b-loading :active.sync="isLoading" :canCancel="false">
</b-loading>
<b-loading
:active.sync="isLoading"
:can-cancel="false"/>
<div class="card">
<div class="card-image" v-if="item.featured_image">
<div
class="card-image"
v-if="item.featured_image">
<figure class="image is-4by3">
<img :src="item.featured_image" class="image" :alt="item.title">
<img
:src="item.featured_image"
class="image"
:alt="item.title">
</figure>
</div>
<div class="card-content">
@ -18,16 +23,18 @@
</div>
<div class="content">
{{item.description}}
{{ item.description }}
</div>
</div>
<footer class="card-footer">
<router-link
class="card-footer-item" :to="{ path: $routerHelper.getCollectionPath(collectionId)}">
class="card-footer-item"
:to="{ path: $routerHelper.getCollectionPath(collectionId)}">
{{ $i18n.get('see') + ' ' + $i18n.get('collection') }}
</router-link>
<router-link
class="card-footer-item" :to="{ path: $routerHelper.getItemEditPath(collectionId, itemId)}">
class="card-footer-item"
:to="{ path: $routerHelper.getItemEditPath(collectionId, itemId)}">
{{ $i18n.get('edit') + ' ' + $i18n.get('item') }}
</router-link>
</footer>

View File

@ -2,8 +2,10 @@
<div>
<span>
<a
class="button"
@click="showForm = !showForm"><b-icon size="is-small" icon="plus"></b-icon>&nbsp;{{ $i18n.get('label_add_new_term') }}</a>
class="button"
@click="showForm = !showForm"><b-icon
size="is-small"
icon="plus"/>&nbsp;{{ $i18n.get('label_add_new_term') }}</a>
</span>
<div class="columns">
<transition name="fade">
@ -14,24 +16,26 @@
style="padding-left: 0px;">
<b-field :label="$i18n.get('label_name')">
<b-input v-model="name"></b-input>
<b-input v-model="name"/>
</b-field>
<b-field :label="$i18n.get('label_parent_term')">
<b-select
v-model="parent">
<option :value="0" selected> ---{{ $i18n.get('label_parent_term') }}--- </option>
<option
:value="0"
selected> ---{{ $i18n.get('label_parent_term') }}--- </option>
<option
v-for="(option,index) in options"
:key="index"
:value="option.term_id"
v-html="setSpaces( option.level ) + option.name"></option>
v-html="setSpaces( option.level ) + option.name"/>
</b-select>
</b-field>
<a
class="button is-primary"
@click="save">{{ $i18n.get('save') }}</a>
class="button is-primary"
@click="save">{{ $i18n.get('save') }}</a>
</section>
</transition>

View File

@ -3,9 +3,9 @@
<component
:is="getComponent()"
v-model="valueComponent"
:allowNew="allowNew"
:allow-new="allowNew"
:terms="terms"
:options="getOptions(0)"></component>
:options="getOptions(0)"/>
<add-new-term
class="add-new-term"
v-if="getComponent() !== 'tainacan-category-tag-input' && allowNew"
@ -14,7 +14,7 @@
:item_id="field.item.id"
:value="valueComponent"
:options="getOptions(0)"
@newTerm="reload"></add-new-term>
@newTerm="reload"/>
</div>
</template>
<script>

View File

@ -5,7 +5,7 @@
:key="index">
<b-checkbox
:id="id"
:style="{ paddingLeft: (option.level * 30) + 'px' }"
:style="{ paddingLeft: (option.level * 30) + 'px' }"
:key="index"
v-model="checked"
@input="onChecked(option)"

View File

@ -5,7 +5,7 @@
:key="index">
<b-radio
:id="id"
:style="{ paddingLeft: (option.level * 30) + 'px' }"
:style="{ paddingLeft: (option.level * 30) + 'px' }"
:key="index"
v-model="checked"
@input="onChecked(option)"

View File

@ -5,12 +5,13 @@
:id="id"
v-model="selected"
@input="emitChange()"
:placeholder="$i18n.get('label_select_category')" expanded>
:placeholder="$i18n.get('label_select_category')"
expanded>
<option
v-for="(option, index) in options"
:key="index"
:value="option.term_id"
v-html="setSpaces( option.level ) + option.name"></option>
v-html="setSpaces( option.level ) + option.name"/>
</b-select>
</div>
</div>

View File

@ -4,14 +4,13 @@
size="is-small"
rounded
icon="magnify"
:allowNew="allowNew"
:allow-new="allowNew"
@input="emitChange"
v-model="selected"
:data="labels"
field="label"
autocomplete
@typing="search">
</b-taginput>
@typing="search"/>
</div>
</template>
<script>

View File

@ -2,16 +2,15 @@
<section
v-if="isReady"
:listen="setError">
<b-field :addons="false"
:type="taxonomyType"
:message="taxonomyMessage"
>
<b-field
:addons="false"
:type="taxonomyType"
:message="taxonomyMessage">
<label class="label">
{{ $i18n.get('label_select_category') }}<span :class="taxonomyType" >&nbsp;*&nbsp;</span>
<help-button
:title="$i18n.getHelperTitle('tainacan-category', 'taxonomy_id')"
:message="$i18n.getHelperMessage('tainacan-category', 'taxonomy_id')">
</help-button>
:message="$i18n.getHelperMessage('tainacan-category', 'taxonomy_id')"/>
</label>
<b-select
name="field_type_options[taxonomy_id]"
@ -35,8 +34,7 @@
{{ $i18n.get('label_select_category_input_type') }}
<help-button
:title="$i18n.getHelperTitle('tainacan-category', 'input_type')"
:message="$i18n.getHelperMessage('tainacan-category', 'input_type')">
</help-button>
:message="$i18n.getHelperMessage('tainacan-category', 'input_type')"/>
</label>
<b-select
v-if="listInputType"
@ -74,14 +72,14 @@
{{ $i18n.get('label_category_allow_new_terms') }}
<help-button
:title="$i18n.getHelperTitle('tainacan-category', 'allow_new_terms')"
:message="$i18n.getHelperMessage('tainacan-category', 'allow_new_terms')">
</help-button>
:message="$i18n.getHelperMessage('tainacan-category', 'allow_new_terms')"/>
</label>
<div class="block">
<b-checkbox v-model="allow_new_terms"
@input="emitValues()"
true-value="yes"
false-value="no">
<b-checkbox
v-model="allow_new_terms"
@input="emitValues()"
true-value="yes"
false-value="no">
{{ labelNewTerms() }}
</b-checkbox>
</div>

View File

@ -2,7 +2,7 @@
<b-datepicker
:id="id"
v-model="dateValue"
@input="onInput($event)"></b-datepicker>
@input="onInput($event)"/>
</template>
<script>

View File

@ -6,7 +6,7 @@
step="0.01"
@blur="onBlur"
@change="onBlur"
@input="onInput($event)"></b-input>
@input="onInput($event)"/>
</template>
<script>

View File

@ -9,8 +9,7 @@
{{ $i18n.get('label_collection_related') }}<span :class="collectionType" >&nbsp;*&nbsp;</span>
<help-button
:title="$i18n.getHelperTitle('tainacan-relationship', 'collection_id')"
:message="$i18n.getHelperMessage('tainacan-relationship', 'collection_id')">
</help-button>
:message="$i18n.getHelperMessage('tainacan-relationship', 'collection_id')"/>
</label>
<b-select
name="field_type_relationship[collection_id]"
@ -32,7 +31,7 @@
<transition name="fade">
<div
v-if="loadingFields"
class="loading-spinner"></div>
class="loading-spinner"/>
<b-field
v-if="hasFields"
:addons="false">
@ -40,8 +39,7 @@
{{ $i18n.get('label_fields_for_search') }}
<help-button
:title="$i18n.getHelperTitle('tainacan-relationship', 'search')"
:message="$i18n.getHelperMessage('tainacan-relationship', 'search')">
</help-button>
:message="$i18n.getHelperMessage('tainacan-relationship', 'search')"/>
</label>
<div class="block">
<div
@ -66,15 +64,15 @@
{{ $i18n.get('label_allow_repeated_items') }}
<help-button
:title="$i18n.getHelperTitle('tainacan-relationship', 'repeated')"
:message="$i18n.getHelperMessage('tainacan-relationship', 'repeated')">
</help-button>
:message="$i18n.getHelperMessage('tainacan-relationship', 'repeated')"/>
</label>
<div class="block">
<b-checkbox v-model="modelRepeated"
@input="emitValues()"
true-value="yes"
false-value="no">
{{ labelRepeated() }}
<b-checkbox
v-model="modelRepeated"
@input="emitValues()"
true-value="yes"
false-value="no">
{{ labelRepeated() }}
</b-checkbox>
</div>
</b-field>

View File

@ -7,8 +7,7 @@
autocomplete
:loading="loading"
field="label"
@typing="search">
</b-taginput>
@typing="search"/>
</div>
</template>

View File

@ -1,24 +1,22 @@
<template>
<section
:listen="setError">
<b-field :addons="false"
:type="optionType"
:message="optionMessage"
>
<b-field
:addons="false"
:type="optionType"
:message="optionMessage">
<label class="label">
{{ $i18n.getHelperTitle('tainacan-selectbox', 'options') }}<span :class="optionType" >&nbsp;*&nbsp;</span>
<help-button
:title="$i18n.getHelperTitle('tainacan-selectbox', 'options')"
:message="$i18n.getHelperMessage('tainacan-selectbox', 'options')">
</help-button>
:message="$i18n.getHelperMessage('tainacan-selectbox', 'options')"/>
</label>
<b-taginput
v-model="options"
@input="emitValues()"
@focus="clear()"
icon="label"
:placeholder="$i18n.get('new')">
</b-taginput>
:placeholder="$i18n.get('new')"/>
</b-field>
</section>
</template>

View File

@ -1,27 +1,47 @@
<template>
<b-field
:addons="false"
:label="field.field.name"
:message="getErrorMessage"
:type="fieldTypeMessage">
:addons="false"
:label="field.field.name"
:message="getErrorMessage"
:type="fieldTypeMessage">
<help-button
:title="field.field.name"
:message="field.field.description">
</help-button>
:title="field.field.name"
:message="field.field.description"/>
<div v-if="isTextInputComponent( field.field.field_type_object.component )">
<component :id="field.field.field_type_object.component + '-' + field.field.slug" :is="field.field.field_type_object.component" v-model="inputs[0]" :field="field" @blur="changeValue()"></component>
<component
:id="field.field.field_type_object.component + '-' + field.field.slug"
:is="field.field.field_type_object.component"
v-model="inputs[0]"
:field="field"
@blur="changeValue()"/>
<div v-if="field.field.multiple == 'yes'">
<div v-if="index > 0" v-for="(input, index) in inputsList " v-bind:key="index" class="multiple-inputs">
<component :id="field.field.field_type_object.component + '-' + field.field.slug" :is="field.field.field_type_object.component" v-model="inputs[index]" :field="field" @blur="changeValue()"></component><a class="button" v-if="index > 0" @click="removeInput(index)">-</a>
<div
v-if="index > 0"
v-for="(input, index) in inputsList "
:key="index"
class="multiple-inputs">
<component
:id="field.field.field_type_object.component + '-' + field.field.slug"
:is="field.field.field_type_object.component"
v-model="inputs[index]"
:field="field"
@blur="changeValue()"/><a
class="button"
v-if="index > 0"
@click="removeInput(index)">-</a>
</div>
<a class="button" @click="addInput">+</a>
<a
class="button"
@click="addInput">+</a>
</div>
</div>
<div v-else>
<component
:id="field.field.field_type_object.component + '-' + field.field.slug"
:is="field.field.field_type_object.component" v-model="inputs"
:field="field" @blur="changeValue()"></component>
:is="field.field.field_type_object.component"
v-model="inputs"
:field="field"
@blur="changeValue()"/>
</div>
</b-field>
</template>
@ -32,7 +52,7 @@
export default {
name: 'TainacanFormItem',
props: {
field: {}
field: Object
},
data(){
return {

View File

@ -1,9 +1,9 @@
<template>
<b-input
:id="id"
:value="inputValue"
@blur="onBlur"
@input="onInput($event)"></b-input>
:id="id"
:value="inputValue"
@blur="onBlur"
@input="onInput($event)"/>
</template>
<script>

View File

@ -4,7 +4,7 @@
type="textarea"
:value="inputValue"
@blur="onBlur"
@input="onInput($event)"></b-input>
@input="onInput($event)"/>
</template>
<script>

View File

@ -12,8 +12,12 @@
@select="option => setResults(option) ">
<template slot-scope="props">
<div class="media">
<div class="media-left" v-if="props.option.img">
<img width="32" :src="`${props.option.img}`">
<div
class="media-left"
v-if="props.option.img">
<img
width="32"
:src="`${props.option.img}`">
</div>
<div class="media-content">
{{ props.option.label }}
@ -23,11 +27,12 @@
</b-autocomplete>
<br>
<div class="field has-text-centered">
<b-tag v-if="results !== ''"
type="is-primary"
size="is-small"
closable
@close="clearSearch()">
<b-tag
v-if="results !== ''"
type="is-primary"
size="is-small"
closable
@close="clearSearch()">
{{ results }}
</b-tag>
</div>

View File

@ -5,37 +5,36 @@
size="is-small"
v-model="date_init"
@input="validate_values()"
icon="calendar-today">
</b-datepicker>
icon="calendar-today"/>
<br>
<b-datepicker
size="is-small"
v-model="date_end"
@input="validate_values()"
@focus="isTouched = true"
icon="calendar-today">
</b-datepicker>
icon="calendar-today"/>
<br>
</div>
<div class="columns" v-else>
<div
class="columns"
v-else>
<b-input
size="is-small"
type="number"
@input="validate_values()"
class="column"
v-model="value_init">
</b-input>
v-model="value_init"/>
<b-input
size="is-small"
type="number"
@input="validate_values()"
@focus="isTouched = true"
class="column"
v-model="value_end">
</b-input>
v-model="value_end"/>
</div>
<div class="field has-text-centered">
<b-tag v-if="isValid && !clear"
<b-tag
v-if="isValid && !clear"
type="is-primary"
size="is-small"
closable
@ -91,7 +90,7 @@
field_id: [Number], // not required, but overrides the filter field id if is set
collection_id: [Number], // not required, but overrides the filter field id if is set
id: '',
query: {}
query: Object
},
methods: {
// only validate if the first value is higher than first

View File

@ -9,8 +9,7 @@
autocomplete
:loading="loading"
field="label"
@typing="search">
</b-taginput>
@typing="search"/>
</div>
</template>

View File

@ -1,14 +1,15 @@
<template>
<b-field :label="filter.name"
:message="getErrorMessage"
:type="filterTypeMessage">
<b-field
:label="filter.name"
:message="getErrorMessage"
:type="filterTypeMessage">
<div>
<component
:id="filter.filter_type_object.component + '-' + filter.slug"
:is="filter.filter_type_object.component"
:filter="getFilter"
:query="query"
@input="listen( $event )"></component>
@input="listen( $event )"/>
</div>
</b-field>
</template>
@ -21,8 +22,8 @@
export default {
name: 'TainacanFiltersList',
props: {
filter: {},
query: {}
filter: Object,
query: Object
},
data(){
return {

View File

@ -18,7 +18,10 @@ module.exports = {
enforce: "pre",
test: /\.vue$/,
exclude: /node_modules/,
loader: "eslint-loader"
loader: "eslint-loader",
options: {
fix: false,
},
},
{
test: /\.vue$/,