Merge branch 'develop' into feature/646

This commit is contained in:
mateuswetah 2022-02-08 11:09:15 -03:00
commit 6e52053762
37 changed files with 600 additions and 367 deletions

View File

@ -3,41 +3,41 @@
id="tainacan-admin-app"
class="has-mounted columns is-fullheight"
:class="{
'tainacan-admin-iframe-mode': isIframeMode,
'tainacan-admin-mobile-mode': isMobileMode,
'tainacan-admin-read-mode': isReadMode
'tainacan-admin-mobile-app-mode': $adminOptions.mobileAppMode
}">
<template v-if="activeRoute == 'HomePage'">
<tainacan-header />
<tainacan-header v-if="!$adminOptions.hideTainacanHeader" />
<router-view />
</template>
<template v-else>
<template v-if="!isIframeMode && !isMobileMode">
<primary-menu
:active-route="activeRoute"
:is-menu-compressed="isMenuCompressed"/>
<button
class="is-hidden-mobile"
id="menu-compress-button"
@click="isMenuCompressed = !isMenuCompressed">
<span
v-tooltip="{
content: $i18n.get('label_shrink_menu'),
autoHide: true,
placement: 'auto-end',
classes: ['tainacan-tooltip', 'tooltip', 'repository-tooltip']
}"
class="icon">
<i
:class="{ 'tainacan-icon-arrowleft' : !isMenuCompressed, 'tainacan-icon-arrowright' : isMenuCompressed }"
class="tainacan-icon tainacan-icon-1-25em"/>
</span>
</button>
<tainacan-header />
<tainacan-repository-subheader
:is-repository-level="isRepositoryLevel"
:is-menu-compressed="isMenuCompressed"/>
</template>
<primary-menu
v-if="!$adminOptions.hidePrimaryMenu"
:active-route="activeRoute"
:is-menu-compressed="isMenuCompressed"/>
<button
v-if="!$adminOptions.hidePrimaryMenu && !$adminOptions.hidePrimaryMenuCompressButton"
class="is-hidden-mobile"
id="menu-compress-button"
:style="{ top: menuCompressButtonTop }"
@click="isMenuCompressed = !isMenuCompressed">
<span
v-tooltip="{
content: $i18n.get('label_shrink_menu'),
autoHide: true,
placement: 'auto-end',
classes: ['tainacan-tooltip', 'tooltip', 'repository-tooltip']
}"
class="icon">
<i
:class="{ 'tainacan-icon-arrowleft' : !isMenuCompressed, 'tainacan-icon-arrowright' : isMenuCompressed }"
class="tainacan-icon tainacan-icon-1-25em"/>
</span>
</button>
<tainacan-header v-if="!$adminOptions.hideTainacanHeader" />
<tainacan-repository-subheader
v-if="!$adminOptions.hideRepositorySubheader"
:is-repository-level="isRepositoryLevel"
:is-menu-compressed="isMenuCompressed"/>
<div
id="repository-container"
class="column is-main-content">
@ -69,14 +69,24 @@
}
},
computed: {
isReadMode() {
return this.$route && this.$route.query && this.$route.query.readmode;
},
isIframeMode() {
return this.$route && this.$route.query && this.$route.query.iframemode;
},
isMobileMode() {
return this.$route && this.$route.query && this.$route.query.mobilemode;
menuCompressButtonTop() {
let amountOfElementsAbove = [
this.$adminOptions.hidePrimaryMenuRepositoryButton,
this.$adminOptions.hidePrimaryMenuCollectionsButton,
this.$adminOptions.hidePrimaryMenuItemsButton
].filter(Boolean).length;
switch (amountOfElementsAbove) {
case 3:
return 'calc(3.05em + 12px)';
case 2:
return 'calc(5.65em + 12px)';
case 1:
return 'calc(8.5em + 12px)';
case 0:
default:
return 'calc(11.125em + 12px)';
}
}
},
watch: {
@ -135,7 +145,7 @@
}
@media screen and (max-width: 769px) {
.is-fullheight:not(.tainacan-admin-mobile-mode):not(.tainacan-admin-collection-mobile-mode) {
.is-fullheight:not(.tainacan-admin-mobile-app-mode):not(.tainacan-admin-collection-mobile-app-mode) {
height: auto;
}
}

View File

@ -5,7 +5,7 @@
:active.sync="isLoading"
:can-cancel="false"/>
<div
v-if="!isMobileMode"
v-if="!$adminOptions.hideBulkEditionPageTitle"
class="tainacan-page-title">
<h1>{{ $i18n.get('add_items_bulk') }}</h1>
<a
@ -209,9 +209,6 @@ export default {
},
collection() {
return this.getCollection()
},
isMobileMode() {
return this.$route && this.$route.query && this.$route.query.mobilemode;
}
},
created() {

View File

@ -6,7 +6,7 @@
:can-cancel="false"/>
<div
v-if="!isMobileMode || (isMobileMode && isEditingMetadataIframeMode)"
v-if="!$adminOptions.hideItemEditionPageTitle || ($adminOptions.hideItemEditionPageTitle && isEditingItemMetadataInsideIframe)"
class="tainacan-page-title">
<h1 v-if="isCreatingNewItem">
<span
@ -23,7 +23,6 @@
<span style="font-weight: 600;">{{ (item != null && item != undefined) ? item.title : '' }}</span>
</h1>
<a
v-if="!isIframeMode"
@click="$router.go(-1)"
class="back-link has-text-secondary">
{{ $i18n.get('back') }}
@ -54,10 +53,10 @@
</template>
<div class="columns">
<!-- Collection -------------------------------- -->
<div
v-if="!isMobileMode"
v-if="!$adminOptions.hideItemEditionCollectionName"
class="column is-narrow">
<div class="section-label">
<label>{{ $i18n.get('collection') }}</label>
@ -76,6 +75,7 @@
<!-- Visibility (status public or private) -------------------------------- -->
<div
v-if="!$adminOptions.hideItemEditionStatusOptions"
style="flex-wrap: wrap"
class="column is-narrow">
<div class="section-label">
@ -114,7 +114,7 @@
<!-- Comment Status ------------------------ -->
<div
class="column is-narrow"
v-if="collection && collection.allow_comments && collection.allow_comments == 'open'">
v-if="collection && collection.allow_comments && collection.allow_comments == 'open' && !$adminOptions.hideItemEditionCommentsToggle">
<div class="section-label">
<label>{{ $i18n.get('label_comments') }}</label>
<help-button
@ -331,7 +331,6 @@
</template>
</div>
<!-- Related items -->
<div
v-if="totalRelatedItems && activeTab === 'related'"
@ -347,16 +346,14 @@
</div>
<related-items-list
:is-mobile-screen="isMobileScreen"
:item-id="itemId"
:collection-id="collectionId"
:related-items="item.related_items"
:related-items="$adminOptions.itemEditionMode"
:is-editable="!isIframeMode"
:is-loading.sync="isLoading" />
</div>
<!-- Attachments ------------------------------------------ -->
<div
v-if="activeTab === 'attachments'"
@ -569,7 +566,9 @@
</div>
<!-- Thumbnail -------------------------------- -->
<div class="section-label">
<div
v-if="!$adminOptions.hideItemEditionThumbnail"
class="section-label">
<label>{{ $i18n.get('label_thumbnail') }}</label>
<help-button
:title="$i18n.getHelperTitle('items', '_thumbnail_id')"
@ -577,7 +576,7 @@
</div>
<div
v-if="!isLoading"
v-if="!isLoading && !$adminOptions.hideItemEditionThumbnail"
class="section-box section-thumbnail">
<div class="thumbnail-field">
<file-item
@ -730,8 +729,8 @@
</p>
</div>
<div
class="form-submission-footer"
v-if="isEditingMetadataIframeMode">
class="form-submission-footer"
v-if="isEditingItemMetadataInsideIframe">
<button
@click="onSubmit()"
type="button"
@ -741,7 +740,7 @@
</div>
<div
class="form-submission-footer"
v-if="form.status == 'trash' && !isEditingMetadataIframeMode">
v-if="form.status == 'trash' && !isEditingItemMetadataInsideIframe">
<button
v-if="item && item.current_user_can_delete"
@click="onDeletePermanently()"
@ -762,7 +761,7 @@
</div>
<div
class="form-submission-footer"
v-if="(form.status == 'auto-draft' || form.status == 'draft' || form.status == undefined) && !isEditingMetadataIframeMode">
v-if="(form.status == 'auto-draft' || form.status == 'draft' || form.status == undefined) && !isEditingItemMetadataInsideIframe">
<button
v-if="isOnSequenceEdit && itemPosition > 1"
@click="onPrevInSequence()"
@ -844,7 +843,7 @@
</div>
<div
class="form-submission-footer"
v-if="(form.status == 'publish' || form.status == 'private') && !isEditingMetadataIframeMode">
v-if="(form.status == 'publish' || form.status == 'private') && !isEditingItemMetadataInsideIframe">
<button
v-if="isOnSequenceEdit && itemPosition > 1"
@click="onPrevInSequence()"
@ -1045,15 +1044,9 @@ export default {
formErrors() {
return eventBusItemMetadata && eventBusItemMetadata.errors && eventBusItemMetadata.errors.length ? eventBusItemMetadata.errors : []
},
isIframeMode() {
return this.$route.query && this.$route.query.iframemode;
},
isEditingMetadataIframeMode() {
isEditingItemMetadataInsideIframe() {
return this.$route.query && this.$route.query.editingmetadata;
},
isMobileMode() {
return this.$route.query && this.$route.query.mobilemode;
},
tabs() {
let pageTabs = [{
slug: 'metadata',
@ -1284,7 +1277,7 @@ export default {
this.isLoading = false;
if (!this.isIframeMode) {
if (!this.$adminOptions.itemEditionMode) {
if (!this.isOnSequenceEdit) {
if (this.form.status != 'trash') {
@ -1329,7 +1322,7 @@ export default {
});
},
onDiscard() {
if (!this.isIframeMode)
if (!this.$adminOptions.itemEditionMode)
this.$router.go(-1);
else
parent.postMessage({

View File

@ -141,7 +141,7 @@
v-for="(collection, index) of collections"
class="tainacan-card">
<ul class="menu-list">
<li>
<li v-if="!$adminOptions.hideHomeCollectionItemsButton">
<router-link
tag="a"
:to="{ path: $routerHelper.getCollectionItemsPath(collection.id, '') }"
@ -156,7 +156,22 @@
<!-- <span class="menu-text">{{ $i18n.get('items') }}</span> -->
</router-link>
</li>
<li v-if="collection.current_user_can_edit">
<li v-if="collection.current_user_can_edit_items && $adminOptions.showHomeCollectionCreateItemButton">
<router-link
tag="a"
:to="{ path: $routerHelper.getNewItemPath(collection.id) }"
:aria-label="$i18n.get('add_one_item')">
<b-tooltip
:label="$i18n.get('add_one_item')"
position="is-bottom">
<span class="icon">
<i class="tainacan-icon tainacan-icon-1-25em tainacan-icon-add"/>
</span>
</b-tooltip>
<!-- <span class="menu-text">{{ $i18n.get('add_one_item') }}</span> -->
</router-link>
</li>
<li v-if="collection.current_user_can_edit && !$adminOptions.hideHomeCollectionSettingsButton">
<router-link
tag="a"
:to="{ path: $routerHelper.getCollectionEditPath(collection.id) }"
@ -171,7 +186,7 @@
<!-- <span class="menu-text">{{ $i18n.get('label_settings') }}</span> -->
</router-link>
</li>
<li v-if="collection.current_user_can_edit_metadata">
<li v-if="collection.current_user_can_edit_metadata && !$adminOptions.hideHomeCollectionMetadataButton">
<router-link
tag="a"
:to="{ path: $routerHelper.getCollectionMetadataPath(collection.id) }"
@ -186,7 +201,7 @@
<!-- <span class="menu-text">{{ $i18n.getFrom('metadata', 'name') }}</span> -->
</router-link>
</li>
<li v-if="collection.current_user_can_edit_filters">
<li v-if="collection.current_user_can_edit_filters && !$adminOptions.hideHomeCollectionFiltersButton">
<router-link
tag="a"
:to="{ path: $routerHelper.getCollectionFiltersPath(collection.id) }"
@ -202,7 +217,7 @@
<!-- <span class="menu-text">{{ $i18n.getFrom('filters', 'name') }}</span> -->
</router-link>
</li>
<li v-if="$userCaps.hasCapability('tnc_rep_read_logs')">
<li v-if="$userCaps.hasCapability('tnc_rep_read_logs') && !$adminOptions.hideHomeCollectionActivitiesButton">
<router-link
tag="a"
:to="{ path: $routerHelper.getCollectionActivitiesPath(collection.id) }"
@ -217,7 +232,7 @@
<!-- <span class="menu-text">{{ $i18n.get('activities') }}</span> -->
</router-link>
</li>
<li>
<li v-if="!$adminOptions.hideHomeCollectionThemeCollectionButton">
<a
:href="collection.url"
target="_blank"

View File

@ -5,7 +5,9 @@
<div
v-if="collectionId && collection && collection.current_user_can_edit_items && collection.current_user_can_bulk_edit"
class="selection-control">
<div class="field select-all is-pulled-left">
<div
v-if="!$adminOptions.hideItemsListMultipleSelection"
class="field select-all is-pulled-left">
<span>
<b-checkbox
@click.native.prevent="selectAllItemsOnPage()"
@ -48,6 +50,7 @@
</button>
</span>
<div
v-if="!$adminOptions.hideItemsListBulkActionsButton"
style="margin-left: auto;"
class="field">
<b-dropdown
@ -112,7 +115,7 @@
<!-- Context menu for right click selection -->
<div
v-if="cursorPosY > 0 && cursorPosX > 0 && !isReadMode"
v-if="cursorPosY > 0 && cursorPosX > 0 && !$adminOptions.hideItemsListContextMenu"
class="context-menu">
<!-- Backdrop for escaping context menu -->
@ -127,12 +130,12 @@
trap-focus>
<b-dropdown-item
@click="openItem()"
v-if="!isOnTrash && !isIframeMode">
v-if="!isOnTrash && !$adminOptions.hideItemsListContextMenuOpenItemOption">
{{ $i18n.getFrom('items','view_item') }}
</b-dropdown-item>
<b-dropdown-item
@click="openItemOnNewTab()"
v-if="!isOnTrash && !isIframeMode">
v-if="!isOnTrash && !$adminOptions.hideItemsListContextMenuOpenItemOnNewTabOption">
{{ $i18n.get('label_open_item_new_tab') }}
</b-dropdown-item>
<b-dropdown-item
@ -142,17 +145,17 @@
</b-dropdown-item>
<b-dropdown-item
@click="goToItemEditPage(contextMenuItem)"
v-if="contextMenuItem != null && contextMenuItem.current_user_can_edit && !isIframeMode">
v-if="contextMenuItem != null && contextMenuItem.current_user_can_edit && !$adminOptions.hideItemsListContextMenuEditItemOption">
{{ $i18n.getFrom('items','edit_item') }}
</b-dropdown-item>
<b-dropdown-item
@click="makeCopiesOfOneItem(contextMenuItem.id)"
v-if="contextMenuItem != null && contextMenuItem.current_user_can_edit && !isIframeMode">
v-if="contextMenuItem != null && contextMenuItem.current_user_can_edit && !$adminOptions.hideItemsListContextMenuCopyItemOption">
{{ $i18n.get('label_make_copies_of_item') }}
</b-dropdown-item>
<b-dropdown-item
@click="deleteOneItem(contextMenuItem.id)"
v-if="contextMenuItem != null && contextMenuItem.current_user_can_edit && !isIframeMode">
v-if="contextMenuItem != null && contextMenuItem.current_user_can_edit && !$adminOptions.hideItemsListContextMenuDeleteItemOption">
{{ $i18n.get('label_delete_item') }}
</b-dropdown-item>
</b-dropdown>
@ -162,6 +165,7 @@
<div
role="list"
class="tainacan-grid-container"
:class="{ 'hide-items-selection': $adminOptions.hideItemsListSelection }"
v-if="viewMode == 'grid'">
<div
role="listitem"
@ -172,13 +176,13 @@
class="tainacan-grid-item">
<!-- Checkbox -->
<!-- TODO: Remove v-if="collectionId" from this element when the bulk edit in repository is done -->
<!-- TODO: Remove v-if="collectionId" from this element when the bulk edit for repository level is implemented -->
<div
v-if="collectionId && !isReadMode && (isIframeMode || collection && collection.current_user_can_bulk_edit)"
v-if="collectionId && !$adminOptions.hideItemsListSelection && ($adminOptions.itemsSingleSelectionMode || $adminOptions.itemsMultipleSelectionMode || (collection && collection.current_user_can_bulk_edit))"
:class="{ 'is-selecting': isSelectingItems }"
class="grid-item-checkbox">
<b-checkbox
v-if="!isSingleSelectionMode"
v-if="!$adminOptions.itemsSingleSelectionMode"
:value="getSelectedItemChecked(item.id)"
@input="setSelectedItemChecked(item.id)"/>
<b-radio
@ -190,7 +194,7 @@
<!-- Title -->
<div
:style="{ 'padding-left': !collectionId || !(isIframeMode || collection && collection.current_user_can_bulk_edit) || isReadMode? '0.5em !important' : (isOnAllItemsTabs ? '1.875em' : '2.75em') }"
:style="{ 'padding-left': !collectionId || !($adminOptions.itemsSingleSelectionMode || $adminOptions.itemsMultipleSelectionMode || (collection && collection.current_user_can_bulk_edit)) || $adminOptions.itemsSearchSelectionMode ? '0.5em !important' : (isOnAllItemsTabs ? '1.875em' : '2.75em') }"
class="metadata-title">
<p
v-tooltip="{
@ -241,7 +245,7 @@
<!-- Actions -->
<div
v-if="item.current_user_can_edit && !isIframeMode"
v-if="item.current_user_can_edit && !$adminOptions.hideItemsListActionAreas"
class="actions-area"
:label="$i18n.get('label_actions')">
<a
@ -301,6 +305,7 @@
v-if="viewMode == 'masonry'"
:cols="{default: 7, 1919: 6, 1407: 5, 1215: 4, 1023: 3, 767: 2, 343: 1}"
:gutter="25"
:class="{ 'hide-items-selection': $adminOptions.hideItemsListSelection }"
class="tainacan-masonry-container">
<div
role="listitem"
@ -315,14 +320,14 @@
<!-- Checkbox -->
<!-- TODO: Remove v-if="collectionId" from this element when the bulk edit in repository is done -->
<div
v-if="collectionId && !isReadMode && (isIframeMode || collection && collection.current_user_can_bulk_edit)"
v-if="collectionId && !$adminOptions.hideItemsListSelection && ($adminOptions.itemsSingleSelectionMode || $adminOptions.itemsMultipleSelectionMode || (collection && collection.current_user_can_bulk_edit))"
:class="{ 'is-selecting': isSelectingItems }"
class="masonry-item-checkbox">
<label
tabindex="0"
:class="(!isSingleSelectionMode ? 'b-checkbox checkbox' : 'b-radio radio') + ' is-small'">
:class="(!$adminOptions.itemsSingleSelectionMode ? 'b-checkbox checkbox' : 'b-radio radio') + ' is-small'">
<input
v-if="!isSingleSelectionMode"
v-if="!$adminOptions.itemsSingleSelectionMode"
type="checkbox"
:checked="getSelectedItemChecked(item.id)"
@input="setSelectedItemChecked(item.id)">
@ -340,7 +345,7 @@
<!-- Title -->
<div
:style="{
'padding-left': !collectionId || !(isIframeMode || collection && collection.current_user_can_bulk_edit) || isReadMode ? '0 !important' : (isOnAllItemsTabs ? '0.5em' : '1em')
'padding-left': !collectionId || !($adminOptions.itemsSingleSelectionMode || $adminOptions.itemsMultipleSelectionMode || (collection && collection.current_user_can_bulk_edit)) || $adminOptions.itemsSearchSelectionMode ? '0 !important' : (isOnAllItemsTabs ? '0.5em' : '1em')
}"
@click.left="onClickItem($event, item)"
@click.right="onRightClickItem($event, item)"
@ -381,7 +386,7 @@
<!-- Actions -->
<div
v-if="item.current_user_can_edit && !isIframeMode"
v-if="item.current_user_can_edit && !$adminOptions.hideItemsListActionAreas"
class="actions-area"
:label="$i18n.get('label_actions')">
<a
@ -437,6 +442,7 @@
<!-- CARDS VIEW MODE -->
<div
role="list"
:class="{ 'hide-items-selection': $adminOptions.hideItemsListSelection }"
class="tainacan-cards-container"
v-if="viewMode == 'cards'">
<div
@ -450,11 +456,11 @@
<!-- Checkbox -->
<!-- TODO: Remove v-if="collectionId" from this element when the bulk edit in repository is done -->
<div
v-if="collectionId && !isReadMode && (isIframeMode || collection && collection.current_user_can_bulk_edit)"
v-if="collectionId && !$adminOptions.hideItemsListSelection && ($adminOptions.itemsSingleSelectionMode || $adminOptions.itemsMultipleSelectionMode || (collection && collection.current_user_can_bulk_edit))"
:class="{ 'is-selecting': isSelectingItems }"
class="card-checkbox">
<b-checkbox
v-if="!isSingleSelectionMode"
v-if="!$adminOptions.itemsSingleSelectionMode"
:value="getSelectedItemChecked(item.id)"
@input="setSelectedItemChecked(item.id)"/>
<b-radio
@ -467,7 +473,7 @@
<!-- Title -->
<div
:style="{
'padding-left': !collectionId || !(isIframeMode || collection && collection.current_user_can_bulk_edit) || isReadMode ? '0.5em !important' : (isOnAllItemsTabs ? '2.125em' : '2.75em'),
'padding-left': !collectionId || !($adminOptions.itemsSingleSelectionMode || $adminOptions.itemsMultipleSelectionMode || (collection && collection.current_user_can_bulk_edit)) || $adminOptions.itemsSearchSelectionMode ? '0.5em !important' : (isOnAllItemsTabs ? '2.125em' : '2.75em'),
}"
class="metadata-title">
<p
@ -502,7 +508,7 @@
</div>
<!-- Actions -->
<div
v-if="item.current_user_can_edit && !isIframeMode"
v-if="item.current_user_can_edit && !$adminOptions.hideItemsListActionAreas"
class="actions-area"
:label="$i18n.get('label_actions')">
<a
@ -630,6 +636,7 @@
role="list"
:cols="{default: 4, 1919: 3, 1407: 2, 1215: 2, 1023: 1, 767: 1, 343: 1}"
:gutter="30"
:class="{ 'hide-items-selection': $adminOptions.hideItemsListSelection }"
class="tainacan-records-container"
v-if="viewMode == 'records'">
<div
@ -643,14 +650,14 @@
<!-- Checkbox -->
<!-- TODO: Remove v-if="collectionId" from this element when the bulk edit in repository is done -->
<div
v-if="collectionId && !isReadMode && (isIframeMode || collection && collection.current_user_can_bulk_edit)"
v-if="collectionId && !$adminOptions.hideItemsListSelection && ($adminOptions.itemsSingleSelectionMode || $adminOptions.itemsMultipleSelectionMode || (collection && collection.current_user_can_bulk_edit))"
:class="{ 'is-selecting': isSelectingItems }"
class="record-checkbox">
<label
tabindex="0"
:class="(!isSingleSelectionMode ? 'b-checkbox checkbox' : 'b-radio radio') + ' is-small'">
:class="(!$adminOptions.itemsSingleSelectionMode ? 'b-checkbox checkbox' : 'b-radio radio') + ' is-small'">
<input
v-if="!isSingleSelectionMode"
v-if="!$adminOptions.itemsSingleSelectionMode"
type="checkbox"
:checked="getSelectedItemChecked(item.id)"
@input="setSelectedItemChecked(item.id)">
@ -669,7 +676,7 @@
<div
class="metadata-title"
:style="{
'padding-left': !collectionId || !(isIframeMode || collection && collection.current_user_can_bulk_edit) || isReadMode ? '1.5em !important' : '2.75em'
'padding-left': !collectionId || !($adminOptions.itemsSingleSelectionMode || $adminOptions.itemsMultipleSelectionMode || (collection && collection.current_user_can_bulk_edit)) || $adminOptions.itemsSearchSelectionMode ? '1.5em !important' : '2.75em'
}">
<span
v-if="isOnAllItemsTabs && $statusHelper.hasIcon(item.status)"
@ -722,7 +729,7 @@
</div>
<!-- Actions -->
<div
v-if="item.current_user_can_edit && !isIframeMode"
v-if="item.current_user_can_edit && !$adminOptions.hideItemsListActionAreas"
class="actions-area"
:label="$i18n.get('label_actions')">
<a
@ -832,12 +839,13 @@
<!-- TABLE VIEW MODE -->
<table
v-if="viewMode == 'table'"
:class="{ 'hide-items-selection': $adminOptions.hideItemsListSelection }"
class="tainacan-table">
<thead>
<tr>
<!-- Checking list -->
<th
v-if="collectionId && !isReadMode && (isIframeMode || collection && collection.current_user_can_bulk_edit)">
v-if="collectionId && !$adminOptions.hideItemsListSelection && ($adminOptions.itemsSingleSelectionMode || $adminOptions.itemsMultipleSelectionMode || (collection && collection.current_user_can_bulk_edit))">
&nbsp;
<!-- nothing to show on header for checkboxes -->
</th>
@ -886,11 +894,11 @@
<!-- Checking list -->
<!-- TODO: Remove v-if="collectionId" from this element when the bulk edit in repository is done -->
<td
v-if="collectionId && !isReadMode && (isIframeMode || collection && collection.current_user_can_bulk_edit)"
v-if="collectionId && !$adminOptions.hideItemsListSelection && ($adminOptions.itemsSingleSelectionMode || $adminOptions.itemsMultipleSelectionMode || (collection && collection.current_user_can_bulk_edit))"
:class="{ 'is-selecting': isSelectingItems }"
class="checkbox-cell">
<b-checkbox
v-if="!isSingleSelectionMode"
v-if="!$adminOptions.itemsSingleSelectionMode"
:value="getSelectedItemChecked(item.id)"
@input="setSelectedItemChecked(item.id)"/>
<b-radio
@ -1051,7 +1059,7 @@
<!-- Actions -->
<td
v-if="(item.current_user_can_edit || item.current_user_can_delete) && !isIframeMode"
v-if="(item.current_user_can_edit || item.current_user_can_delete) && !$adminOptions.hideItemsListActionAreas"
class="actions-cell"
:label="$i18n.get('label_actions')">
<div class="actions-container">
@ -1111,6 +1119,7 @@
<div
role="list"
v-if="viewMode == 'list'"
:class="{ 'hide-items-selection': $adminOptions.hideItemsListSelection }"
class="tainacan-list-container">
<div
role="listitem"
@ -1122,14 +1131,14 @@
:class="{ 'selected-list-item': getSelectedItemChecked(item.id) == true }">
<div
v-if="collectionId && !isReadMode && (isIframeMode || collection && collection.current_user_can_bulk_edit)"
v-if="collectionId && !$adminOptions.hideItemsListSelection && ($adminOptions.itemsSingleSelectionMode || $adminOptions.itemsMultipleSelectionMode || (collection && collection.current_user_can_bulk_edit))"
:class="{ 'is-selecting': isSelectingItems }"
class="list-checkbox">
<label
tabindex="0"
:class="(!isSingleSelectionMode ? 'b-checkbox checkbox' : 'b-radio radio') + ' is-small'">
:class="(!$adminOptions.itemsSingleSelectionMode ? 'b-checkbox checkbox' : 'b-radio radio') + ' is-small'">
<input
v-if="!isSingleSelectionMode"
v-if="!$adminOptions.itemsSingleSelectionMode"
type="checkbox"
:checked="getSelectedItemChecked(item.id)"
@input="setSelectedItemChecked(item.id)">
@ -1147,7 +1156,7 @@
<!-- Title -->
<div
:style="{
'padding-left': !collectionId || !($route.query.iframemode || collection && collection.current_user_can_bulk_edit) || $route.query.readmode ? '1.5em !important' : (isOnAllItemsTabs ? '2.0em' : '2.75em'),
'padding-left': !collectionId || !($adminOptions.itemsSingleSelectionMode || $adminOptions.itemsMultipleSelectionMode || (collection && collection.current_user_can_bulk_edit)) || $route.query.itemsSearchSelectionMode ? '1.5em !important' : (isOnAllItemsTabs ? '2.0em' : '2.75em'),
}"
class="metadata-title">
<span
@ -1185,7 +1194,7 @@
<!-- Actions -->
<div
v-if="item.current_user_can_edit && !isIframeMode"
v-if="item.current_user_can_edit && !$adminOptions.hideItemsListActionAreas"
class="actions-area"
:label="$i18n.get('label_actions')">
<a
@ -1324,7 +1333,7 @@ export default {
return this.getHighlightedItem();
},
selectedItems () {
if (this.isIframeMode)
if (this.$adminOptions.itemsSingleSelectionMode || this.$adminOptions.itemsMultipleSelectionMode)
this.$eventBusSearch.setSelectedItemsForIframe(this.getSelectedItems());
return this.getSelectedItems();
@ -1354,15 +1363,6 @@ export default {
totalPages(){
return Math.ceil(Number(this.totalItems)/Number(this.itemsPerPage));
},
isIframeMode () {
return this.$route && this.$route.query && this.$route.query.iframemode;
},
isReadMode () {
return this.$route && this.$route.query && this.$route.query.readmode;
},
isSingleSelectionMode () {
return this.$route && this.$route.query && this.$route.query.singleselectionmode;
},
isOnAllItemsTabs() {
const currentStatus = this.getStatus();
return !currentStatus || (currentStatus.indexOf(',') > 0);
@ -1385,8 +1385,7 @@ export default {
this.queryAllItemsSelected = {};
},
singleItemSelection() {
if (this.isSingleSelectionMode && this.isIframeMode)
if (this.$adminOptions.itemsSingleSelectionMode)
this.$eventBusSearch.setSelectedItemsForIframe([this.singleItemSelection], true);
}
},
@ -1426,7 +1425,7 @@ export default {
'getItemsPerPage'
]),
setSelectedItemChecked(itemId) {
if (this.isSingleSelectionMode) {
if (this.$adminOptions.itemsSingleSelectionMode) {
this.singleItemSelection = itemId;
} else {
if (this.selectedItems.find((item) => item == itemId) != undefined)
@ -1437,7 +1436,7 @@ export default {
}
},
getSelectedItemChecked(itemId) {
return this.isSingleSelectionMode ? this.singleItemSelection == itemId : this.selectedItems.find(item => item == itemId) != undefined;
return this.$adminOptions.itemsSingleSelectionMode ? this.singleItemSelection == itemId : this.selectedItems.find(item => item == itemId) != undefined;
},
openBulkEditionModal(){
this.$buefy.modal.open({
@ -1676,10 +1675,10 @@ export default {
}
} else {
if (this.isIframeMode && !this.isReadMode) {
if ((this.$adminOptions.itemsSingleSelectionMode || this.$adminOptions.itemsMultipleSelectionMode) && !this.$adminOptions.itemsSearchSelectionMode) {
this.setSelectedItemChecked(item.id)
} else if (!this.isIframeMode && !this.isReadMode) {
if(this.isOnTrash){
} else if (!this.$adminOptions.itemsSingleSelectionMode && !this.$adminOptions.itemsMultipleSelectionMode && !this.$adminOptions.itemsSearchSelectionMode) {
if (this.isOnTrash) {
this.$buefy.toast.open({
duration: 3000,
message: this.$i18n.get('info_warning_remove_from_trash_first'),
@ -1693,7 +1692,7 @@ export default {
}
},
onRightClickItem($event, item) {
if (!this.isReadMode) {
if (!this.$adminOptions.itemsSearchSelectionMode) {
$event.preventDefault();
this.cursorPosX = $event.clientX;

View File

@ -114,6 +114,10 @@
:aria-label="$i18n.getFrom('items','edit_item')">
<span
v-tooltip="{
delay: {
show: 500,
hide: 100,
},
content: $i18n.get('edit'),
autoHide: true,
placement: 'auto'
@ -137,7 +141,7 @@
<iframe
width="100%"
:style="{ height: (isMobileScreen ? '100vh' : '85vh') }"
:src="adminFullURL + $routerHelper.getItemEditPath(collectionId, editItemId) + '?iframemode=true&editingmetadata=' + editMetadataId + (isMobileMode ? '&mobilemode=true' : '')" />
:src="adminURL + 'itemEditionMode=true' + ($adminOptions.mobileAppMode ? '&mobileAppMode=true' : '') + '&page=tainacan_admin#' + $routerHelper.getItemEditPath(collectionId, editItemId) + '?editingmetadata=' + editMetadataId" />
</b-modal>
</div>
</div>
@ -161,7 +165,7 @@
editMetadataId: false,
editItemId: false,
editItemModal: false,
adminFullURL: tainacan_plugin.admin_url + 'admin.php?page=tainacan_admin#',
adminURL: tainacan_plugin.admin_url + 'admin.php?',
isUpdatingRelatedItems: false
}
},
@ -171,9 +175,6 @@
},
displayLoading() {
return this.isLoading || this.isUpdatingRelatedItems;
},
isMobileMode() {
return this.$route && this.$route.query && this.$route.query.mobilemode;
}
},
watch: {

View File

@ -59,10 +59,10 @@
{{ $i18n.get('info_no_item_found') }}
</template>
<template
v-if="currentUserCanEditItems && !($route && $route.query.iframemode)"
v-if="currentUserCanEditItems && !$adminOptions.itemEditionMode"
slot="footer">
<a @click="editItemModalOpen = true">
{{ $i18n.get('label_crate_new_item') + ' "' + searchQuery + '"' }}
{{ $i18n.get('label_create_new_item') + ' "' + searchQuery + '"' }}
</a>
</template>
</b-taginput>
@ -81,7 +81,7 @@
style="position: relative;">
<div v-html="itemValue.valuesAsHtml" />
<a
v-if="currentUserCanEditItems && $route && !$route.query.iframemode"
v-if="currentUserCanEditItems && !$adminOptions.itemEditionMode"
@click="editSelected(itemValue.value)"
class="relationship-value-button--edit">
<span class="icon">
@ -112,13 +112,13 @@
</b-tabs>
<a
v-if="currentUserCanEditItems && itemMetadatum.item && itemMetadatum.item.id && (maxMultipleValues === undefined || maxMultipleValues > selected.length)"
:disabled="!$route || $route.query.iframemode"
:disabled="!$adminOptions.itemEditionMode"
@click="editItemModalOpen = !editItemModalOpen"
class="add-link">
<span class="icon is-small">
<i class="tainacan-icon has-text-secondary tainacan-icon-add"/>
</span>
&nbsp;{{ $i18n.get('label_crate_new_item') }}
&nbsp;{{ $i18n.get('label_create_new_item') }}
</a>
<b-modal
:width="1200"
@ -160,7 +160,7 @@
page: 1,
activeTab: 0,
editItemModalOpen: false,
adminFullURL: tainacan_plugin.admin_url + 'admin.php?page=tainacan_admin#',
adminURL: tainacan_plugin.admin_url + 'admin.php?',
currentUserCanEditItems: false,
selectedValuesAsHtml: []
}
@ -180,9 +180,9 @@
},
itemModalSrc() {
if (this.editingItemId)
return this.adminFullURL + this.$routerHelper.getItemEditPath(this.collectionId, this.editingItemId) + '?iframemode=true' + (this.isMobileMode ? '&mobilemode=true' : '');
return this.adminURL + 'itemEditionMode=true' + (this.$adminOptions.mobileAppMode ? '&mobileAppMode=true' : '') + '&page=tainacan_admin#' + this.$routerHelper.getItemEditPath(this.collectionId, this.editingItemId);
else
return this.adminFullURL + this.$routerHelper.getNewItemPath(this.collectionId) + '?iframemode=true&newmetadatumid=' + this.itemMetadatum.metadatum.metadata_type_options.search + '&newitemtitle=' + this.searchQuery + (this.isMobileMode ? '&mobilemode=true' : '');
return this.adminURL + 'itemEditionMode=true' + (this.$adminOptions.mobileAppMode ? '&mobileAppMode=true' : '') + '&page=tainacan_admin#' + this.$routerHelper.getNewItemPath(this.collectionId) + '?newmetadatumid=' + this.itemMetadatum.metadatum.metadata_type_options.search + '&newitemtitle=' + this.searchQuery;
},
relationshipInputId() {
if (this.itemMetadatum && this.itemMetadatum.metadatum)
@ -197,9 +197,6 @@
this.itemMetadatum.metadatum.metadata_type_options.display_related_item_metadata &&
this.itemMetadatum.metadatum.metadata_type_options.display_related_item_metadata.length &&
this.itemMetadatum.metadatum.metadata_type_options.display_related_item_metadata.length > 1;
},
isMobileMode() {
return this.$route && this.$route.query && this.$route.query.mobilemode;
}
},
watch: {

View File

@ -8,7 +8,9 @@
<aside class="menu">
<ul class="menu-list">
<li class="repository-label">
<li
v-if="!$adminOptions.hidePrimaryMenuRepositoryButton"
class="repository-label">
<router-link
tag="a"
:to="$routerHelper.getCollectionsPath()">
@ -20,7 +22,7 @@
</span>
</router-link>
</li>
<li>
<li v-if="!$adminOptions.hidePrimaryMenuCollectionsButton">
<router-link
tag="a"
:to="$routerHelper.getCollectionsPath()"
@ -31,7 +33,7 @@
<span class="menu-text">{{ $i18n.getFrom('collections', 'name') }}</span>
</router-link>
</li>
<li>
<li v-if="!$adminOptions.hidePrimaryMenuItemsButton">
<router-link
tag="a"
:to="$routerHelper.getItemsPath()"
@ -43,7 +45,7 @@
</router-link>
</li>
<li class="separator"/>
<li v-if="$userCaps.hasCapability('tnc_rep_edit_metadata')">
<li v-if="$userCaps.hasCapability('tnc_rep_edit_metadata') && !$adminOptions.hidePrimaryMenuMetadataButton">
<router-link
tag="a"
to="/metadata"
@ -54,7 +56,7 @@
<span class="menu-text">{{ $i18n.get('metadata') }}</span>
</router-link>
</li>
<li v-if="$userCaps.hasCapability('tnc_rep_edit_filters')">
<li v-if="$userCaps.hasCapability('tnc_rep_edit_filters') && !$adminOptions.hidePrimaryMenuFiltersButton">
<router-link
tag="a"
to="/filters"
@ -65,7 +67,7 @@
<span class="menu-text">{{ $i18n.getFrom('filters', 'name') }}</span>
</router-link>
</li>
<li>
<li v-if="!$adminOptions.hidePrimaryMenuTaxonomiesButton">
<router-link
tag="a"
to="/taxonomies"
@ -76,7 +78,7 @@
<span class="menu-text">{{ $i18n.getFrom('taxonomies', 'name') }}</span>
</router-link>
</li>
<li>
<li v-if="!$adminOptions.hidePrimaryMenuActivitiesButton">
<router-link
tag="a"
to="/activities"
@ -89,7 +91,7 @@
</li>
<li
class="is-hidden-mobile"
v-if="$userCaps.hasCapability('tnc_rep_edit_users')">
v-if="$userCaps.hasCapability('tnc_rep_edit_users') && !$adminOptions.hidePrimaryMenuCapabilitiesButton">
<router-link
tag="a"
:to="this.$routerHelper.getCapabilitiesPath()"
@ -100,7 +102,7 @@
<span class="menu-text">{{ $i18n.get('capabilities') }}</span>
</router-link>
</li>
<li>
<li v-if="!$adminOptions.hidePrimaryMenuImportersButton">
<router-link
tag="a"
to="/importers"
@ -115,7 +117,7 @@
<span class="menu-text menu-text-import">{{ $i18n.get('importers') }}</span>
</router-link>
</li>
<li>
<li v-if="!$adminOptions.hidePrimaryMenuExportersButton">
<router-link
tag="a"
to="/exporters"

View File

@ -3,7 +3,9 @@
id="tainacan-header"
class="level is-mobile">
<div class="level-left">
<div class="level-item home-area">
<div
v-if="!$adminOptions.hideTainacanHeaderHomeButton"
class="level-item home-area">
<router-link
tag="a"
to="/">
@ -31,7 +33,9 @@
</div>
</div>
<div class="level-right">
<div class="is-hidden-tablet">
<div
v-if="!$adminOptions.hideTainacanHeaderSearchInput"
class="is-hidden-tablet">
<button
@click="$router.push($routerHelper.getItemsPath())"
class="button is-small is-white level-item">
@ -41,20 +45,22 @@
</button>
</div>
<div class="search-area is-hidden-mobile">
<b-input
type="search"
autocomplete="on"
:aria-label="$i18n.get('instruction_search_in_repository')"
:placeholder="$i18n.get('instruction_search_in_repository')"
class="search-header"
size="is-small"
:value="searchQuery"
@input.native="futureSearchQuery = $event.target.value"
@keyup.enter.native="updateSearch()"
icon-right="magnify"
icon-right-clickable
@icon-right-click="updateSearch()" />
<b-input
v-if="!$adminOptions.hideTainacanHeaderSearchInput"
type="search"
autocomplete="on"
:aria-label="$i18n.get('instruction_search_in_repository')"
:placeholder="$i18n.get('instruction_search_in_repository')"
class="search-header"
size="is-small"
:value="searchQuery"
@input.native="futureSearchQuery = $event.target.value"
@keyup.enter.native="updateSearch()"
icon-right="magnify"
icon-right-clickable
@icon-right-click="updateSearch()" />
<b-dropdown
v-if="!$adminOptions.hideTainacanHeaderAdvancedSearch"
ref="advancedSearchShortcut"
class="advanced-search-header-dropdown"
position="is-bottom-left"
@ -88,6 +94,7 @@
</div>
<button
v-if="!$adminOptions.hideTainacanHeaderProcessesPopup"
@click="showProcesses = !showProcesses"
class="button is-small is-white level-item">
<span

View File

@ -3,8 +3,27 @@
id="tainacan-repository-subheader"
class="level secondary-page"
:class="{'is-menu-compressed': isMenuCompressed, 'is-repository-level' : isRepositoryLevel}">
<h1 v-if="isRepositoryLevel">{{ repositoryName }}</h1>
<h1 v-else>
<div
v-if="$adminOptions.hideCollectionSubheader"
class="back-button is-hidden-mobile">
<button
@click="$router.go(-1)"
class="button is-turquoise4">
<span class="icon">
<i class="tainacan-icon tainacan-icon-previous"/>
</span>
</button>
</div>
<h1
v-if="isRepositoryLevel"
:style="$adminOptions.hideCollectionSubheader ? 'margin-right: auto;' : ''">
{{ repositoryName }}
</h1>
<h1
v-else
:style="$adminOptions.hideCollectionSubheader ? 'margin-right: auto;' : ''">
{{ $i18n.get('collection') + '' }}
<span class="has-text-weight-bold">
{{ collection && collection.name ? collection.name : '' }}
@ -41,7 +60,7 @@
@click="openAvailableExportersModal"
class="button"
id="exporter-collection-button"
v-if="!isRepositoryLevel">
v-if="!isRepositoryLevel && !$adminOptions.hideRepositorySubheaderExportButton">
<span class="icon">
<i class="tainacan-icon tainacan-icon-1-25em tainacan-icon-export"/>
</span>
@ -61,7 +80,7 @@
<a
:href="collection && collection.url ? collection.url : ''"
target="_blank"
v-if="!isRepositoryLevel && collection && collection.url"
v-if="!isRepositoryLevel && collection && collection.url && !$adminOptions.hideRepositorySubheaderViewCollectionButton"
class="button"
id="view-collection-button">
<span class="icon">
@ -84,7 +103,7 @@
<a
:href="repositoryURL"
target="_blank"
v-if="isRepositoryLevel"
v-if="isRepositoryLevel && !$adminOptions.hideRepositorySubheaderViewCollectionsButton"
class="button"
id="view-repository-button">
<span class="icon">
@ -214,6 +233,31 @@ export default {
transition: all 0.2s linear;
}
.back-button {
padding: 0;
margin: 0;
width: var(--tainacan-one-column);
min-width: var(--tainacan-one-column);
color: var(--tainacan-white);
display: flex;
margin-left: calc(-1 * var(--tainacan-one-column));
button,
button:hover,
button:focus,
button:active {
width: 100%;
color: var(--tainacan-white);
background-color: transparent !important;
border: none;
height: $subheader-height !important;
.icon {
margin-top: -2px;
font-size: 1.5em;
}
}
}
.repository-subheader-icons {
display: flex;
flex-wrap: nowrap;

View File

@ -11,7 +11,11 @@
}">
<a :style="{ fontWeight: 'bold', color: 'var(--tainacan-gray5) !important' }">
{{ $i18n.get('label_all_items') }}
<span class="has-text-gray">&nbsp;{{ (isRepositoryLevel && repositoryTotalItems) ? ` (${ repositoryTotalItems.private + repositoryTotalItems.publish + repositoryTotalItems.draft })` : (collection && collection.total_items ? ` (${Number(collection.total_items.private) + Number(collection.total_items.publish) + Number(collection.total_items.draft)})` : '') }}</span>
<span
v-if="!$adminOptions.hideItemsListStatusTabsTotalItems"
class="has-text-gray">
&nbsp;{{ (isRepositoryLevel && repositoryTotalItems) ? ` (${ repositoryTotalItems.private + repositoryTotalItems.publish + repositoryTotalItems.draft })` : (collection && collection.total_items ? ` (${Number(collection.total_items.private) + Number(collection.total_items.publish) + Number(collection.total_items.draft)})` : '') }}
</span>
</a>
</li>
<li
@ -36,7 +40,11 @@
/>
</span>
{{ statusOption.name }}
<span class="has-text-gray">&nbsp;{{ (isRepositoryLevel && repositoryTotalItems) ? ` (${ repositoryTotalItems[statusOption.slug] })` : (collection && collection.total_items ? ` (${collection.total_items[statusOption.slug]})` : '') }}</span>
<span
v-if="!$adminOptions.hideItemsListStatusTabsTotalItems"
class="has-text-gray">
&nbsp;{{ (isRepositoryLevel && repositoryTotalItems) ? ` (${ repositoryTotalItems[statusOption.slug] })` : (collection && collection.total_items ? ` (${collection.total_items[statusOption.slug]})` : '') }}
</span>
</a>
</li>
</ul>
@ -58,23 +66,28 @@ export default {
return this.getCollection();
},
repositoryTotalItems() {
let collections = this.getCollections();
let total_items = {
trash: 0,
publish: 0,
draft: 0,
private: 0
};
if (!this.$adminOptions.hideItemsListStatusTabsTotalItems) {
let collections = this.getCollections();
for(let collection of collections){
total_items.trash += Number(collection.total_items.trash);
total_items.draft += Number(collection.total_items.draft);
total_items.publish += Number(collection.total_items.publish);
total_items.private += Number(collection.total_items.private);
let total_items = {
trash: 0,
publish: 0,
draft: 0,
private: 0
};
for(let collection of collections){
total_items.trash += Number(collection.total_items.trash);
total_items.draft += Number(collection.total_items.draft);
total_items.publish += Number(collection.total_items.publish);
total_items.private += Number(collection.total_items.private);
}
return total_items;
} else {
return '';
}
return total_items;
}
},
methods: {

View File

@ -271,7 +271,7 @@
</p>
<p>{{ $i18n.get('info_there_is_no_filter' ) }}</p>
<router-link
v-if="!$route.query.iframemode && this.$route.name != null"
v-if="!$adminOptions.hideItemsListFilterCreationButton && $route.name != null"
id="button-create-filter"
:to="isRepositoryLevel && $routerHelper ? $routerHelper.getNewFilterPath() : $routerHelper.getNewCollectionFilterPath(collectionId)"
tag="button"

View File

@ -68,7 +68,8 @@ import {
ConsolePlugin,
UserCapabilitiesPlugin,
StatusHelperPlugin,
CommentsStatusHelperPlugin
CommentsStatusHelperPlugin,
AdminOptionsHelperPlugin
} from './admin-utilities';
import {
ThumbnailHelperPlugin,
@ -113,6 +114,7 @@ export default (element) => {
Vue.use(ConsolePlugin, {visual: false});
Vue.use(VueTheMask);
Vue.use(CommentsStatusHelperPlugin);
Vue.use(AdminOptionsHelperPlugin, pageElement.dataset['options']);
/* Registers Extra Vue Components passed to the window.tainacan_extra_components */

View File

@ -435,4 +435,194 @@ CommentsStatusHelperPlugin.install = function (Vue, options = {}) {
}
}
};
// ADMIN OPTIONS HELPER PLUGIN - Stores options passed to the data-options in the admin div.
export const AdminOptionsHelperPlugin = {};
AdminOptionsHelperPlugin.install = function (Vue, options = {}) {
// Passes options to global variable
try {
let objectOptions = JSON.parse(options);
for (let key in objectOptions) {
if (objectOptions.hasOwnProperty(key)) {
if (objectOptions[key] === 'true')
objectOptions[key] = true;
if (objectOptions[key] === 'false' || objectOptions[key] == undefined || !objectOptions[key])
objectOptions[key] = false;
}
}
Vue.prototype.$adminOptions = objectOptions;
} catch(e) {
Vue.prototype.$adminOptions = {};
}
// Declares common 'modes', which group certain admin options
// Order matters here, as the latest overrides previous ones
const adminSpecialModes = {
itemsSingleSelectionMode: {
hideTainacanHeader: true,
hidePrimaryMenu: true,
hideRepositorySubheader: true,
hideCollectionSubheader: true,
hideItemsListMultipleSelection: true,
hideItemsListBulkActionsButton: true,
hideItemsListContextMenuOpenItemOption: true,
hideItemsListContextMenuOpenItemOnNewTabOption: true,
hideItemsListContextMenuEditItemOption: true,
hideItemsListContextMenuCopyItemOption: true,
hideItemsListContextMenuDeleteItemOption: true,
hideItemsListActionAreas: true,
hideItemsListPageTitle: true,
hideItemsListCreationDropdown: true,
hideItemsListExposersButton: true,
hideItemsListStatusTabs: true,
hideItemsListFilterCreationButton: true
},
itemsMultipleSelectionMode: {
hideTainacanHeader: true,
hidePrimaryMenu: true,
hideRepositorySubheader: true,
hideCollectionSubheader: true,
hideItemsListMultipleSelection: true,
hideItemsListBulkActionsButton: true,
hideItemsListContextMenuOpenItemOption: true,
hideItemsListContextMenuOpenItemOnNewTabOption: true,
hideItemsListContextMenuEditItemOption: true,
hideItemsListContextMenuCopyItemOption: true,
hideItemsListContextMenuDeleteItemOption: true,
hideItemsListActionAreas: true,
hideItemsListPageTitle: true,
hideItemsListCreationDropdown: true,
hideItemsListExposersButton: true,
hideItemsListStatusTabs: true,
hideItemsListFilterCreationButton: true
},
itemsSearchSelectionMode: {
hideTainacanHeader: true,
hidePrimaryMenu: true,
hideRepositorySubheader: true,
hideCollectionSubheader: true,
hideItemsListMultipleSelection: true,
hideItemsListBulkActionsButton: true,
hideItemsListActionAreas: true,
hideItemsListPageTitle: true,
hideItemsListCreationDropdown: true,
hideItemsListExposersButton: true,
hideItemsListContextMenu: true,
hideItemsListSelection: true,
hideItemsListStatusTabs: true,
hideItemsListFilterCreationButton: true
},
itemEditionMode: {
hideTainacanHeader: true,
hidePrimaryMenu: true,
hideRepositorySubheader: true,
hideCollectionSubheader: true
},
mobileAppMode: {
hideTainacanHeader: true,
hidePrimaryMenu: true,
hideRepositorySubheader: true,
hideCollectionSubheader: true,
hideItemsListPageTitle: true,
hideItemEditionPageTitle: true,
hideBulkEditionPageTitle: true,
hideItemSingleCollectionName: true
}
}
for (let adminSpecialMode in adminSpecialModes) {
if (Vue.prototype.$adminOptions[adminSpecialMode]) {
console.log('Tainacan Admin loaded in ' + adminSpecialMode);
for (let option in adminSpecialModes[adminSpecialMode])
Vue.prototype.$adminOptions[option] = adminSpecialModes[adminSpecialMode][option];
}
}
/*
Possible Values for Admin Options. Identation marks options that affects others:
* hideHomeRepositorySection
* hideHomeThemeCollectionsButton
* hideHomeThemeItemsButton
* hideHomeTaxonomiesButton
* hideHomeMetadataButton
* hideHomeFiltersButton
* hideHomeImportersButton
* hideHomeExportersButton
* hideHomeActivitiesButton
* hideHomeCollectionsSection
* hideHomeCollectionsButton
* hideHomeCollectionItemsButton
* hideHomeCollectionSettingsButton
* hideHomeCollectionMetadataButton
* hideHomeCollectionFiltersButton
* hideHomeCollectionActivitiesButton
* hideHomeCollectionThemeCollectionButton
* showHomeCollectionCreateItemButton
* hideTainacanHeader
* hideTainacanHeaderHomeButton
* hideTainacanHeaderSearchInput
* hideTainacanHeaderAdvancedSearch
* hideTainacanHeaderProcessesPopup
* hidePrimaryMenuCompressButton
* hidePrimaryMenu
* hidePrimaryMenuCompressButton
* hidePrimaryMenuRepositoryButton
* hidePrimaryMenuCollectionsButton
* hidePrimaryMenuItemsButton
* hidePrimaryMenuTaxonomiesButton
* hidePrimaryMenuMetadataButton
* hidePrimaryMenuFiltersButton
* hidePrimaryMenuImportersButton
* hidePrimaryMenuExportersButton
* hidePrimaryMenuActivitiesButton
* hidePrimaryMenuCapabilitiesButton
* hideRepositorySubheader
* hideRepositorySubheaderViewCollectionButton
* hideRepositorySubheaderViewCollectionsButton
* hideRepositorySubheaderExportButton
* hideCollectionSubheader
* hideItemsListPageTitle
* hideItemsListMultipleSelection
* hideItemsListSelection
* hideItemsListBulkActionsButton
* hideItemsListCreationDropdown
* hideItemsListCreationDropdownBulkAdd
* hideItemsListCreationDropdownImport
* hideItemsListAdvancedSearch
* hideItemsListExposersButton
* hideItemsListStatusTabs
* hideItemsListStatusTabsTotalItems
* hideItemsListContextMenu
* hideItemsListContextMenuOpenItemOption
* hideItemsListContextMenuOpenItemOnNewTabOption
* hideItemsListContextMenuEditItemOption
* hideItemsListContextMenuCopyItemOption
* hideItemsListContextMenuDeleteItemOption
* hideItemsListActionAreas
* hideItemsListFilterCreationButton
* hideItemEditionPageTitle
* hideItemEditionCollectionName
* hideItemEditionStatusOptions
* hideItemEditionCommentsToggle
* hideItemEditionThumbnail
* hideBulkEditionPageTitle
* hideItemSinglePageTitle
* hideItemSingleCollectionName
* hideItemSingleCurrentStatus
* hideItemSingleCurrentVisibility
* hideItemSingleCommentsOpen
* hideItemSingleThumbnail
* hideItemSingleActivities
* hideItemSingleExposers
*/
};

View File

@ -1,8 +1,11 @@
<template>
<div class="home-page page-container">
<b-loading :active.sync="isLoadingCollections"/>
<section class="home-section home-section-repository">
<section
v-if="!$adminOptions.hideHomeRepositorySection"
class="home-section home-section-repository">
<div
v-if="!$adminOptions.hideHomeCollectionsSection"
class="section-connector"
aria-hidden/>
<div class="home-section-header repository-section-header">
@ -14,6 +17,7 @@
<h1>{{ $i18n.get('repository') + ' ' }}<span class="has-text-weight-semibold">{{ repositoryName }}</span></h1>
<a
v-if="!$adminOptions.hideHomeThemeItemsButton"
target="_blank"
:href="themeItemsListURL">
<span class="icon">
@ -44,7 +48,7 @@
<span class="menu-text">{{ $i18n.get('label_all_items') }}</span>
</router-link>
</li> -->
<li v-if="$userCaps.hasCapability('tnc_rep_edit_metadata')">
<li v-if="$userCaps.hasCapability('tnc_rep_edit_metadata') && !$adminOptions.hideHomeMetadataButton">
<router-link
tag="a"
to="/metadata">
@ -54,7 +58,7 @@
<span class="menu-text">{{ $i18n.get('title_repository_metadata_page' ) }}</span>
</router-link>
</li>
<li v-if="$userCaps.hasCapability('tnc_rep_edit_filters')">
<li v-if="$userCaps.hasCapability('tnc_rep_edit_filters') && !$adminOptions.hideHomeFiltersButton">
<router-link
tag="a"
to="/filters">
@ -64,7 +68,7 @@
<span class="menu-text">{{ $i18n.get('title_repository_filters_page') }}</span>
</router-link>
</li>
<li>
<li v-if="!$adminOptions.hideHomeTaxonomiesButton">
<router-link
tag="a"
to="/taxonomies">
@ -74,7 +78,7 @@
<span class="menu-text">{{ $i18n.getFrom('taxonomies', 'name') }}</span>
</router-link>
</li>
<li>
<li v-if="!$adminOptions.hideHomeActivitiesButton">
<router-link
tag="a"
to="/activities">
@ -84,7 +88,7 @@
<span class="menu-text">{{ $i18n.get('title_repository_activities_page') }}</span>
</router-link>
</li>
<li>
<li v-if="!$adminOptions.hideHomeImportersButton">
<router-link
tag="a"
to="/importers">
@ -94,7 +98,7 @@
<span class="menu-text menu-text-import">{{ $i18n.get('importers') }}</span>
</router-link>
</li>
<li>
<li v-if="!$adminOptions.hideHomeExportersButton">
<router-link
tag="a"
to="/exporters">
@ -108,8 +112,11 @@
</nav>
</section>
<section class="home-section home-section-collection">
<section
v-if="!$adminOptions.hideHomeCollectionsSection"
class="home-section home-section-collection">
<div
v-if="!$adminOptions.hideHomeRepositorySection"
class="collection-section-connector"
aria-hidden/>
<div class="home-section-header collections-section-header">
@ -123,6 +130,7 @@
</div>
<h1>{{ $i18n.get('label_recent_collections') }}</h1>
<a
v-if="!$adminOptions.hideHomeThemeCollectionsButton"
target="_blank"
:href="themeCollectionListURL"
style="position: relative">
@ -137,6 +145,7 @@
:collections="collections"
:collections-total="collectionsTotal"/>
<router-link
v-if="!$adminOptions.hideHomeCollectionsButton"
class="collections-see-more"
tag="a"
to="/collections">

View File

@ -9,7 +9,7 @@
<!-- PAGE TITLE --------------------- -->
<tainacan-title
v-if="!isIframeMode && !isReadMode && !openAdvancedSearch"
v-if="!$adminOptions.hideItemsListPageTitle && !openAdvancedSearch"
:bread-crumb-items="[{ path: '', label: this.$i18n.get('items') }]"/>
<div
v-else-if="openAdvancedSearch"
@ -42,7 +42,8 @@
role="region"
ref="search-control"
v-if="((openAdvancedSearch && advancedSearchResults) || !openAdvancedSearch)"
class="search-control">
class="search-control"
:style="( $adminOptions.itemsSingleSelectionMode || $adminOptions.itemsMultipleSelectionMode || $adminOptions.itemsSearchSelectionMode ) ? '--tainacan-container-padding: 6px;' : ''">
<!-- <b-loading
:is-full-page="false"
@ -92,20 +93,34 @@
icon-right-clickable
@icon-right-click="updateSearch()" />
<a
v-if="!$adminOptions.hideItemsListAdvancedSearch"
@click="openAdvancedSearch = !openAdvancedSearch; $eventBusSearch.clearAllFilters();"
style="font-size: 0.75em;"
class="has-text-secondary is-pulled-right">{{ $i18n.get('advanced_search') }}</a>
</div>
</div>
<!-- Item Creation Dropdown, only on Admin -->
<!-- Item Creation Dropdown (or button, if few options are available) -->
<div
class="search-control-item"
v-if="!isIframeMode &&
v-if="!$adminOptions.hideItemsListCreationDropdown &&
!openAdvancedSearch &&
collection &&
collection.current_user_can_edit_items">
collection.current_user_can_edit_items"
class="search-control-item">
<router-link
id="item-creation-options-dropdown"
v-if="$adminOptions.hideItemsListCreationDropdownBulkAdd && $adminOptions.hideItemsListCreationDropdownImport"
class="button is-secondary"
tag="button"
:to="{ path: $routerHelper.getNewItemPath(collectionId) }">
<span class="is-hidden-touch">{{ $i18n.getFrom('items','add_new') }}</span>
<span class="is-hidden-desktop">{{ $i18n.get('add') }}</span>
<span class="icon">
<i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-add" />
</span>
</router-link>
<b-dropdown
v-else
:mobile-modal="true"
id="item-creation-options-dropdown"
aria-role="list"
@ -141,7 +156,7 @@
</div>
</b-dropdown-item>
<b-dropdown-item
v-if="!isRepositoryLevel"
v-if="!isRepositoryLevel && !$adminOptions.hideItemsListCreationDropdownBulkAdd"
aria-role="listitem">
<router-link
id="a-item-add-bulk"
@ -152,7 +167,9 @@
<small class="is-small">{{ $i18n.get('info_bulk_add_items') }}</small>
</router-link>
</b-dropdown-item>
<b-dropdown-item aria-role="listitem">
<b-dropdown-item
v-if="!$adminOptions.hideItemsListCreationDropdownImport"
aria-role="listitem">
<div
id="a-import-items"
tag="div"
@ -413,7 +430,7 @@
<!-- Exposers or alternative links modal button -->
<div
v-if="!isIframeMode"
v-if="!$adminOptions.hideItemsListExposersButton"
class="search-control-item">
<button
class="button is-white"
@ -495,7 +512,7 @@
<!-- STATUS TABS, only on Admin -------- -->
<items-status-tabs
v-if="!openAdvancedSearch && !isIframeMode"
v-if="!openAdvancedSearch && !$adminOptions.hideItemsListStatusTabs"
:is-repository-level="isRepositoryLevel"/>
<!-- FILTERS TAG LIST-->
@ -596,7 +613,7 @@
</p>
<router-link
v-if="!isRepositoryLevel && !isSortingByCustomMetadata && !hasFiltered && (status == undefined || status == '') && !isIframeMode"
v-if="!isRepositoryLevel && !isSortingByCustomMetadata && !hasFiltered && (status == undefined || status == '') && !$adminOptions.hideItemsListCreationDropdown"
id="button-create-item"
tag="button"
class="button is-secondary"
@ -604,7 +621,7 @@
{{ $i18n.getFrom('items', 'add_new') }}
</router-link>
<button
v-else-if="isRepositoryLevel && !isSortingByCustomMetadata && !hasFiltered && (status == undefined || status == '') && !isIframeMode"
v-else-if="isRepositoryLevel && !isSortingByCustomMetadata && !hasFiltered && (status == undefined || status == '') && !$adminOptions.hideItemsListCreationDropdown"
id="button-create-item"
class="button is-secondary"
@click="onOpenCollectionsModal">
@ -720,13 +737,7 @@
metakey: this.$route.query.metakey
}, this.sortingMetadata);
return this.$route.query.metakey ? metadatumName : this.$i18n.get(metadatumName);
},
isReadMode () {
return this.$route && this.$route.query && this.$route.query.readmode;
},
isIframeMode () {
return this.$route && this.$route.query && this.$route.query.iframemode;
},
}
},
watch: {
displayedMetadata() {
@ -767,8 +778,9 @@
if ((this.$refs['search-control'].classList.contains('floating-search-control')))
this.$refs['search-control'].classList.remove('floating-search-control');
this.$refs['items-page-container'].scrollTo({ top: this.$refs['search-control'].offsetTop - (this.isRepositoryLevel ? 94 : 42), behavior: 'smooth'});
if (!this.$adminOptions.hideCollectionSubheader)
this.$refs['items-page-container'].scrollTo({ top: this.$refs['search-control'].offsetTop - (this.isRepositoryLevel ? 94 : 42), behavior: 'smooth'});
}
this.isLoadingItems = isLoadingItems;

View File

@ -1,14 +1,16 @@
<template>
<div
class="columns is-fullheight"
:class="{ 'tainacan-admin-collection-mobile-mode': isMobileMode }">
<section class="column is-secondary-content">
<tainacan-collection-subheader v-if="!isIframeMode && !isMobileMode" />
:class="{ 'tainacan-admin-collection-mobile-app-mode': $adminOptions.mobileAppMode }">
<section
class="column is-secondary-content"
:style="$adminOptions.hideRepositorySubheader ? 'margin-top: 0; height: 100%;' : ''">
<tainacan-collection-subheader v-if="!$adminOptions.hideCollectionSubheader" />
<router-view
id="collection-page-container"
:collection-id="collectionId"
class="page-container page-container-small"/>
class="page-container"
:class="{ 'page-container-small': !$adminOptions.hideRepositorySubheader && !$adminOptions.hideCollectionSubheader }"/>
</section>
</div>
</template>
@ -22,19 +24,11 @@ export default {
components: {
TainacanCollectionSubheader
},
data(){
data() {
return {
collectionId: Number
}
},
computed: {
isIframeMode() {
return this.$route && this.$route.query && this.$route.query.iframemode;
},
isMobileMode() {
return this.$route && this.$route.query && this.$route.query.mobilemode;
}
},
watch: {
'$route' (to, from) {
if (!this.isRepositoryLevel && from.path != undefined && to.path != from.path && this.collectionId != this.$route.params.collectionId) {
@ -44,7 +38,7 @@ export default {
}
}
},
created(){
created() {
this.collectionId = this.$route.params.collectionId;
this.$eventBusSearch.setCollectionId(this.collectionId);

View File

@ -4,7 +4,9 @@
:active.sync="isLoading"
:can-cancel="false"/>
<div class="tainacan-page-title">
<div
v-if="!$adminOptions.hideItemSinglePageTitle"
class="tainacan-page-title">
<h1>
<span
v-if="(item != null && item != undefined && item.status != undefined && !isLoading)"
@ -42,7 +44,9 @@
class="columns">
<!-- Collection -------------------------------- -->
<div class="column is-narrow">
<div
v-if="!$adminOptions.hideItemSingleCollectionName"
class="column is-narrow">
<div class="section-label">
<label>{{ $i18n.get('collection') }}</label>
</div>
@ -59,7 +63,9 @@
</div>
<!-- Status (status public or private) -------------------------------- -->
<div class="column is-narrow">
<div
v-if="!$adminOptions.hideItemSingleCurrentStatus"
class="column is-narrow">
<div class="section-label">
<label>{{ $i18n.getHelperTitle('items', 'status') }}</label>
@ -81,7 +87,9 @@
</div>
<!-- Visibility -->
<div class="column is-narrow">
<div
v-if="!$adminOptions.hideItemSingleCurrentVisibility"
class="column is-narrow">
<div class="section-label">
<label>{{ $i18n.get('label_visibility') }}</label>
</div>
@ -129,7 +137,7 @@
<!-- Comment Status ------------------------ -->
<div
v-if="collection && collection.allow_comments && collection.allow_comments == 'open'"
v-if="collection && collection.allow_comments && collection.allow_comments == 'open' && !$adminOptions.hideItemSingleCommentsOpen"
class="column is-narrow">
<div class="section-label">
<label>{{ $i18n.get('label_comments') }}</label>
@ -253,7 +261,7 @@
@isLoadingAttachments="(isLoading) => isLoadingAttachments = isLoading" />
</b-tab-item>
<b-tab-item>
<b-tab-item :visible="!$adminOptions.hideItemSingleActivities">
<template slot="header">
<span class="icon has-text-gray5">
<i class="tainacan-icon tainacan-icon-18px tainacan-icon-activities"/>
@ -311,10 +319,14 @@
</div>
<!-- Thumbnail -------------------------------- -->
<div class="section-label">
<div
v-if="!$adminOptions.hideItemSingleThumbnail"
class="section-label">
<label>{{ $i18n.get('label_thumbnail') }}</label>
</div>
<div class="section-box section-thumbnail">
<div
v-if="!$adminOptions.hideItemSingleThumbnail"
class="section-box section-thumbnail">
<div class="thumbnail-field">
<file-item
v-if="item.thumbnail != undefined && ((item.thumbnail['tainacan-medium'] != undefined && item.thumbnail['tainacan-medium'] != false) || (item.thumbnail.medium != undefined && item.thumbnail.medium != false))"
@ -390,6 +402,7 @@
<span>{{ $i18n.getFrom('items','edit_item') }}</span>
</router-link>
<button
v-if="!$adminOptions.hideItemSingleExposers"
class="button sequence-button"
:aria-label="$i18n.get('label_view_as')"
:disabled="isLoading"

View File

@ -1,96 +0,0 @@
// IFRAME MODE
// Used on gutenberg block modals, hiding content not relevant to be rendered inside iframe
#tainacan-admin-app.tainacan-admin-iframe-mode {
#primary-menu,
#menu-compress-button,
#tainacan-header,
#tainacan-repository-subheader,
#tainacan-subheader {
display: none;
visibility: hidden;
}
#repository-container .is-secondary-content {
margin-top: 0;
height: 100%;
.page-container-small {
height: 100%;
#item-creation-options-dropdown,
#items-list-results .selection-control .field {
display: none;
visibility: hidden;
}
@media screen and (min-width: 769px) {
#filters-modal {
padding-left: 0em;
}
}
}
}
}
// READ MODE
// Used on gutenberg block modals, hiding content related to selecting the items
#tainacan-admin-app.tainacan-admin-read-mode {
#items-list-area {
.tainacan-table {
tr:hover { background-color: transparent !important; cursor: default; }
}
.tainacan-card {
&:hover { background-color: transparent !important; cursor: default; }
.metadata-title { padding-left: 1.5em !important; margin-bottom: 0; }
&:hover .metadata-title { background-color: transparent !important }
}
.tainacan-grid-item {
&:hover, &:hover .metadata-title { background-color: transparent; cursor: default; }
a { cursor: default; }
.metadata-title { margin-left: 6px !important; padding-left: 6px !important; }
}
.tainacan-record {
&:hover .media { background-color: var(--tainacan-gray0) !important; cursor: default; }
.metadata-title { padding-left: 1.5em !important; margin-bottom: -0.75em; }
&:hover .metadata-title { background-color: var(--tainacan-gray0) !important; cursor: default; }
}
.tainacan-masonry-item {
&:hover { background-color: transparent; cursor: default; }
&:hover .tainacan-masonry-item-thumbnail { cursor: default; }
.metadata-title { margin-left: 6px; }
}
}
}
// MOBILE MODE
// Used on the mobile app, to show only necessary elements inside the webview
#tainacan-admin-app.tainacan-admin-mobile-mode {
#primary-menu,
#menu-compress-button,
#tainacan-header,
#tainacan-repository-subheader,
#tainacan-subheader {
display: none;
visibility: hidden;
}
#repository-container .is-secondary-content {
margin-top: 0;
height: 100%;
.page-container-small {
height: 100%;
#item-creation-options-dropdown,
#items-list-results .selection-control .field {
display: none;
visibility: hidden;
}
@media screen and (min-width: 769px) {
#filters-modal {
padding-left: 0em;
}
}
}
}
}

View File

@ -313,6 +313,9 @@
}
}
}
&.hide-items-selection {
tr:hover { background-color: transparent !important; cursor: default; }
}
}
}
}

View File

@ -203,8 +203,14 @@
}
}
}
&.hide-items-selection {
.tainacan-card {
&:hover { background-color: transparent !important; cursor: default; }
.metadata-title { padding-left: 1.5em !important; margin-bottom: 0; }
&:hover .metadata-title { background-color: transparent !important }
}
}
}

