Adds option to display help info bellow label instead of inside a tooltip. #531

This commit is contained in:
mateuswetah 2021-07-01 15:31:46 -03:00
parent 7723a2ff0e
commit 660c683000
9 changed files with 299 additions and 18 deletions

View File

@ -48,6 +48,11 @@
width: 5%; width: 5%;
opacity: 0.75; opacity: 0.75;
margin-left: 6px; } margin-left: 6px; }
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-text.fake-text-help-description {
background-color: var(--tainacan-info-color, rgba(200, 200, 200, 0.3));
width: 35%;
opacity: 0.75;
margin-top: 4px; }
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-text.fake-help-button { .wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-text.fake-help-button {
background-color: var(--tainacan-secondary, rgba(200, 200, 200, 0.3)); background-color: var(--tainacan-secondary, rgba(200, 200, 200, 0.3));
height: 0.32em; height: 0.32em;

View File

@ -1,6 +1,6 @@
{ {
"version": 3, "version": 3,
"mappings": "AAEA,uBAAwB;EACpB,MAAM,EAAE,kBAAkB;EAE1B,sDAA+B;IAC3B,WAAW,EAAE,IAAI;IACjB,SAAS,EAAE,OAAO;IAClB,KAAK,EAAE,oCAAmC;;AAGlD,uCAAwC;EACpC,MAAM,EAAE,QAAQ;EAGhB,0DAAmB;IACf,UAAU,EAAE,IAAI;IAChB,OAAO,EAAE,GAAG;IACZ,OAAO,EAAE,IAAI;IACb,eAAe,EAAE,MAAM;IACvB,WAAW,EAAE,MAAM;IACnB,KAAK,EAAE,oCAAmC;EAG9C,wDAAiB;IACb,KAAK,EAAE,IAAI;IACX,SAAS,EAAE,OAAO;IAClB,UAAU,EAAE,MAAM;IAClB,KAAK,EAAE,oCAAmC;IAC1C,UAAU,EAAE,MAAM;IAClB,MAAM,EAAE,QAAQ;EAEpB,yEAAkC;IAC9B,gBAAgB,EAAE,uCAAuC;IACzD,OAAO,EAAE,YAAY;IACrB,SAAS,EAAE,OAAO;IAClB,KAAK,EAAE,IAAI;IACX,OAAO,EAAE,IAAI;IACb,SA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;QACb,cAAc,EAAE,MAAM;QACtB,SAAS,EAAE,MAAM;QAEjB,sHAAY;UACR,KAAK,EAAE,IAAI;UACX,SAAS,EAAE,IAAI;UACf,MAAM,EAAE,gBAAgB;QAE5B,uHAAe;UACX,aAAa,EAAE,sEAAoE;UACnF,aAAa,EAAE,KAAK;IAIhC,sFAAa;MACT,OAAO,EAAE,WAAW;MACpB,OAAO,EAAE,IAAI;MACb,WAAW,EAAE,MAAM;MACnB,eAAe,EAAE,aAAa;MAE9B,mGAAa;QACT,gBAAgB,EAAE,oDAAkD;MAExE,mGAAa;QACT,MAAM,EAAE,KAAK",
"sources": ["../../views/gutenberg-blocks/tainacan-items/item-submission-form/item-submission-form.scss"], "sources": ["../../views/gutenberg-blocks/tainacan-items/item-submission-form/item-submission-form.scss"],
"names": [], "names": [],
"file": "tainacan-gutenberg-block-item-submission-form.css" "file": "tainacan-gutenberg-block-item-submission-form.css"

View File

@ -42,7 +42,7 @@
({{ itemMetadatum.metadatum.metadata_type_object.name }}) ({{ itemMetadatum.metadatum.metadata_type_object.name }})
</span> </span>
<help-button <help-button
v-if="!$parent.hideHelpButtons" v-if="!$parent.hideHelpButtons && !$parent.helpInfoBellowLabel && itemMetadatum.metadatum && itemMetadatum.metadatum.description"
:title="itemMetadatum.metadatum.name" :title="itemMetadatum.metadatum.name"
:message="itemMetadatum.metadatum.description"/> :message="itemMetadatum.metadatum.description"/>
</span> </span>
@ -50,6 +50,11 @@
<div <div
v-show="hideCollapses || (isCollapsed || errorMessage)" v-show="hideCollapses || (isCollapsed || errorMessage)"
v-if="isTextInputComponent"> v-if="isTextInputComponent">
<p
class="metadatum-description-help-info"
v-if="!$parent.hideHelpButtons && $parent.helpInfoBellowLabel && itemMetadatum.metadatum && itemMetadatum.metadatum.description">
{{ itemMetadatum.metadatum.description }}
</p>
<component <component
:is="metadatumComponent" :is="metadatumComponent"
v-model="values[0]" v-model="values[0]"
@ -99,6 +104,11 @@
<div <div
v-show="hideCollapses || isCollapsed" v-show="hideCollapses || isCollapsed"
v-if="!isTextInputComponent"> v-if="!isTextInputComponent">
<p
class="metadatum-description-help-info"
v-if="!$parent.hideHelpButtons && $parent.helpInfoBellowLabel && itemMetadatum.metadatum && itemMetadatum.metadatum.description">
{{ itemMetadatum.metadatum.description }}
</p>
<component <component
:is="metadatumComponent" :is="metadatumComponent"
v-model="values" v-model="values"
@ -277,6 +287,11 @@
margin-top: 0.15em; margin-top: 0.15em;
max-width: 50%; max-width: 50%;
} }
.metadatum-description-help-info {
font-size: 0.75em;
color: var(--tainacan-info-color);
margin-bottom: 0.5em;
}
.metadata-type { .metadata-type {
font-size: 0.8125em; font-size: 0.8125em;
font-weight: 400; font-weight: 400;

View File

@ -171,7 +171,11 @@ registerBlockType('tainacan/item-submission-form', {
itemLinkButtonLabel: { itemLinkButtonLabel: {
type: String, type: String,
default: __( 'Go to the item page', 'tainacan' ) default: __( 'Go to the item page', 'tainacan' )
} },
helpInfoBellowLabel: {
type: Boolean,
default: false
},
}, },
supports: { supports: {
align: ['full', 'wide'], align: ['full', 'wide'],
@ -210,7 +214,8 @@ registerBlockType('tainacan/item-submission-form', {
thumbnailSectionLabel, thumbnailSectionLabel,
metadataSectionLabel, metadataSectionLabel,
showItemLinkButton, showItemLinkButton,
itemLinkButtonLabel itemLinkButtonLabel,
helpInfoBellowLabel
} = attributes; } = attributes;
const fontSizes = [ const fontSizes = [
@ -496,7 +501,7 @@ registerBlockType('tainacan/item-submission-form', {
} }
/> />
<ToggleControl <ToggleControl
label={__('Hide help buttons', 'tainacan')} label={__('Hide help information', 'tainacan')}
help={ hideHelpButtons ? __('Do not show the "?" icon with a help tooltip aside the labels.', 'tainacan') : __('Toggle to show the "?" icon with a help tooltip aside the labels.', 'tainacan')} help={ hideHelpButtons ? __('Do not show the "?" icon with a help tooltip aside the labels.', 'tainacan') : __('Toggle to show the "?" icon with a help tooltip aside the labels.', 'tainacan')}
checked={ hideHelpButtons } checked={ hideHelpButtons }
onChange={ ( isChecked ) => { onChange={ ( isChecked ) => {
@ -505,6 +510,17 @@ registerBlockType('tainacan/item-submission-form', {
} }
} }
/> />
<ToggleControl
label={__('Help info bellow label', 'tainacan')}
help={ helpInfoBellowLabel ? __('Show the help info bellow the label instead of hidden in the "?" icon on the help tooltip.', 'tainacan') : __('Do not show the help info bellow the label, keep it on the "?" icon toolip.', 'tainacan')}
checked={ helpInfoBellowLabel }
onChange={ ( isChecked ) => {
helpInfoBellowLabel = isChecked;
setAttributes({ helpInfoBellowLabel: isChecked });
}
}
/>
<ToggleControl <ToggleControl
label={__('Hide metadata type', 'tainacan')} label={__('Hide metadata type', 'tainacan')}
help={ hideMetadataTypes ? __('Do not show the metadata type aside the metadata label.', 'tainacan') : __('Toggle to show the metadata type aside the metadata label.', 'tainacan')} help={ hideMetadataTypes ? __('Do not show the metadata type aside the metadata label.', 'tainacan') : __('Toggle to show the metadata type aside the metadata label.', 'tainacan')}
@ -696,7 +712,10 @@ registerBlockType('tainacan/item-submission-form', {
( (
<div> <div>
{ documentSectionLabel ? { documentSectionLabel ?
<span style={{ display: 'flex', alignItems: 'baseline', marginBottom: '5px' }}><span class="fake-text section-label"></span>{ !hideHelpButtons ? <span class="fake-text fake-help-button"></span> : null }</span> <span>
<span style={{ display: 'flex', alignItems: 'baseline', marginBottom: '5px' }}><span class="fake-text section-label"></span>{ !hideHelpButtons && !helpInfoBellowLabel ? <span class="fake-text fake-help-button"></span> : null }</span>
{ (!hideHelpButtons && helpInfoBellowLabel) ? <div><span class="fake-text fake-text-help-description"></span></div> : null }
</span>
: null } : null }
{ [ hideFileModalButton, hideTextModalButton, hideLinkModalButton ].filter((option) => { return option == false }).length > 1 ? { [ hideFileModalButton, hideTextModalButton, hideLinkModalButton ].filter((option) => { return option == false }).length > 1 ?
<div class="documents-section"> <div class="documents-section">
@ -724,7 +743,10 @@ registerBlockType('tainacan/item-submission-form', {
( (
<div style={{ display: 'flex', flexDirection: 'column' }}> <div style={{ display: 'flex', flexDirection: 'column' }}>
{ !thumbnailSectionLabel ? { !thumbnailSectionLabel ?
<span style={{ display: 'flex', alignItems: 'baseline' }}><span class="fake-text section-label"></span>{ !hideHelpButtons ? <span class="fake-text fake-help-button"></span> : null }</span> <span>
<span style={{ display: 'flex', alignItems: 'baseline' }}><span class="fake-text section-label"></span>{ !hideHelpButtons && !helpInfoBellowLabel ? <span class="fake-text fake-help-button"></span> : null }</span>
{ (!hideHelpButtons && helpInfoBellowLabel) ? <div><span class="fake-text fake-text-help-description"></span></div> : null }
</span>
: null } : null }
<div class="fake-switch"><span class="fake-icon"></span><span class="fake-text"></span></div> <div class="fake-switch"><span class="fake-icon"></span><span class="fake-text"></span></div>
</div> </div>
@ -750,7 +772,8 @@ registerBlockType('tainacan/item-submission-form', {
showAllowCommentsSection ? showAllowCommentsSection ?
( (
<div> <div>
<span style={{ display: 'flex', alignItems: 'baseline' }}><span class="fake-text section-label"></span>{ !hideHelpButtons ? <span class="fake-text fake-help-button"></span> : null }</span> <span style={{ display: 'flex', alignItems: 'baseline' }}><span class="fake-text section-label"></span>{ !hideHelpButtons && !helpInfoBellowLabel ? <span class="fake-text fake-help-button"></span> : null }</span>
{ (!hideHelpButtons && helpInfoBellowLabel) ? <div><span class="fake-text fake-text-help-description"></span></div> : null }
<div class="fake-switch"><span class="fake-icon"></span><span class="fake-text"></span></div> <div class="fake-switch"><span class="fake-icon"></span><span class="fake-text"></span></div>
</div> </div>
) : null } ) : null }
@ -767,7 +790,8 @@ registerBlockType('tainacan/item-submission-form', {
<div class={ 'fake-metadata' + (!hideCollapses ? ' has-collapse' : '') }> <div class={ 'fake-metadata' + (!hideCollapses ? ' has-collapse' : '') }>
{ !hideCollapses ? <span class="fake-collapse-arrow"></span> : null } { !hideCollapses ? <span class="fake-collapse-arrow"></span> : null }
<span style={{ lineHeight: '0em' }}> <span style={{ lineHeight: '0em' }}>
<span class="fake-text"></span>{ !hideMetadataTypes ? <span class="fake-text fake-text-info"></span> : null }{ !hideHelpButtons ? <span class="fake-text fake-help-button"></span> : null } <span class="fake-text"></span>{ !hideMetadataTypes ? <span class="fake-text fake-text-info"></span> : null }{ !hideHelpButtons && !helpInfoBellowLabel ? <span class="fake-text fake-help-button"></span> : null }
{ (!hideHelpButtons && helpInfoBellowLabel) ? <div><span class="fake-text fake-text-help-description"></span></div> : null }
</span> </span>
<span class="fake-input"></span> <span class="fake-input"></span>
</div> </div>
@ -843,7 +867,8 @@ registerBlockType('tainacan/item-submission-form', {
sentFormHeading, sentFormHeading,
sentFormMessage, sentFormMessage,
showItemLinkButton, showItemLinkButton,
itemLinkButtonLabel itemLinkButtonLabel,
helpInfoBellowLabel
} = attributes; } = attributes;
return <div return <div
@ -880,7 +905,8 @@ registerBlockType('tainacan/item-submission-form', {
attachments-section-label={ attachmentsSectionLabel } attachments-section-label={ attachmentsSectionLabel }
metadata-section-label={ metadataSectionLabel } metadata-section-label={ metadataSectionLabel }
show-item-link-button={ showItemLinkButton ? showItemLinkButton.toString() : 'false' } show-item-link-button={ showItemLinkButton ? showItemLinkButton.toString() : 'false' }
item-link-button-label={ itemLinkButtonLabel ? itemLinkButtonLabel : __( 'Go to the item page', 'tainacan' ) } > item-link-button-label={ itemLinkButtonLabel ? itemLinkButtonLabel : __( 'Go to the item page', 'tainacan' ) }
help-info-bellow-label={ helpInfoBellowLabel ? helpInfoBellowLabel.toString() : 'false' } >
</div> </div>
</div> </div>
}, },

View File

@ -1,6 +1,210 @@
const { __ } = wp.i18n; const { __ } = wp.i18n;
export default [ export default [
/* Depecrated on Tainacan 0.18.3, due to the introduction of helpInfoBellowLabel */
{
attributes: {
collectionId: {
type: String,
default: undefined
},
isCollectionModalOpen: {
type: Boolean,
default: false
},
hideFileModalButton: {
type: Boolean,
default: false
},
hideTextModalButton: {
type: Boolean,
default: false
},
hideLinkModalButton: {
type: Boolean,
default: false
},
hideThumbnailSection: {
type: Boolean,
default: false
},
hideAttachmentsSection: {
type: Boolean,
default: false
},
hideHelpButtons: {
type: Boolean,
default: false
},
hideMetadataTypes: {
type: Boolean,
default: false
},
showAllowCommentsSection: {
type: Boolean,
default: false
},
hideCollapses: {
type: Boolean,
default: false
},
backgroundColor: {
type: Object,
default: { r: 255, g: 255, b: 255, a: 0}
},
baseFontSize: {
type: Number,
default: 16
},
inputColor: {
type: String,
default: '#1d1d1d'
},
inputBackgroundColor: {
type: String,
default: '#ffffff'
},
inputBorderColor: {
type: String,
default: '#dbdbdb'
},
labelColor: {
type: String,
default: '#454647'
},
infoColor: {
type: String,
default: '#555758'
},
primaryColor: {
type: String,
default: '#d9eced'
},
secondaryColor: {
type: String,
default: '#298596'
},
enabledMetadata: {
type: Array,
default: []
},
collectionMetadata: {
type: Array,
default: []
},
isLoadingCollectionMetadata: {
type: Boolean,
default: false
},
sentFormHeading: {
type: String,
default: __( 'Form submitted!', 'tainacan' )
},
sentFormMessage: {
type: String,
default: __( 'Thank you. Your item was submitted to the collection.', 'tainacan' )
},
documentSectionLabel: {
type: String,
default: __( 'Document', 'tainacan' )
},
attachmentsSectionLabel: {
type: String,
default: __( 'Attachments', 'tainacan' )
},
thumbnailSectionLabel: {
type: String,
default: __( 'Thumbnail', 'tainacan' )
},
metadataSectionLabel: {
type: String,
default: __( 'Metadata', 'tainacan' )
},
showItemLinkButton: {
type: Boolean,
default: false
},
itemLinkButtonLabel: {
type: String,
default: __( 'Go to the item page', 'tainacan' )
}
},
supports: {
align: ['full', 'wide'],
html: true,
multiple: false
},
save({ attributes, className }){
const {
collectionId,
backgroundColor,
hideFileModalButton,
hideTextModalButton,
hideLinkModalButton,
hideThumbnailSection,
hideAttachmentsSection,
showAllowCommentsSection,
hideHelpButtons,
hideMetadataTypes,
hideCollapses,
documentSectionLabel,
thumbnailSectionLabel,
attachmentsSectionLabel,
metadataSectionLabel,
baseFontSize,
inputColor,
inputBackgroundColor,
inputBorderColor,
labelColor,
infoColor,
primaryColor,
secondaryColor,
enabledMetadata,
sentFormHeading,
sentFormMessage,
showItemLinkButton,
itemLinkButtonLabel
} = attributes;
return <div
style={{
'font-size': baseFontSize + 'px',
'--tainacan-base-font-size': baseFontSize + 'px',
'--tainacan-background-color': 'rgba(' + backgroundColor.r + ',' + backgroundColor.g + ',' + backgroundColor.b + ',' + backgroundColor.a + ')',
'--tainacan-input-color': inputColor,
'--tainacan-input-background-color': inputBackgroundColor,
'--tainacan-input-border-color': inputBorderColor,
'--tainacan-label-color': labelColor,
'--tainacan-info-color': infoColor,
'--tainacan-primary': primaryColor,
'--tainacan-secondary': secondaryColor
}}
className={ className }>
<div
id="tainacan-item-submission-form"
collection-id={ collectionId }
hide-file-modal-button={ hideFileModalButton.toString() }
hide-text-modal-button={ hideTextModalButton.toString() }
hide-link-modal-button={ hideLinkModalButton.toString() }
hide-thumbnail-section={ hideThumbnailSection.toString() }
hide-attachments-section={ hideAttachmentsSection.toString() }
show-allow-comments-section={ showAllowCommentsSection.toString() }
hide-help-buttons={ hideHelpButtons.toString() }
hide-metadata-types={ hideMetadataTypes.toString() }
hide-collapses={ hideCollapses.toString() }
enabled-metadata={ enabledMetadata.toString() }
sent-form-heading={ sentFormHeading }
sent-form-message={ sentFormMessage }
document-section-label={ documentSectionLabel }
thumbnail-section-label={ thumbnailSectionLabel }
attachments-section-label={ attachmentsSectionLabel }
metadata-section-label={ metadataSectionLabel }
show-item-link-button={ showItemLinkButton ? showItemLinkButton.toString() : 'false' }
item-link-button-label={ itemLinkButtonLabel ? itemLinkButtonLabel : __( 'Go to the item page', 'tainacan' ) } >
</div>
</div>
}
},
/* Deprecated on Tainacan 0.18, due to the introduction of itemLinkButtonLabel and showItemLinkButton */ /* Deprecated on Tainacan 0.18, due to the introduction of itemLinkButtonLabel and showItemLinkButton */
{ {
attributes: { attributes: {

View File

@ -61,6 +61,12 @@
opacity: 0.75; opacity: 0.75;
margin-left: 6px; margin-left: 6px;
} }
&.fake-text-help-description {
background-color: var(--tainacan-info-color, rgba(200,200,200, 0.3));
width: 35%;
opacity: 0.75;
margin-top: 4px;
}
&.fake-help-button { &.fake-help-button {
background-color: var(--tainacan-secondary, rgba(200,200,200, 0.3)); background-color: var(--tainacan-secondary, rgba(200,200,200, 0.3));
height: 0.32em; height: 0.32em;

View File

@ -20,6 +20,7 @@
:metadata-section-label="$root.metadataSectionLabel" :metadata-section-label="$root.metadataSectionLabel"
:show-item-link-button="$root.showItemLinkButton" :show-item-link-button="$root.showItemLinkButton"
:item-link-button-label="$root.itemLinkButtonLabel" :item-link-button-label="$root.itemLinkButtonLabel"
:help-info-bellow-label="$root.helpInfoBellowLabel ? $root.helpInfoBellowLabel : false"
/> />
</template> </template>

View File

@ -119,7 +119,8 @@ document.addEventListener("DOMContentLoaded", () => {
attachmentsSectionLabel: '', attachmentsSectionLabel: '',
metadataSectionLabel: '', metadataSectionLabel: '',
showItemLinkButton: false, showItemLinkButton: false,
itemLinkButtonLabel: '' itemLinkButtonLabel: '',
helpInfoBellowLabel: false
}, },
beforeMount () { beforeMount () {
// Collection source settings // Collection source settings
@ -145,6 +146,8 @@ document.addEventListener("DOMContentLoaded", () => {
this.hideHelpButtons = this.isParameterTrue('hide-help-buttons'); this.hideHelpButtons = this.isParameterTrue('hide-help-buttons');
if (this.$el.attributes['hide-metadata-types'] != undefined) if (this.$el.attributes['hide-metadata-types'] != undefined)
this.hideMetadataTypes = this.isParameterTrue('hide-metadata-types'); this.hideMetadataTypes = this.isParameterTrue('hide-metadata-types');
if (this.$el.attributes['help-info-bellow-label'] != undefined)
this.helpInfoBellowLabel = this.isParameterTrue('help-info-bellow-label');
// Form sections labels // Form sections labels
if (this.$el.attributes['document-section-label'] != undefined) if (this.$el.attributes['document-section-label'] != undefined)

View File

@ -29,9 +29,14 @@
class="section-label"> class="section-label">
<label>{{ documentSectionLabel }}</label> <label>{{ documentSectionLabel }}</label>
<help-button <help-button
v-if="!hideHelpButtons" v-if="!hideHelpButtons && !helpInfoBellowLabel && $i18n.getHelperMessage('items', 'document')"
:title="$i18n.getHelperTitle('items', 'document')" :title="$i18n.getHelperTitle('items', 'document')"
:message="$i18n.getHelperMessage('items', 'document')"/> :message="$i18n.getHelperMessage('items', 'document')"/>
<p
class="metadatum-description-help-info"
v-if="!hideHelpButtons && helpInfoBellowLabel && $i18n.getHelperMessage('items', 'document')">
{{ $i18n.getHelperMessage('items', 'document') }}
</p>
</div> </div>
<div <div
class="section-box document-field" class="section-box document-field"
@ -137,10 +142,14 @@
class="section-label"> class="section-label">
<label>{{ thumbnailSectionLabel }}</label> <label>{{ thumbnailSectionLabel }}</label>
<help-button <help-button
v-if="!hideHelpButtons" v-if="!hideHelpButtons && !helpInfoBellowLabel && $i18n.getHelperMessage('items', '_thumbnail_id')"
:title="$i18n.getHelperTitle('items', '_thumbnail_id')" :title="$i18n.getHelperTitle('items', '_thumbnail_id')"
:message="$i18n.getHelperMessage('items', '_thumbnail_id')"/> :message="$i18n.getHelperMessage('items', '_thumbnail_id')"/>
<p
class="metadatum-description-help-info"
v-if="!hideHelpButtons && helpInfoBellowLabel && $i18n.getHelperMessage('items', '_thumbnail_id')">
{{ $i18n.getHelperMessage('items', '_thumbnail_id') }}
</p>
</div> </div>
<div class="section-toggle"> <div class="section-toggle">
<p>{{ showThumbnailInput ? $i18n.get('info_thumbnail_custom') : $i18n.get('info_thumbnail_default_from_document') }}</p> <p>{{ showThumbnailInput ? $i18n.get('info_thumbnail_custom') : $i18n.get('info_thumbnail_default_from_document') }}</p>
@ -276,9 +285,14 @@
<div class="section-label"> <div class="section-label">
<label>{{ $i18n.get('label_comments') }}</label> <label>{{ $i18n.get('label_comments') }}</label>
<help-button <help-button
v-if="!hideHelpButtons" v-if="!hideHelpButtons && !helpInfoBellowLabel && $i18n.getHelperMessage('items', 'comment_status')"
:title="$i18n.getHelperTitle('items', 'comment_status')" :title="$i18n.getHelperTitle('items', 'comment_status')"
:message="$i18n.getHelperMessage('items', 'comment_status')"/> :message="$i18n.getHelperMessage('items', 'comment_status')"/>
<p
class="metadatum-description-help-info"
v-if="!hideHelpButtons && helpInfoBellowLabel && $i18n.getHelperMessage('items', 'comment_status')">
{{ $i18n.getHelperMessage('items', 'comment_status') }}
</p>
</div> </div>
<div class="section-toggle"> <div class="section-toggle">
<div class="field has-addons"> <div class="field has-addons">
@ -462,7 +476,8 @@ export default {
attachmentsSectionLabel: String, attachmentsSectionLabel: String,
metadataSectionLabel: String, metadataSectionLabel: String,
showItemLinkButton: Boolean, showItemLinkButton: Boolean,
itemLinkButtonLabel: String itemLinkButtonLabel: String,
helpInfoBellowLabel: Boolean
}, },
data(){ data(){
return { return {
@ -814,6 +829,12 @@ export default {
} }
} }
.metadatum-description-help-info {
font-size: 0.75em;
color: var(--tainacan-info-color);
margin-bottom: 0.5em;
}
.document-field { .document-field {
ul { ul {
list-style: none; list-style: none;