Skip to content

Commit

Permalink
feat: show Last modified date for documents in ct Bando(#749)
Browse files Browse the repository at this point in the history
* feat: added file last modified date

* fix: added message

* fix: condition

* chore: release.md

* Update src/components/ItaliaTheme/View/Commons/Attachment.jsx

Co-authored-by: Giulia Ghisini <[email protected]>

* fix: added condition for show the modified date

* fix: conflit solved

* fix: added condition

Co-authored-by: Giulia Ghisini <[email protected]>

* Update RELEASE.md

---------

Co-authored-by: Giulia Ghisini <[email protected]>
  • Loading branch information
Wagner3UB and giuliaghisini authored Sep 4, 2024
1 parent 6610990 commit bcaa25f
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 2 deletions.
6 changes: 6 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
- ...
-->

## Versione 7.30.5 (02/09/2024)

### Migliorie

- Aggiunto la data di modifica nei documenti allegati del CT Bando

## Versione 7.30.4 (26/08/2024)

### Fix
Expand Down
5 changes: 5 additions & 0 deletions locales/de/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2170,6 +2170,11 @@ msgstr ""
msgid "iter_del_procedimento"
msgstr ""

#: components/ItaliaTheme/View/Commons/Attachment
# defaultMessage: Ultimo agg.to:
msgid "last_update"
msgstr ""

#: components/ItaliaTheme/View/UOView/UOStructure
# defaultMessage: Servizi o uffici di riferimento
msgid "legami_altre_strutture"
Expand Down
5 changes: 5 additions & 0 deletions locales/en/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2155,6 +2155,11 @@ msgstr ""
msgid "iter_del_procedimento"
msgstr "Procedure of the procedure"

#: components/ItaliaTheme/View/Commons/Attachment
# defaultMessage: Ultimo agg.to:
msgid "last_update"
msgstr "Last update"

#: components/ItaliaTheme/View/UOView/UOStructure
# defaultMessage: Servizi o uffici di riferimento
msgid "legami_altre_strutture"
Expand Down
5 changes: 5 additions & 0 deletions locales/es/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2164,6 +2164,11 @@ msgstr "Inserta un filtro del menú lateral para ver los resultados relacionados
msgid "iter_del_procedimento"
msgstr "Procedimiento"

#: components/ItaliaTheme/View/Commons/Attachment
# defaultMessage: Ultimo agg.to:
msgid "last_update"
msgstr ""

#: components/ItaliaTheme/View/UOView/UOStructure
# defaultMessage: Servizi o uffici di riferimento
msgid "legami_altre_strutture"
Expand Down
5 changes: 5 additions & 0 deletions locales/fr/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2172,6 +2172,11 @@ msgstr ""
msgid "iter_del_procedimento"
msgstr "Procédure"

#: components/ItaliaTheme/View/Commons/Attachment
# defaultMessage: Ultimo agg.to:
msgid "last_update"
msgstr ""

#: components/ItaliaTheme/View/UOView/UOStructure
# defaultMessage: Servizi o uffici di riferimento
msgid "legami_altre_strutture"
Expand Down
5 changes: 5 additions & 0 deletions locales/it/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2155,6 +2155,11 @@ msgstr "Inserire un filtro dal menù laterale per visualizzare i relativi risult
msgid "iter_del_procedimento"
msgstr "Iter del procedimento"

#: components/ItaliaTheme/View/Commons/Attachment
# defaultMessage: Ultimo agg.to:
msgid "last_update"
msgstr ""

#: components/ItaliaTheme/View/UOView/UOStructure
# defaultMessage: Servizi o uffici di riferimento
msgid "legami_altre_strutture"
Expand Down
7 changes: 6 additions & 1 deletion locales/volto.pot
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: Plone\n"
"POT-Creation-Date: 2024-07-25T10:23:52.051Z\n"
"POT-Creation-Date: 2024-08-28T08:55:19.173Z\n"
"Last-Translator: Plone i18n <[email protected]>\n"
"Language-Team: Plone i18n <[email protected]>\n"
"MIME-Version: 1.0\n"
Expand Down Expand Up @@ -2157,6 +2157,11 @@ msgstr ""
msgid "iter_del_procedimento"
msgstr ""

#: components/ItaliaTheme/View/Commons/Attachment
# defaultMessage: Ultimo agg.to:
msgid "last_update"
msgstr ""

#: components/ItaliaTheme/View/UOView/UOStructure
# defaultMessage: Servizi o uffici di riferimento
msgid "legami_altre_strutture"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const BandoApprofondimenti = ({ content }) => {
description={item.description}
download_url={item.url}
item={item}
showModified={true}
/>
// item={item} viene utilizzato nelle customizzazioni per ottenere altre proprietà
);
Expand Down
20 changes: 19 additions & 1 deletion src/components/ItaliaTheme/View/Commons/Attachment.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,27 @@ import {
CardTitle,
} from 'design-react-kit/dist/design-react-kit';
import { flattenToAppURL } from '@plone/volto/helpers';
import { viewDate } from 'design-comuni-plone-theme/helpers';
import { Icon } from 'design-comuni-plone-theme/components/ItaliaTheme';

const messages = defineMessages({
attachment: {
id: 'attachment',
defaultMessage: 'Allegato',
},
last_update: {
id: 'last_update',
defaultMessage: 'Ultimo agg.to:',
},
});

const Attachment = ({ title, description, download_url }) => {
const Attachment = ({
title,
description,
download_url,
item,
showModified = false,
}) => {
const intl = useIntl();
return (
<Card
Expand All @@ -34,6 +45,13 @@ const Attachment = ({ title, description, download_url }) => {
<a href={flattenToAppURL(download_url)}>{title}</a>
</CardTitle>
{description && <p>{description}</p>}

{showModified && item?.modified && (
<p>
{intl.formatMessage(messages.last_update)}{' '}
{viewDate(intl.locale, item?.modified, 'DD-MM-Y HH:MM')}
</p>
)}
</CardBody>
</Card>
);
Expand Down

0 comments on commit bcaa25f

Please sign in to comment.