View File

@ -114,7 +114,14 @@
margin-top: -1px;
}
}
}
&.hide-items-selection {
.tainacan-grid-item {
&:hover, &:hover .metadata-title { background-color: transparent; cursor: default; }
a { cursor: default; }
.metadata-title { margin-left: 6px !important; padding-left: 6px !important; }
}
}
}

View File

@ -224,8 +224,13 @@
}
}
}
}
&.hide-items-selection {
.tainacan-list {
&:hover { background-color: rgba(126, 126, 126, 0.05) !important; cursor: default; }
.metadata-title { padding-left: 1.5em !important; }
&:hover .metadata-title { background-color: var(--tainacan-gray0) !important; cursor: default; }
}
}
}

View File

@ -131,6 +131,14 @@
}
}
}
&.hide-items-selection {
.tainacan-masonry-item {
&:hover { background-color: transparent; cursor: default; }
&:hover .tainacan-masonry-item-thumbnail { cursor: default; }
.metadata-title { margin-left: 6px; }
}
}
}

View File

@ -176,8 +176,14 @@
}
}
}
}
&.hide-items-selection {
.tainacan-record {
&:hover .media { background-color: var(--tainacan-gray0) !important; cursor: default; }
.metadata-title { padding-left: 1.5em !important; margin-bottom: -0.75em; }
&:hover .metadata-title { background-color: var(--tainacan-gray0) !important; cursor: default; }
}
}
}

