Adds admin options to hide attachments on edition and single item page.

This commit is contained in:
mateuswetah 2022-03-02 10:58:40 -03:00
parent 4b857dcd3a
commit a34f173bef
3 changed files with 12 additions and 8 deletions

View File

@ -355,7 +355,7 @@
<!-- Attachments ------------------------------------------ -->
<div
v-if="activeTab === 'attachments'"
v-if="activeTab === 'attachments' && !$adminOptions.hideItemEditionAttachments"
class="tab-item"
role="tabpanel"
aria-labelledby="attachments-tab-label"
@ -1066,12 +1066,14 @@ export default {
total: this.totalRelatedItems
});
}
pageTabs.push({
slug: 'attachments',
icon: 'attachments',
name: this.$i18n.get('label_attachments'),
total: this.totalAttachments
});
if (!this.$adminOptions.hideItemEditionAttachments) {
pageTabs.push({
slug: 'attachments',
icon: 'attachments',
name: this.$i18n.get('label_attachments'),
total: this.totalAttachments
});
}
return pageTabs;
},
isCurrentlyFocusedOnCompoundMetadatum() {

View File

@ -620,6 +620,7 @@ AdminOptionsHelperPlugin.install = function (Vue, options = {}) {
* hideItemEditionDocumentTextInput
* hideItemEditionDocumentUrlInput
* hideItemEditionThumbnail
* hideItemEditionAttachments
* hideBulkEditionPageTitle
@ -629,6 +630,7 @@ AdminOptionsHelperPlugin.install = function (Vue, options = {}) {
* hideItemSingleCurrentVisibility
* hideItemSingleCommentsOpen
* hideItemSingleThumbnail
* hideItemSingleAttachments
* hideItemSingleActivities
* hideItemSingleExposers
*/

View File

@ -233,7 +233,7 @@
</b-tab-item>
<b-tab-item>
<b-tab-item v-if="!$adminOptions.hideItemSingleAttachments">
<template slot="header">
<span class="icon has-text-gray5">
<i class="tainacan-icon tainacan-icon-18px tainacan-icon-attachments"/>