Skip to content

Commit

Permalink
feat: make configurable the types that show dates in listing cards (#777
Browse files Browse the repository at this point in the history
)

* feat: make configurable the types that show dates in listing cards

* chore: rename setting
  • Loading branch information
mamico authored and pnicolli committed Oct 3, 2024
1 parent d76ef58 commit b483949
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
getEventRecurrenceMore,
getComponentWithFallback,
} from 'design-comuni-plone-theme/helpers';
import config from '@plone/volto/registry';

const messages = defineMessages({
card_detail_label: { id: 'Card detail label', defaultMessage: 'Vedi' },
Expand Down Expand Up @@ -95,6 +96,9 @@ const SimpleCardDefault = (props) => {
const isEventAppointment =
item?.parent?.['@type'] === 'Event' && item?.['@type'] === 'Event';

const showContentDateInListingFor =
config.settings.siteProperties.showContentDateInListingFor;

return (
<Card
className={`align-items-top rounded shadow no-after ${getItemClass(
Expand Down Expand Up @@ -137,7 +141,7 @@ const SimpleCardDefault = (props) => {
{listingText && (
<CardText className={cx('', { 'mb-5': eventRecurrenceMore })}>
{listingText}
{(type === 'Modulo' || type === 'Documento') && !hide_dates && (
{showContentDateInListingFor.includes(type) && !hide_dates && (
<div className="document-date mt-3">
{item?.effective && (
<p className="mb-0">
Expand Down
1 change: 1 addition & 0 deletions src/config/italiaConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ export default function applyConfig(voltoConfig) {
footerNavigationDepth: 2, //valori possibili: [1,2]. Se impostato ad 1 non verranno mostrati nel footer i link agli elementi contenuti nelle sezioni di primo livello.
markSpecialLinks: true, // se impostato a false, non marca con icona i link esterni
markFooterLinks: true, // se impostato a true, viene aggiunta un'icona ai link del footer per renderli riconoscibili
showContentDateInListingFor: ['Modulo', 'Documento'], // elenco dei content types per i quali mostrare la data di pubblicazione/modifica in listing
},
apiExpanders: [
...config.settings.apiExpanders,
Expand Down

0 comments on commit b483949

Please sign in to comment.