View File

@ -29,7 +29,6 @@
@import "../scss/_notices.scss";
@import "../scss/_filters-menu-modal.scss";
@import "../scss/_repository-level-overrides.scss";
@import "../scss/_iframe_special_modes_overrides.scss";
@import "../scss/_custom_variables.scss";
// Clears wordpress content

View File

@ -369,9 +369,10 @@ class Admin {
function admin_page() {
global $TAINACAN_BASE_URL;
$admin_options = apply_filters('set_tainacan_admin_options', $_GET);
$admin_options = json_encode($admin_options);
// TODO move it to a separate file and start the Vue project
echo "<div id='tainacan-admin-app' data-module='admin'></div>";
echo "<div id='tainacan-admin-app' data-module='admin' data-options='$admin_options'></div>";
}
function register_user_meta() {

View File

@ -47,8 +47,9 @@ export default class CarouselItemsModal extends React.Component {
if (this.props.existingCollectionId) {
this.fetchCollection(this.props.existingCollectionId);
this.setState({
searchURL: this.props.existingSearchURL ? this.props.existingSearchURL : tainacan_blocks.admin_url + 'admin.php?page=tainacan_admin#/collections/'+ this.props.existingCollectionId + (this.props.loadStrategy == 'search' ? '/items/?iframemode=true&readmode=true&status=publish' : '/items/?iframemode=true&status=publish')
searchURL: (this.props.existingSearchURL && this.props.existingSearchURL.indexOf('iframemode') < 0) ? this.props.existingSearchURL : tainacan_blocks.admin_url + 'admin.php?' + (this.props.loadStrategy == 'search' ? 'itemsSearchSelectionMode' : 'itemsMultipleSelectionMode') + '=true&page=tainacan_admin#/collections/'+ this.props.existingCollectionId + '/items/?status=publish'
});
} else {
this.setState({ collectionPage: 1 });
@ -116,7 +117,7 @@ export default class CarouselItemsModal extends React.Component {
selectCollection(selectedCollectionId) {
this.setState({
collectionId: selectedCollectionId,
searchURL: tainacan_blocks.admin_url + 'admin.php?page=tainacan_admin#/collections/' + selectedCollectionId + (this.props.loadStrategy == 'search' ? '/items/?iframemode=true&readmode=true&status=publish' : '/items/?iframemode=true&status=publish')
searchURL: tainacan_blocks.admin_url + 'admin.php?' + (this.props.loadStrategy == 'search' ? 'itemsSearchSelectionMode' : 'itemsMultipleSelectionMode') + '=true&page=tainacan_admin#/collections/' + selectedCollectionId + '/items/?status=publish'
});
this.props.onSelectCollection(selectedCollectionId);
this.fetchCollection(selectedCollectionId);

View File

@ -159,8 +159,6 @@ export default function({ attributes, setAttributes, className, isSelected, clie
}
// Remove unecessary queries
delete queryObject.readmode;
delete queryObject.iframemode;
delete queryObject.admin_view_mode;
delete queryObject.fetch_only_meta;

View File

@ -362,8 +362,6 @@ export default {
this.paged = 1;
// Remove unecessary queries
delete queryObject.readmode;
delete queryObject.iframemode;
delete queryObject.admin_view_mode;
delete queryObject.fetch_only_meta;

View File

@ -273,8 +273,6 @@ export default function({ attributes, setAttributes, className, isSelected, clie
}
// Remove unecessary queries
delete queryObject.readmode;
delete queryObject.iframemode;
delete queryObject.admin_view_mode;
delete queryObject.fetch_only_meta;

View File

@ -432,9 +432,7 @@ export default {
else
this.paged = 1;
// emove unecessary queries
delete queryObject.readmode;
delete queryObject.iframemode;
// Remove unecessary queries
delete queryObject.admin_view_mode;
delete queryObject.fetch_only_meta;

View File

@ -39,7 +39,8 @@ import eventBusSearch from '../../../admin/js/event-bus-search';
import {
I18NPlugin,
UserPrefsPlugin,
ConsolePlugin
ConsolePlugin,
AdminOptionsHelperPlugin
} from '../../../admin/js/admin-utilities';
import {
ThumbnailHelperPlugin,
@ -80,6 +81,7 @@ export default (element) => {
Vue.use(ThumbnailHelperPlugin);
Vue.use(OrderByHelperPlugin);
Vue.use(ConsolePlugin, {visual: false});
Vue.use(AdminOptionsHelperPlugin, blockElement.dataset['options']);
/* Registers Extra Vue Components passed to the window.tainacan_extra_components */
if (typeof window.tainacan_extra_components != "undefined") {

View File

@ -25,7 +25,7 @@ import TainacanFormItem from '../../../admin/components/metadata-types/tainacan-
import TermCreationPanel from './item-submission/components/term-creation-panel.vue';
import HelpButton from '../../../admin/components/other/help-button.vue';
import store from '../../../admin/js/store/store';
import { I18NPlugin, UserPrefsPlugin, RouterHelperPlugin, ConsolePlugin, StatusHelperPlugin, CommentsStatusHelperPlugin } from '../../../admin/js/admin-utilities';
import { I18NPlugin, UserPrefsPlugin, RouterHelperPlugin, ConsolePlugin, StatusHelperPlugin, CommentsStatusHelperPlugin, AdminOptionsHelperPlugin } from '../../../admin/js/admin-utilities';
import { ThumbnailHelperPlugin } from '../../../admin/js/utilities';
export default (element) => {
@ -61,6 +61,7 @@ export default (element) => {
Vue.use(VueTheMask);
Vue.use(CommentsStatusHelperPlugin);
Vue.use(ThumbnailHelperPlugin);
Vue.use(AdminOptionsHelperPlugin, blockElement.dataset['options']);
/* Registers Extra Vue Components passed to the window.tainacan_extra_components */
if (typeof window.tainacan_extra_components != "undefined") {

View File

@ -50,7 +50,7 @@ export default class ItemsModal extends React.Component {
if (this.props.existingCollectionId) {
this.fetchCollection(this.props.existingCollectionId);
this.setState({
searchURL: this.props.existingSearchURL ? this.props.existingSearchURL : tainacan_blocks.admin_url + 'admin.php?page=tainacan_admin#/collections/'+ this.props.existingCollectionId + '/items/?iframemode=true&status=publish' });
searchURL: (this.props.existingSearchURL && this.props.existingSearchURL.indexOf('iframemode') < 0) ? this.props.existingSearchURL : tainacan_blocks.admin_url + 'admin.php?itemsMultipleSelectionMode=true&page=tainacan_admin#/collections/'+ this.props.existingCollectionId + '/items/?status=publish' });
} else {
this.setState({ collectionPage: 1 });
this.fetchModalCollections();
@ -175,7 +175,7 @@ export default class ItemsModal extends React.Component {
selectCollection(selectedCollectionId) {
this.setState({
collectionId: selectedCollectionId,
searchURL: tainacan_blocks.admin_url + 'admin.php?page=tainacan_admin#/collections/' + selectedCollectionId + '/items/?iframemode=true&status=publish'
searchURL: tainacan_blocks.admin_url + 'admin.php?itemsMultipleSelectionMode=true&page=tainacan_admin#/collections/' + selectedCollectionId + '/items/?status=publish'
});
this.props.onSelectCollection(selectedCollectionId);

View File

@ -49,7 +49,7 @@ export default class RelatedItemsModal extends React.Component {
if (this.props.existingCollectionId) {
this.fetchCollection(this.props.existingCollectionId);
this.setState({
searchURL: tainacan_blocks.admin_url + 'admin.php?page=tainacan_admin#/collections/'+ this.props.existingCollectionId + '/items/?singleselectionmode=true&iframemode=true&status=publish'
searchURL: tainacan_blocks.admin_url + 'admin.php?itemsSingleSelectionMode=true&page=tainacan_admin#/collections/'+ this.props.existingCollectionId + '/items/?status=publish'
});
} else {
this.setState({ collectionPage: 1 });
@ -117,7 +117,7 @@ export default class RelatedItemsModal extends React.Component {
selectCollection(selectedCollectionId) {
this.setState({
collectionId: selectedCollectionId,
searchURL: tainacan_blocks.admin_url + 'admin.php?page=tainacan_admin#/collections/' + selectedCollectionId + '/items/?singleselectionmode=true&iframemode=true&status=publish'
searchURL: tainacan_blocks.admin_url + 'admin.php?itemsSingleSelectionMode=true&page=tainacan_admin#/collections/' + selectedCollectionId + '/items/?status=publish'
});
this.props.onSelectCollection(selectedCollectionId);

View File

@ -532,7 +532,7 @@ return apply_filters( 'tainacan-i18n', [
'label_inherited_roles' => __( 'Inherited roles', 'tainacan' ),
'label_editing_capability' => __( 'Editing capability', 'tainacan' ),
'label_default_author_user' => __( 'Set the item author as default value', 'tainacan' ),
'label_crate_new_item' => __( 'Create new item', 'tainacan' ),
'label_create_new_item' => __( 'Create new item', 'tainacan' ),
'label_submit' => __( 'Submit', 'tainacan' ),
'label_know_more' => __( 'Know more', 'tainacan' ),
'label_request_details' => __( 'Request details', 'tainacan' ),