Several updates to status logic, to iterate over a global array of status options. Implements new status tabs layout on Collections and Taxonomies list Ref. #248.
This commit is contained in:
parent
48865d3de4
commit
2058413064
|
@ -124,10 +124,10 @@
|
|||
:placeholder="$i18n.get('instruction_select_a_status2')"
|
||||
@input="addToBulkEditionProcedures($event, 'newValue', criterion)">
|
||||
<option
|
||||
v-for="(status, key) in statuses"
|
||||
:key="key"
|
||||
:value="status">
|
||||
{{ $i18n.get(status) }}
|
||||
v-for="(statusOption, index) of $statusHelper.getStatuses().filter(option => { return option.value != 'trash' })"
|
||||
:key="index"
|
||||
:value="statusOption.value">
|
||||
{{ statusOption.label }}
|
||||
</option>
|
||||
</b-select>
|
||||
</template>
|
||||
|
|
|
@ -297,13 +297,13 @@
|
|||
<div class="status-radios">
|
||||
<b-radio
|
||||
v-model="form.status"
|
||||
v-for="statusOption in statusOptions"
|
||||
:key="statusOption.value"
|
||||
v-for="(statusOption, index) of $statusHelper.getStatuses()"
|
||||
:key="index"
|
||||
:native-value="statusOption.value">
|
||||
<span class="icon has-text-gray">
|
||||
<i
|
||||
class="tainacan-icon tainacan-icon-18px"
|
||||
:class="'tainacan-icon-' + getStatusIcon(statusOption.value)"/>
|
||||
:class="$statusHelper.getIcon(statusOption.value)"/>
|
||||
</span>
|
||||
{{ statusOption.label }}
|
||||
</b-radio>
|
||||
|
@ -555,20 +555,6 @@ export default {
|
|||
},
|
||||
thumbnail: {},
|
||||
cover: {},
|
||||
// Can be obtained from api later
|
||||
statusOptions: [{
|
||||
value: 'publish',
|
||||
label: this.$i18n.get('public')
|
||||
}, {
|
||||
value: 'private',
|
||||
label: this.$i18n.get('private')
|
||||
}, {
|
||||
value: 'draft',
|
||||
label: this.$i18n.get('draft')
|
||||
}, {
|
||||
value: 'trash',
|
||||
label: this.$i18n.get('trash')
|
||||
}],
|
||||
isFetchingPages: false,
|
||||
coverPages: [],
|
||||
coverPage: '',
|
||||
|
@ -876,15 +862,6 @@ export default {
|
|||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
getStatusIcon(status) {
|
||||
switch(status) {
|
||||
case 'publish': return 'public';
|
||||
case 'private': return 'private';
|
||||
case 'draft': return 'draft';
|
||||
case 'trash': return 'delete';
|
||||
default: return 'item';
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
|
|
|
@ -718,20 +718,6 @@ export default {
|
|||
comment_status: ''
|
||||
},
|
||||
thumbnail: {},
|
||||
// Can be obtained from api later
|
||||
statusOptions: [{
|
||||
value: 'publish',
|
||||
label: this.$i18n.get('public')
|
||||
}, {
|
||||
value: 'private',
|
||||
label: this.$i18n.get('private')
|
||||
}, {
|
||||
value: 'draft',
|
||||
label: this.$i18n.get('draft')
|
||||
}, {
|
||||
value: 'trash',
|
||||
label: this.$i18n.get('trash')
|
||||
}],
|
||||
formErrorMessage: '',
|
||||
thumbPlaceholderPath: tainacan_plugin.base_url + '/admin/images/placeholder_square.png',
|
||||
thumbnailMediaFrame: undefined,
|
||||
|
|
|
@ -94,7 +94,7 @@
|
|||
native-value="draft">
|
||||
<span class="icon">
|
||||
<i class="tainacan-icon tainacan-icon-draft"/>
|
||||
</span> {{ $i18n.get('draft') }}
|
||||
</span> {{ $i18n.get('status_draft') }}
|
||||
</b-radio>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -90,13 +90,13 @@
|
|||
<div class="status-radios">
|
||||
<b-radio
|
||||
v-model="form.status"
|
||||
v-for="statusOption in statusOptions"
|
||||
:key="statusOption.value"
|
||||
v-for="(statusOption, index) of $statusHelper.getStatuses()"
|
||||
:key="index"
|
||||
:native-value="statusOption.value">
|
||||
<span class="icon has-text-gray">
|
||||
<i
|
||||
class="tainacan-icon tainacan-icon-18px"
|
||||
:class="'tainacan-icon-' + getStatusIcon(statusOption.value)"/>
|
||||
:class="$statusHelper.getIcon(statusOption.value)"/>
|
||||
</span>
|
||||
{{ statusOption.label }}
|
||||
</b-radio>
|
||||
|
@ -224,19 +224,6 @@
|
|||
allowInsert: String,
|
||||
enabledPostTypes: Array
|
||||
},
|
||||
statusOptions: [{
|
||||
value: 'publish',
|
||||
label: this.$i18n.get('public')
|
||||
}, {
|
||||
value: 'private',
|
||||
label: this.$i18n.get('private')
|
||||
}, {
|
||||
value: 'draft',
|
||||
label: this.$i18n.get('draft')
|
||||
}, {
|
||||
value: 'trash',
|
||||
label: this.$i18n.get('trash')
|
||||
}],
|
||||
wpPostTypes: tainacan_plugin.wp_post_types,
|
||||
editFormErrors: {},
|
||||
formErrorMessage: '',
|
||||
|
@ -415,15 +402,6 @@
|
|||
})
|
||||
.catch(error => this.$console.error(error));
|
||||
},
|
||||
getStatusIcon(status) {
|
||||
switch(status) {
|
||||
case 'publish': return 'public';
|
||||
case 'private': return 'private';
|
||||
case 'draft': return 'draft';
|
||||
case 'trash': return 'delete';
|
||||
default: return 'item';
|
||||
}
|
||||
},
|
||||
clearErrors(attribute) {
|
||||
this.editFormErrors[attribute] = undefined;
|
||||
},
|
||||
|
|
|
@ -46,7 +46,7 @@ import store from '../../js/store/store'
|
|||
import router from './router'
|
||||
import eventBusSearch from '../../js/event-bus-search';
|
||||
import termsListBus from './terms-list-bus.js';
|
||||
import { I18NPlugin, UserPrefsPlugin, RouterHelperPlugin, ConsolePlugin, UserCapabilitiesPlugin } from './utilities';
|
||||
import { I18NPlugin, UserPrefsPlugin, RouterHelperPlugin, ConsolePlugin, UserCapabilitiesPlugin, StatusHelperPlugin } from './utilities';
|
||||
|
||||
// Configure and Register Plugins
|
||||
Vue.use(Buefy);
|
||||
|
@ -56,6 +56,7 @@ Vue.use(I18NPlugin);
|
|||
Vue.use(UserPrefsPlugin);
|
||||
Vue.use(RouterHelperPlugin);
|
||||
Vue.use(UserCapabilitiesPlugin);
|
||||
Vue.use(StatusHelperPlugin);
|
||||
Vue.use(ConsolePlugin, {visual: false});
|
||||
Vue.use(VueTheMask);
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import ViewModeSlideshow from '../../theme-helper/view-mode-slideshow.vue';
|
|||
import store from '../../js/store/store'
|
||||
import routerTheme from './theme-router.js'
|
||||
import eventBusSearch from '../../js/event-bus-search';
|
||||
import { I18NPlugin, UserPrefsPlugin, RouterHelperPlugin, ConsolePlugin } from './utilities';
|
||||
import { I18NPlugin, UserPrefsPlugin, RouterHelperPlugin, ConsolePlugin, StatusHelperPlugin } from './utilities';
|
||||
|
||||
// Configure and Register Plugins
|
||||
Vue.use(Buefy);
|
||||
|
@ -37,6 +37,7 @@ Vue.use(VueMasonry);
|
|||
Vue.use(I18NPlugin);
|
||||
Vue.use(UserPrefsPlugin);
|
||||
Vue.use(RouterHelperPlugin);
|
||||
Vue.use(StatusHelperPlugin);
|
||||
Vue.use(ConsolePlugin, {visual: false});
|
||||
|
||||
|
||||
|
|
|
@ -338,4 +338,34 @@ UserCapabilitiesPlugin.install = function (Vue, options = {}) {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// STATUS ICONS PLUGIN - Sets icon for status option
|
||||
export const StatusHelperPlugin = {};
|
||||
StatusHelperPlugin.install = function (Vue, options = {}) {
|
||||
|
||||
Vue.prototype.$statusHelper = {
|
||||
getIcon(status) {
|
||||
switch (status) {
|
||||
case 'publish': return 'tainacan-icon-public';
|
||||
case 'private': return 'tainacan-icon-private';
|
||||
case 'draft': return 'tainacan-icon-draft';
|
||||
case 'trash': return 'tainacan-icon-delete';
|
||||
default: '';
|
||||
}
|
||||
},
|
||||
hasIcon(status) {
|
||||
return ['publish', 'private', 'draft', 'trash'].includes(status);
|
||||
},
|
||||
getStatuses() {
|
||||
return [
|
||||
{ label: tainacan_plugin.i18n['status_publish'], value: 'publish' },
|
||||
{ label: tainacan_plugin.i18n['status_private'], value: 'private' },
|
||||
{ label: tainacan_plugin.i18n['status_draft'], value: 'draft' },
|
||||
{ label: tainacan_plugin.i18n['status_trash'], value: 'trash' }
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
};
|
|
@ -127,21 +127,44 @@
|
|||
<ul>
|
||||
<li
|
||||
@click="onChangeTab('')"
|
||||
:class="{ 'is-active': status == undefined || status == ''}">
|
||||
<a>{{ `${$i18n.get('label_all_collections')}` }}<span class="has-text-gray"> {{ `${` ${repositoryTotalCollections ? `(${Number(repositoryTotalCollections.private) + Number(repositoryTotalCollections.publish)})` : '' }`}` }}</span></a>
|
||||
:class="{ 'is-active': status == undefined || status == ''}"
|
||||
v-tooltip="{
|
||||
content: $i18n.getWithVariables('info_%s_tab_all',[$i18n.get('collections')]),
|
||||
autoHide: true,
|
||||
placement: 'auto',
|
||||
}">
|
||||
<a :style="{ fontWeight: 'bold', color: '#454647 !important', lineHeight: '1.5rem' }">
|
||||
{{ `${$i18n.get('label_all_collections')}` }}
|
||||
<span class="has-text-gray"> {{ `${` ${repositoryTotalCollections ? `(${Number(repositoryTotalCollections.private) + Number(repositoryTotalCollections.publish)})` : '' }`}` }}</span>
|
||||
</a>
|
||||
</li>
|
||||
<li
|
||||
@click="onChangeTab('draft')"
|
||||
:class="{ 'is-active': status == 'draft'}">
|
||||
<a>{{ `${$i18n.get('label_draft_items')}` }}<span class="has-text-gray"> {{ `${` ${repositoryTotalCollections ? `(${repositoryTotalCollections.draft})` : '' }`}` }}</span></a>
|
||||
</li>
|
||||
<li
|
||||
@click="onChangeTab('trash')"
|
||||
:class="{ 'is-active': status == 'trash'}">
|
||||
<a>{{ `${$i18n.get('label_trash_items')}` }}<span class="has-text-gray"> {{ `${` ${repositoryTotalCollections ? `(${repositoryTotalCollections.trash})` : '' }`}` }}</span></a>
|
||||
v-for="(statusOption, index) of $statusHelper.getStatuses()"
|
||||
:key="index"
|
||||
@click="onChangeTab(statusOption.value)"
|
||||
:class="{ 'is-active': status == statusOption.value}"
|
||||
:style="{ marginLeft: statusOption.value == 'draft' ? 'auto' : '' }"
|
||||
v-tooltip="{
|
||||
content: $i18n.getWithVariables('info_%s_tab_' + statusOption.value,[$i18n.get('collections')]),
|
||||
autoHide: true,
|
||||
placement: 'auto',
|
||||
}">
|
||||
<a>
|
||||
<span
|
||||
v-if="$statusHelper.hasIcon(statusOption.value)"
|
||||
class="icon has-text-gray">
|
||||
<i
|
||||
class="tainacan-icon tainacan-icon-18px"
|
||||
:class="$statusHelper.getIcon(statusOption.value)"
|
||||
/>
|
||||
</span>
|
||||
{{ statusOption.label }}
|
||||
<span class="has-text-gray"> {{ `${` ${repositoryTotalCollections ? `(${repositoryTotalCollections[statusOption.value]})` : '' }`}` }}</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<collections-list
|
||||
:is-loading="isLoading"
|
||||
|
@ -161,8 +184,12 @@
|
|||
</span>
|
||||
</p>
|
||||
<p v-if="status == undefined || status == ''">{{ $i18n.get('info_no_collection_created') }}</p>
|
||||
<p v-if="status == 'draft'">{{ $i18n.get('info_no_collection_draft') }}</p>
|
||||
<p v-if="status == 'trash'">{{ $i18n.get('info_no_collection_trash') }}</p>
|
||||
<p
|
||||
v-for="(statusOption, index) of $statusHelper.getStatuses()"
|
||||
:key="index"
|
||||
v-if="status == statusOption.value">
|
||||
{{ $i18n.getWithVariables('info_no_%s_' + statusOption.value,['collection']) }}
|
||||
</p>
|
||||
|
||||
<div v-if="$userCaps.hasCapability('edit_tainacan-collections') && status == undefined || status == ''">
|
||||
<b-dropdown
|
||||
|
|
|
@ -614,7 +614,7 @@
|
|||
@click="onChangeTab('')"
|
||||
:class="{ 'is-active': status == undefined || status == ''}"
|
||||
v-tooltip="{
|
||||
content: $i18n.get('info_items_tab_all'),
|
||||
content: $i18n.getWithVariables('info_%s_tab_all',[$i18n.get('items')]),
|
||||
autoHide: true,
|
||||
placement: 'auto',
|
||||
}">
|
||||
|
@ -624,70 +624,27 @@
|
|||
</a>
|
||||
</li>
|
||||
<li
|
||||
@click="onChangeTab('publish')"
|
||||
:class="{ 'is-active': status == 'publish'}"
|
||||
v-for="(statusOption, index) of $statusHelper.getStatuses()"
|
||||
:key="index"
|
||||
@click="onChangeTab(statusOption.value)"
|
||||
:class="{ 'is-active': status == statusOption.value}"
|
||||
:style="{ marginLeft: statusOption.value == 'draft' ? 'auto' : '' }"
|
||||
v-tooltip="{
|
||||
content: $i18n.get('info_items_tab_publish'),
|
||||
content: $i18n.getWithVariables('info_%s_tab_' + statusOption.value,[$i18n.get('items')]),
|
||||
autoHide: true,
|
||||
placement: 'auto',
|
||||
}">
|
||||
<a>
|
||||
<span class="icon has-text-gray">
|
||||
<i class="tainacan-icon tainacan-icon-18px tainacan-icon-public"/>
|
||||
<span
|
||||
v-if="$statusHelper.hasIcon(statusOption.value)"
|
||||
class="icon has-text-gray">
|
||||
<i
|
||||
class="tainacan-icon tainacan-icon-18px"
|
||||
:class="$statusHelper.getIcon(statusOption.value)"
|
||||
/>
|
||||
</span>
|
||||
{{ $i18n.get('label_publish_items') }}
|
||||
<span class="has-text-gray"> {{ collection && collection.total_items ? ` (${collection.total_items.publish})` : (isRepositoryLevel && repositoryTotalItems) ? ` (${ repositoryTotalItems.publish })` : '' }}</span>
|
||||
</a>
|
||||
</li>
|
||||
<li
|
||||
v-if="!isRepositoryLevel"
|
||||
@click="onChangeTab('private')"
|
||||
:class="{ 'is-active': status == 'private'}"
|
||||
style="margin-right: auto"
|
||||
v-tooltip="{
|
||||
content: $i18n.get('info_items_tab_private'),
|
||||
autoHide: true,
|
||||
placement: 'auto',
|
||||
}">
|
||||
<a>
|
||||
<span class="icon has-text-gray">
|
||||
<i class="tainacan-icon tainacan-icon-18px tainacan-icon-private"/>
|
||||
</span>
|
||||
{{ $i18n.get('label_private_items') }}
|
||||
<span class="has-text-gray"> {{ collection && collection.total_items ? ` (${collection.total_items.private})` : (isRepositoryLevel && repositoryTotalItems) ? ` (${ repositoryTotalItems.private })` : '' }}</span>
|
||||
</a>
|
||||
</li>
|
||||
<li
|
||||
@click="onChangeTab('draft')"
|
||||
:class="{ 'is-active': status == 'draft'}"
|
||||
v-tooltip="{
|
||||
content: $i18n.get('info_items_tab_draft'),
|
||||
autoHide: true,
|
||||
placement: 'auto',
|
||||
}">
|
||||
<a>
|
||||
<span class="icon has-text-gray">
|
||||
<i class="tainacan-icon tainacan-icon-18px tainacan-icon-draft"/>
|
||||
</span>
|
||||
{{ $i18n.get('label_draft_items') }}
|
||||
<span class="has-text-gray"> {{ collection && collection.total_items ? ` (${collection.total_items.draft})` : (isRepositoryLevel && repositoryTotalItems) ? ` (${ repositoryTotalItems.draft })` : '' }}</span>
|
||||
</a>
|
||||
</li>
|
||||
<li
|
||||
v-if="!isRepositoryLevel"
|
||||
@click="onChangeTab('trash')"
|
||||
:class="{ 'is-active': status == 'trash'}"
|
||||
v-tooltip="{
|
||||
content: $i18n.get('info_items_tab_trash'),
|
||||
autoHide: true,
|
||||
placement: 'auto',
|
||||
}">
|
||||
<a>
|
||||
<span class="icon has-text-gray">
|
||||
<i class="tainacan-icon tainacan-icon-18px tainacan-icon-delete"/>
|
||||
</span>
|
||||
{{ $i18n.get('label_trash_items') }}
|
||||
<span class="has-text-gray"> {{ collection && collection.total_items ? ` (${collection.total_items.trash})` : (isRepositoryLevel && repositoryTotalItems) ? ` (${ repositoryTotalItems.trash })` : '' }}</span>
|
||||
{{ statusOption.label }}
|
||||
<span class="has-text-gray"> {{ collection && collection.total_items ? ` (${collection.total_items[statusOption.value]})` : (isRepositoryLevel && repositoryTotalItems) ? ` (${ repositoryTotalItems[statusOption.value] })` : '' }}</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -784,10 +741,12 @@
|
|||
</span>
|
||||
</p>
|
||||
<p v-if="status == undefined || status == ''">{{ hasFiltered ? $i18n.get('info_no_item_found_filter') : $i18n.get('info_no_item_created') }}</p>
|
||||
<p v-if="status == 'publish'">{{ $i18n.get('info_no_item_publish') }}</p>
|
||||
<p v-if="status == 'private'">{{ $i18n.get('info_no_item_priavte') }}</p>
|
||||
<p v-if="status == 'draft'">{{ $i18n.get('info_no_item_draft') }}</p>
|
||||
<p v-if="status == 'trash'">{{ $i18n.get('info_no_item_trash') }}</p>
|
||||
<p
|
||||
v-for="(statusOption, index) of $statusHelper.getStatuses()"
|
||||
:key="index"
|
||||
v-if="status == statusOption.value">
|
||||
{{ $i18n.getWithVariables('info_no_%s_' + statusOption.value,['item']) }}
|
||||
</p>
|
||||
|
||||
<router-link
|
||||
v-if="!hasFiltered && (status == undefined || status == '') && !$route.query.iframemode"
|
||||
|
|
|
@ -94,18 +94,40 @@
|
|||
<ul>
|
||||
<li
|
||||
@click="onChangeTab('')"
|
||||
:class="{ 'is-active': status == undefined || status == ''}">
|
||||
<a>{{ `${$i18n.get('label_all_taxonomies')}` }}<span class="has-text-gray"> {{ `${` ${repositoryTotalTaxonomies ? `(${Number(repositoryTotalTaxonomies.private) + Number(repositoryTotalTaxonomies.publish)})` : '' }`}` }}</span></a>
|
||||
:class="{ 'is-active': status == undefined || status == ''}"
|
||||
v-tooltip="{
|
||||
content: $i18n.getWithVariables('info_%s_tab_all',[$i18n.get('taxonomies')]),
|
||||
autoHide: true,
|
||||
placement: 'auto',
|
||||
}">
|
||||
<a :style="{ fontWeight: 'bold', color: '#454647 !important', lineHeight: '1.5rem' }">
|
||||
{{ `${$i18n.get('label_all_taxonomies')}` }}
|
||||
<span class="has-text-gray"> {{ repositoryTotalTaxonomies ? `(${Number(repositoryTotalTaxonomies.private) + Number(repositoryTotalTaxonomies.publish)})` : '' }}</span>
|
||||
</a>
|
||||
</li>
|
||||
<li
|
||||
@click="onChangeTab('draft')"
|
||||
:class="{ 'is-active': status == 'draft'}">
|
||||
<a>{{ `${$i18n.get('label_draft_items')}` }}<span class="has-text-gray"> {{ `${` ${repositoryTotalTaxonomies ? `(${repositoryTotalTaxonomies.draft})` : '' }`}` }}</span></a>
|
||||
</li>
|
||||
<li
|
||||
@click="onChangeTab('trash')"
|
||||
:class="{ 'is-active': status == 'trash'}">
|
||||
<a>{{ `${$i18n.get('label_trash_items')}` }}<span class="has-text-gray"> {{ `${` ${repositoryTotalTaxonomies ? `(${repositoryTotalTaxonomies.trash})` : '' }`}` }}</span></a>
|
||||
v-for="(statusOption, index) of $statusHelper.getStatuses()"
|
||||
:key="index"
|
||||
@click="onChangeTab(statusOption.value)"
|
||||
:class="{ 'is-active': status == statusOption.value}"
|
||||
:style="{ marginLeft: statusOption.value == 'draft' ? 'auto' : '' }"
|
||||
v-tooltip="{
|
||||
content: $i18n.getWithVariables('info_%s_tab_' + statusOption.value,[$i18n.get('taxonomies')]),
|
||||
autoHide: true,
|
||||
placement: 'auto',
|
||||
}">
|
||||
<a>
|
||||
<span
|
||||
v-if="$statusHelper.hasIcon(statusOption.value)"
|
||||
class="icon has-text-gray">
|
||||
<i
|
||||
class="tainacan-icon tainacan-icon-18px"
|
||||
:class="$statusHelper.getIcon(statusOption.value)"
|
||||
/>
|
||||
</span>
|
||||
{{ statusOption.label }}
|
||||
<span class="has-text-gray"> {{ repositoryTotalTaxonomies ? `(${repositoryTotalTaxonomies[statusOption.value]})` : '' }}</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -126,8 +148,12 @@
|
|||
<i class="tainacan-icon tainacan-icon-36px tainacan-icon-terms"/>
|
||||
</span>
|
||||
<p v-if="status == undefined || status == ''">{{ $i18n.get('info_no_taxonomy_created') }}</p>
|
||||
<p v-if="status == 'draft'">{{ $i18n.get('info_no_taxonomy_draft') }}</p>
|
||||
<p v-if="status == 'trash'">{{ $i18n.get('info_no_taxonomy_trash') }}</p>
|
||||
<p
|
||||
v-for="(statusOption, index) of $statusHelper.getStatuses()"
|
||||
:key="index"
|
||||
v-if="status == statusOption.value">
|
||||
{{ $i18n.getWithVariables('info_no_%s_' + statusOption.value,['taxonomy']) }}
|
||||
</p>
|
||||
<router-link
|
||||
v-if="status == undefined || status == ''"
|
||||
id="button-create-taxonomy"
|
||||
|
|
|
@ -597,13 +597,41 @@
|
|||
<ul>
|
||||
<li
|
||||
@click="onChangeTab('')"
|
||||
:class="{ 'is-active': status == undefined || status == ''}"><a>{{ $i18n.get('label_all_published_items') }}</a></li>
|
||||
:class="{ 'is-active': status == undefined || status == ''}"
|
||||
v-tooltip="{
|
||||
content: $i18n.getWithVariables('info_%s_tab_all',[$i18n.get('items')]),
|
||||
autoHide: true,
|
||||
placement: 'auto',
|
||||
}">
|
||||
<a :style="{ fontWeight: 'bold', color: '#454647 !important', lineHeight: '1.5rem' }">
|
||||
{{ $i18n.get('label_all_published_items') }}
|
||||
<span class="has-text-gray"> {{ collection && collection.total_items ? ` (${Number(collection.total_items.private) + Number(collection.total_items.publish)})` : (isRepositoryLevel && repositoryTotalItems) ? ` (${ repositoryTotalItems.private + repositoryTotalItems.publish })` : '' }}</span>
|
||||
</a>
|
||||
</li>
|
||||
<li
|
||||
@click="onChangeTab('draft')"
|
||||
:class="{ 'is-active': status == 'draft'}"><a>{{ $i18n.get('label_draft_items') }}</a></li>
|
||||
<li
|
||||
@click="onChangeTab('trash')"
|
||||
:class="{ 'is-active': status == 'trash'}"><a>{{ $i18n.get('label_trash_items') }}</a></li>
|
||||
v-for="(statusOption, index) of $statusHelper.getStatuses()"
|
||||
:key="index"
|
||||
@click="onChangeTab(statusOption.value)"
|
||||
:class="{ 'is-active': status == statusOption.value}"
|
||||
:style="{ marginLeft: statusOption.value == 'draft' ? 'auto' : '' }"
|
||||
v-tooltip="{
|
||||
content: $i18n.getWithVariables('info_%s_tab_' + statusOption.value,[$i18n.get('items')]),
|
||||
autoHide: true,
|
||||
placement: 'auto',
|
||||
}">
|
||||
<a>
|
||||
<span
|
||||
v-if="$statusHelper.hasIcon(statusOption.value)"
|
||||
class="icon has-text-gray">
|
||||
<i
|
||||
class="tainacan-icon tainacan-icon-18px"
|
||||
:class="$statusHelper.getIcon(statusOption.value)"
|
||||
/>
|
||||
</span>
|
||||
{{ statusOption.label }}
|
||||
<span class="has-text-gray"> {{ collection && collection.total_items ? ` (${collection.total_items[statusOption.value]})` : (isRepositoryLevel && repositoryTotalItems) ? ` (${ repositoryTotalItems[statusOption.value] })` : '' }}</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
@ -697,8 +725,12 @@
|
|||
</span>
|
||||
</p>
|
||||
<p v-if="status == undefined || status == ''">{{ hasFiltered ? $i18n.get('info_no_item_found_filter') : $i18n.get('info_no_item_created') }}</p>
|
||||
<p v-if="status == 'draft'">{{ $i18n.get('info_no_item_draft') }}</p>
|
||||
<p v-if="status == 'trash'">{{ $i18n.get('info_no_item_trash') }}</p>
|
||||
<p
|
||||
v-for="(statusOption, index) of $statusHelper.getStatuses()"
|
||||
:key="index"
|
||||
v-if="status == statusOption.value">
|
||||
{{ $i18n.getWithVariables('info_no_%s_' + statusOption.value,['items']) }}
|
||||
</p>
|
||||
|
||||
<router-link
|
||||
v-if="!hasFiltered && (status == undefined || status == '')"
|
||||
|
|
|
@ -7,9 +7,11 @@
|
|||
|
||||
<div class="tainacan-page-title">
|
||||
<h1>
|
||||
<span
|
||||
v-if="(item != null && item != undefined && item.status != undefined && !isLoading)"
|
||||
class="status-tag">{{ $i18n.get(item.status) }}</span>
|
||||
<span
|
||||
v-if="(item != null && item != undefined && item.status != undefined && !isLoading)"
|
||||
class="status-tag">
|
||||
{{ $i18n.get('status_' + item.status) }}
|
||||
</span>
|
||||
{{ $i18n.get('title_item_page') + ' ' }}
|
||||
<span style="font-weight: 600;">{{ (item != null && item != undefined) ? item.title : '' }}</span>
|
||||
</h1>
|
||||
|
|
|
@ -82,12 +82,12 @@ return apply_filters( 'tainacan-admin-i18n', [
|
|||
'delete' => __( 'Delete', 'tainacan' ),
|
||||
|
||||
// Wordpress Status
|
||||
'publish' => __( 'Publish', 'tainacan' ),
|
||||
'public' => __( 'Public', 'tainacan' ),
|
||||
'draft' => __( 'Draft', 'tainacan' ),
|
||||
'private' => __( 'Private', 'tainacan' ),
|
||||
'trash' => __( 'Trash', 'tainacan' ),
|
||||
'auto-draft' => __( 'Automatic Draft', 'tainacan' ),
|
||||
'status_publish' => __( 'Publish', 'tainacan' ),
|
||||
'status_public' => __( 'Public', 'tainacan' ),
|
||||
'status_draft' => __( 'Draft', 'tainacan' ),
|
||||
'status_private' => __( 'Private', 'tainacan' ),
|
||||
'status_trash' => __( 'Trash', 'tainacan' ),
|
||||
'status_auto-draft' => __( 'Automatic Draft', 'tainacan' ),
|
||||
'publish_visibility' => __( 'Visible to everyone', 'tainacan' ),
|
||||
'private_visibility' => __( 'Visible only for editors', 'tainacan' ),
|
||||
|
||||
|
@ -239,10 +239,6 @@ return apply_filters( 'tainacan-admin-i18n', [
|
|||
'label_all_published_items' => __( 'All published items', 'tainacan' ),
|
||||
'label_all_collections' => __( 'All collections', 'tainacan' ),
|
||||
'label_all_taxonomies' => __( 'All taxonomies', 'tainacan' ),
|
||||
'label_publish_items' => __( 'Public', 'tainacan' ),
|
||||
'label_private_items' => __( 'Private', 'tainacan' ),
|
||||
'label_draft_items' => __( 'Draft', 'tainacan' ),
|
||||
'label_trash_items' => __( 'Trash', 'tainacan' ),
|
||||
'label_bulk_actions' => __( 'Bulk actions', 'tainacan' ),
|
||||
'label_delete_selected_collections' => __( 'Delete selected collections', 'tainacan' ),
|
||||
'label_edit_selected_collections' => __( 'Edit selected collections', 'tainacan' ),
|
||||
|
@ -454,32 +450,28 @@ return apply_filters( 'tainacan-admin-i18n', [
|
|||
'instruction_drag_and_drop_filter_sort' => __( 'Drag and drop to change filter order', 'tainacan' ),
|
||||
'instruction_drag_and_drop_metadatum_sort' => __( 'Drag and drop to change metadatum order', 'tainacan' ),
|
||||
'instruction_select_step_options_to_show' => __( 'Select which Step values to show', 'tainacan' ),
|
||||
'instruction_select_maximum_options_to_show' => __( 'Select which Maximum of options to show', 'tainacan' ),
|
||||
'instruction_select_maximum_options_to_show' => __( 'Select which amount of maximum of options to show', 'tainacan' ),
|
||||
|
||||
// Info. Other feedback to user.
|
||||
'info_items_tab_all' => __( 'Every published item of this collection, including those visible only to editors.', 'tainacan' ),
|
||||
'info_items_tab_publish' => __( 'Only items that are visible to everyone.', 'tainacan' ),
|
||||
'info_items_tab_private' => __( 'Items visible only to editors.', 'tainacan' ),
|
||||
'info_items_tab_draft' => __( 'Draft items, not published.', 'tainacan' ),
|
||||
'info_items_tab_trash' => __( 'Items that were sent to trash.', 'tainacan' ),
|
||||
'info_%s_tab_all' => __( 'Every published %s, including those visible only to editors.', 'tainacan' ),
|
||||
'info_%s_tab_publish' => __( 'Only %s that are visible to everyone.', 'tainacan' ),
|
||||
'info_%s_tab_private' => __( '%s visible only to editors.', 'tainacan' ),
|
||||
'info_%s_tab_draft' => __( 'Draft %s, not published.', 'tainacan' ),
|
||||
'info_%s_tab_trash' => __( '%s that were sent to trash.', 'tainacan' ),
|
||||
'info_error_invalid_date' => __( 'Invalid date', 'tainacan' ),
|
||||
'info_search_results' => __( 'Search Results', 'tainacan' ),
|
||||
'info_search_criteria' => __( 'Search Criteria', 'tainacan' ),
|
||||
'info_name_is_required' => __( 'Name is required.', 'tainacan' ),
|
||||
'info_no_collection_created' => __( 'No collection was created in this repository.', 'tainacan' ),
|
||||
'info_no_collection_draft' => __( 'No draft collection found.', 'tainacan' ),
|
||||
'info_no_collection_trash' => __( 'No collection in trash.', 'tainacan' ),
|
||||
'info_no_taxonomy_draft' => __( 'No draft taxonomy found.', 'tainacan' ),
|
||||
'info_no_taxonomy_trash' => __( 'No taxonomy in trash.', 'tainacan' ),
|
||||
'info_no_%s_publish' => __( 'No public %s found.', 'tainacan' ),
|
||||
'info_no_%s_private' => __( 'No private %s found.', 'tainacan' ),
|
||||
'info_no_%s_draft' => __( 'No draft %s found.', 'tainacan' ),
|
||||
'info_no_%s_trash' => __( 'No %s found on trash.', 'tainacan' ),
|
||||
'info_no_taxonomy_created' => __( 'No taxonomy was created in this repository.', 'tainacan' ),
|
||||
'info_no_terms_created_on_taxonomy' => __( 'No term was created for this taxonomy.', 'tainacan' ),
|
||||
'info_no_terms_found' => __( 'No term was found here', 'tainacan' ),
|
||||
'info_no_more_terms_found' => __( 'No more terms found', 'tainacan' ),
|
||||
'info_no_item_created' => __( 'No item was created in this collection.', 'tainacan' ),
|
||||
'info_no_item_publish' => __( 'No public item found.', 'tainacan' ),
|
||||
'info_no_item_private' => __( 'No private item found.', 'tainacan' ),
|
||||
'info_no_item_draft' => __( 'No draft item found.', 'tainacan' ),
|
||||
'info_no_item_trash' => __( 'No item in trash.', 'tainacan' ),
|
||||
'info_no_page_found' => __( 'No page was found with this name.', 'tainacan' ),
|
||||
'info_no_user_found' => __( 'No user was found with this name.', 'tainacan' ),
|
||||
'info_no_item_found_filter' => __( 'No item was found here with these filters.', 'tainacan' ),
|
||||
|
|
|
@ -124,7 +124,7 @@ class Filter extends Entity {
|
|||
function get_filter_type_object(){
|
||||
$class_name = $this->get_filter_type();
|
||||
|
||||
if (empty($class_name)) {
|
||||
if( !class_exists( $class_name ) ){
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -172,9 +172,11 @@ class Metadatum extends Entity {
|
|||
*/
|
||||
function get_metadata_type_object(){
|
||||
$class_name = $this->get_metadata_type();
|
||||
if (empty($class_name)) {
|
||||
|
||||
if( !class_exists( $class_name ) ){
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
$object_type = new $class_name();
|
||||
$object_type->set_options( $this->get_metadata_type_options() );
|
||||
return $object_type;
|
||||
|
|
|
@ -105,7 +105,7 @@ class Numeric extends Filter_Type {
|
|||
|
||||
if ( empty($this->get_option('step')) ) {
|
||||
return [
|
||||
'step' => __('Required step','tainacan')
|
||||
'step' => __('"Step" value is required','tainacan')
|
||||
];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue