@eeacms/volto-cca-policy 0.2.98 → 0.2.100

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/locales/volto.pot CHANGED
@@ -1,7 +1,7 @@
1
1
  msgid ""
2
2
  msgstr ""
3
3
  "Project-Id-Version: Plone\n"
4
- "POT-Creation-Date: 2025-01-21T10:42:44.543Z\n"
4
+ "POT-Creation-Date: 2025-02-03T13:57:05.869Z\n"
5
5
  "Last-Translator: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
6
6
  "Language-Team: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
7
7
  "Content-Type: text/plain; charset=utf-8\n"
@@ -60,16 +60,6 @@ msgstr ""
60
60
  msgid "Agenda and supporting documents"
61
61
  msgstr ""
62
62
 
63
- #. Default: "Apr"
64
- #: components/manage/Blocks/Listing/EventCardsListingView
65
- msgid "Apr"
66
- msgstr ""
67
-
68
- #. Default: "Aug"
69
- #: components/manage/Blocks/Listing/EventCardsListingView
70
- msgid "Aug"
71
- msgstr ""
72
-
73
63
  #. Default: "Background information"
74
64
  #: components/theme/Views/C3SIndicatorView
75
65
  msgid "Background information"
@@ -110,6 +100,11 @@ msgstr ""
110
100
  msgid "Challenges"
111
101
  msgstr ""
112
102
 
103
+ #. Default: "Choose a file"
104
+ #: components/theme/Widgets/PromotionalImageWidget
105
+ msgid "Choose a file"
106
+ msgstr ""
107
+
113
108
  #. Default: "Choose a region"
114
109
  #: components/manage/Blocks/TransRegionSelect/TransRegionSelectView
115
110
  msgid "Choose a region"
@@ -193,11 +188,6 @@ msgstr ""
193
188
  msgid "Date of release:"
194
189
  msgstr ""
195
190
 
196
- #. Default: "Dec"
197
- #: components/manage/Blocks/Listing/EventCardsListingView
198
- msgid "Dec"
199
- msgstr ""
200
-
201
191
  #. Default: "Description"
202
192
  #: helpers/Utils
203
193
  msgid "Description"
@@ -228,6 +218,21 @@ msgstr ""
228
218
  msgid "Download this event in iCal format"
229
219
  msgstr ""
230
220
 
221
+ #. Default: "Drop file here to replace the existing file"
222
+ #: components/theme/Widgets/PromotionalImageWidget
223
+ msgid "Drop file here to replace the existing file"
224
+ msgstr ""
225
+
226
+ #. Default: "Drop file here to upload a new file"
227
+ #: components/theme/Widgets/PromotionalImageWidget
228
+ msgid "Drop file here to upload a new file"
229
+ msgstr ""
230
+
231
+ #. Default: "Drop files here ..."
232
+ #: components/theme/Widgets/PromotionalImageWidget
233
+ msgid "Drop files here ..."
234
+ msgstr ""
235
+
231
236
  #. Default: "Duration:"
232
237
  #: helpers/ContentMetadata
233
238
  msgid "Duration:"
@@ -243,21 +248,11 @@ msgstr ""
243
248
  msgid "Explore more on Climate-ADAPT"
244
249
  msgstr ""
245
250
 
246
- #. Default: "Feb"
247
- #: components/manage/Blocks/Listing/EventCardsListingView
248
- msgid "Feb"
249
- msgstr ""
250
-
251
251
  #. Default: "For more search options"
252
252
  #: index
253
253
  msgid "For more search options"
254
254
  msgstr ""
255
255
 
256
- #. Default: "Fr"
257
- #: components/manage/Blocks/Listing/EventCardsListingView
258
- msgid "Fr"
259
- msgstr ""
260
-
261
256
  #. Default: "Fullscreen"
262
257
  #: components/theme/Views/C3SIndicatorView
263
258
  msgid "Fullscreen"
@@ -344,21 +339,6 @@ msgstr ""
344
339
  msgid "Info"
345
340
  msgstr ""
346
341
 
347
- #. Default: "Jan"
348
- #: components/manage/Blocks/Listing/EventCardsListingView
349
- msgid "Jan"
350
- msgstr ""
351
-
352
- #. Default: "Jul"
353
- #: components/manage/Blocks/Listing/EventCardsListingView
354
- msgid "Jul"
355
- msgstr ""
356
-
357
- #. Default: "Jun"
358
- #: components/manage/Blocks/Listing/EventCardsListingView
359
- msgid "Jun"
360
- msgstr ""
361
-
362
342
  #. Default: "Key Type Measure"
363
343
  #: components/manage/Blocks/FilterAceContent/FilterAceContentView
364
344
  msgid "Key Type Measure"
@@ -389,11 +369,6 @@ msgstr ""
389
369
  msgid "Language of the conference"
390
370
  msgstr ""
391
371
 
392
- #. Default: "Last Modified in Climate-ADAPT"
393
- #: helpers/Utils
394
- msgid "Last Modified in Climate-ADAPT"
395
- msgstr ""
396
-
397
372
  #. Default: "Lead"
398
373
  #: components/theme/Views/ProjectView
399
374
  msgid "Lead"
@@ -426,21 +401,6 @@ msgstr ""
426
401
  msgid "Macro-Transnational region:"
427
402
  msgstr ""
428
403
 
429
- #. Default: "Mar"
430
- #: components/manage/Blocks/Listing/EventCardsListingView
431
- msgid "Mar"
432
- msgstr ""
433
-
434
- #. Default: "May"
435
- #: components/manage/Blocks/Listing/EventCardsListingView
436
- msgid "May"
437
- msgstr ""
438
-
439
- #. Default: "Mo"
440
- #: components/manage/Blocks/Listing/EventCardsListingView
441
- msgid "Mo"
442
- msgstr ""
443
-
444
404
  #. Default: "National HHAP"
445
405
  #: components/manage/Blocks/CountryMapHeatIndex/Filter
446
406
  msgid "National HHAP"
@@ -461,11 +421,6 @@ msgstr ""
461
421
  msgid "No results"
462
422
  msgstr ""
463
423
 
464
- #. Default: "Nov"
465
- #: components/manage/Blocks/Listing/EventCardsListingView
466
- msgid "Nov"
467
- msgstr ""
468
-
469
424
  #. Default: "Objectives of the adaptation measure"
470
425
  #: components/theme/Views/CaseStudyView
471
426
  msgid "Objectives of the adaptation measure"
@@ -481,16 +436,16 @@ msgstr ""
481
436
  msgid "Observatory contributions"
482
437
  msgstr ""
483
438
 
484
- #. Default: "Oct"
485
- #: components/manage/Blocks/Listing/EventCardsListingView
486
- msgid "Oct"
487
- msgstr ""
488
-
489
439
  #. Default: "Organisation Documents"
490
440
  #: helpers/Utils
491
441
  msgid "Organisation Documents"
492
442
  msgstr ""
493
443
 
444
+ #. Default: "Organised by EEA"
445
+ #: components/manage/Blocks/Listing/EventCardsListingView
446
+ msgid "Organised by EEA"
447
+ msgstr ""
448
+
494
449
  #. Default: "Other regions"
495
450
  #: components/manage/Blocks/TransRegionSelect/TransRegionSelectView
496
451
  msgid "Other regions"
@@ -511,6 +466,11 @@ msgstr ""
511
466
  msgid "Policy and legal background"
512
467
  msgstr ""
513
468
 
469
+ #. Default: "Policy context of the adaptation measure"
470
+ #: components/theme/Views/CaseStudyView
471
+ msgid "Policy context of the adaptation measure"
472
+ msgstr ""
473
+
514
474
  #. Default: "Practical information"
515
475
  #: components/theme/Views/CcaEventView
516
476
  msgid "Practical information"
@@ -568,14 +528,9 @@ msgstr ""
568
528
  msgid "Related documents and presentations"
569
529
  msgstr ""
570
530
 
571
- #. Default: "Relevance"
572
- #: components/theme/Views/CaseStudyView
573
- msgid "Relevance"
574
- msgstr ""
575
-
576
- #. Default: "Sa"
577
- #: components/manage/Blocks/Listing/EventCardsListingView
578
- msgid "Sa"
531
+ #. Default: "Replace existing file"
532
+ #: components/theme/Widgets/PromotionalImageWidget
533
+ msgid "Replace existing file"
579
534
  msgstr ""
580
535
 
581
536
  #. Default: "Search the Climate-ADAPT database"
@@ -624,11 +579,6 @@ msgstr ""
624
579
  msgid "Select"
625
580
  msgstr ""
626
581
 
627
- #. Default: "Sep"
628
- #: components/manage/Blocks/Listing/EventCardsListingView
629
- msgid "Sep"
630
- msgstr ""
631
-
632
582
  #. Default: "Share your information"
633
583
  #: components/manage/Blocks/SearchAceContent/SearchAceContentView
634
584
  #: components/theme/ShareInfoButton/ShareInfoButton
@@ -658,11 +608,6 @@ msgstr ""
658
608
  msgid "Stakeholder participation"
659
609
  msgstr ""
660
610
 
661
- #. Default: "Su"
662
- #: components/manage/Blocks/Listing/EventCardsListingView
663
- msgid "Su"
664
- msgstr ""
665
-
666
611
  #. Default: "Sub Nationals:"
667
612
  #: helpers/ContentMetadata
668
613
  msgid "Sub Nationals:"
@@ -679,11 +624,6 @@ msgstr ""
679
624
  msgid "Success and limiting factors"
680
625
  msgstr ""
681
626
 
682
- #. Default: "Th"
683
- #: components/manage/Blocks/Listing/EventCardsListingView
684
- msgid "Th"
685
- msgstr ""
686
-
687
627
  #. Default: "The Adaptation Support Tool - Getting started"
688
628
  #: components/theme/ASTNavigation/ASTAccordion
689
629
  msgid "The Adaptation Support Tool - Getting started"
@@ -704,11 +644,6 @@ msgstr ""
704
644
  msgid "The date refers to the moment in which the item has been prepared or updated by contributing experts to be submitted for the publication in Climate ADAPT"
705
645
  msgstr ""
706
646
 
707
- #. Default: "Tu"
708
- #: components/manage/Blocks/Listing/EventCardsListingView
709
- msgid "Tu"
710
- msgstr ""
711
-
712
647
  #. Default: "Updating notes"
713
648
  #: components/theme/Views/CaseStudyView
714
649
  msgid "Updating notes"
@@ -724,11 +659,6 @@ msgstr ""
724
659
  msgid "Visit external website"
725
660
  msgstr ""
726
661
 
727
- #. Default: "We"
728
- #: components/manage/Blocks/Listing/EventCardsListingView
729
- msgid "We"
730
- msgstr ""
731
-
732
662
  #. Default: "Web"
733
663
  #: helpers/Utils
734
664
  msgid "Web"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-cca-policy",
3
- "version": "0.2.98",
3
+ "version": "0.2.100",
4
4
  "description": "@eeacms/volto-cca-policy: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -1,186 +1,161 @@
1
1
  import React from 'react';
2
- import PropTypes from 'prop-types';
3
2
  import { compose } from 'redux';
4
- import { connect } from 'react-redux';
5
- import { Card, Grid, Icon, Label } from 'semantic-ui-react';
6
- import { useIntl, defineMessages, FormattedMessage } from 'react-intl';
3
+ import PropTypes from 'prop-types';
4
+ import { FormattedMessage } from 'react-intl';
5
+ import { connect, useSelector } from 'react-redux';
6
+ import { Card, Grid, Icon, Label, Image } from 'semantic-ui-react';
7
7
  import { ConditionalLink, UniversalLink } from '@plone/volto/components';
8
8
  import { When } from '@plone/volto/components/theme/View/EventDatesInfo';
9
+ import eeaLogo from '@eeacms/volto-cca-policy/../theme/assets/images/eea-logo.svg';
10
+ import { capitalizeFirstLetter } from '@eeacms/volto-cca-policy/helpers';
11
+ import config from '@plone/volto/registry';
9
12
  import './styles.less';
10
13
 
11
- const Separator = () => {
12
- return <div className="sep">&nbsp;&nbsp;⎯&nbsp;&nbsp;</div>;
13
- };
14
-
15
- const messages = defineMessages({
16
- jan: { id: 'Jan', defaultMessage: 'Jan' },
17
- feb: { id: 'Feb', defaultMessage: 'Feb' },
18
- mar: { id: 'Mar', defaultMessage: 'Mar' },
19
- apr: { id: 'Apr', defaultMessage: 'Apr' },
20
- may: { id: 'May', defaultMessage: 'May' },
21
- jun: { id: 'Jun', defaultMessage: 'Jun' },
22
- jul: { id: 'Jul', defaultMessage: 'Jul' },
23
- aug: { id: 'Aug', defaultMessage: 'Aug' },
24
- sep: { id: 'Sep', defaultMessage: 'Sep' },
25
- oct: { id: 'Oct', defaultMessage: 'Oct' },
26
- nov: { id: 'Nov', defaultMessage: 'Nov' },
27
- dec: { id: 'Dec', defaultMessage: 'Dec' },
28
-
29
- mo: { id: 'Mo', defaultMessage: 'Mo' },
30
- tu: { id: 'Tu', defaultMessage: 'Tu' },
31
- we: { id: 'We', defaultMessage: 'We' },
32
- th: { id: 'Th', defaultMessage: 'Th' },
33
- fr: { id: 'Fr', defaultMessage: 'Fr' },
34
- sa: { id: 'Sa', defaultMessage: 'Sa' },
35
- su: { id: 'Su', defaultMessage: 'Su' },
36
- });
14
+ const goToContact = (contactInfo) =>
15
+ contactInfo.includes('@') ? `mailto:${contactInfo}` : contactInfo;
37
16
 
38
- const StartDate = (start) => {
39
- const start_date = new Date(start);
17
+ const getEventUrl = (item) => item?.event_url || item['@id'];
40
18
 
41
- const day = start_date.getDate();
42
- const monthIndex = start_date.getMonth();
19
+ const StartDate = ({ start }) => {
20
+ const startDate = new Date(start);
21
+ const day = startDate.getDate();
22
+ const currentLang = useSelector((state) => state.intl.locale);
43
23
 
44
- const intl = useIntl();
45
- const monthNames = [
46
- intl.formatMessage(messages.jan),
47
- intl.formatMessage(messages.feb),
48
- intl.formatMessage(messages.mar),
49
- intl.formatMessage(messages.apr),
50
- intl.formatMessage(messages.may),
51
- intl.formatMessage(messages.jun),
52
- intl.formatMessage(messages.jul),
53
- intl.formatMessage(messages.aug),
54
- intl.formatMessage(messages.sep),
55
- intl.formatMessage(messages.oct),
56
- intl.formatMessage(messages.nov),
57
- intl.formatMessage(messages.dec),
58
- ];
59
-
60
- const dayNames = {
61
- Mo: intl.formatMessage(messages.mo),
62
- Tu: intl.formatMessage(messages.tu),
63
- We: intl.formatMessage(messages.we),
64
- Th: intl.formatMessage(messages.th),
65
- Fr: intl.formatMessage(messages.fr),
66
- Sa: intl.formatMessage(messages.sa),
67
- Su: intl.formatMessage(messages.su),
68
- };
69
-
70
- const monthName = monthNames[monthIndex];
24
+ const monthName = capitalizeFirstLetter(
25
+ startDate.toLocaleDateString(currentLang, { month: 'short' }),
26
+ );
71
27
 
72
- const dayOfWeek =
73
- dayNames[
74
- start_date.toLocaleDateString('en', { weekday: 'short' }).substring(0, 2)
75
- ];
28
+ const dayOfWeek = capitalizeFirstLetter(
29
+ startDate.toLocaleDateString(currentLang, { weekday: 'short' }),
30
+ );
76
31
 
77
32
  return (
78
33
  <div className="start-date">
79
34
  <p className="day">{dayOfWeek}</p>
80
- <p className="date">
81
- {day} {monthName}
82
- </p>
35
+ <p className="date">{`${day} ${monthName}`}</p>
83
36
  </div>
84
37
  );
85
38
  };
86
39
 
87
- const EventCardsListingView = ({ items, isEditMode, token }) => {
88
- const goToContact = (contactInfo) =>
89
- contactInfo.includes('@') ? `mailto:${contactInfo}` : contactInfo;
90
-
91
- const getEventUrl = (item) => item.event_url || item['@id'];
40
+ const EventCard = ({ item, isEditMode }) => (
41
+ <div className="u-item listing-item simple-listing-item" key={item.UID}>
42
+ <div className="wrapper">
43
+ <Card fluid>
44
+ <Card.Content>
45
+ <Grid stackable columns={12}>
46
+ <Grid.Column width={2}>
47
+ {item?.start && <StartDate start={item.start} />}
48
+ </Grid.Column>
49
+ <Grid.Column width={10}>
50
+ <div className="event-details">
51
+ <h3 className="listing-header">
52
+ <UniversalLink href={getEventUrl(item)}>
53
+ {item.title}
54
+ </UniversalLink>
55
+ </h3>
56
+ <EventDetails item={item} isEditMode={isEditMode} />
57
+ </div>
58
+ </Grid.Column>
59
+ </Grid>
60
+ </Card.Content>
61
+ </Card>
62
+ </div>
63
+ </div>
64
+ );
65
+
66
+ const EventDetails = ({ item, isEditMode }) => (
67
+ <>
68
+ {item?.start && (
69
+ <div className="listing-body-dates">
70
+ <span className="event-date">
71
+ <Icon className="ri-calendar-line" />
72
+ <When
73
+ whole_day
74
+ start={item.start}
75
+ end={item.end}
76
+ open_end={item.open_end}
77
+ />
78
+ </span>
79
+ </div>
80
+ )}
81
+ {item?.location && (
82
+ <div className="listing-body-dates">
83
+ <span className="event-date">
84
+ <Icon className="map marker alternate" />
85
+ {item.location}
86
+ </span>
87
+ </div>
88
+ )}
89
+ {item?.description && (
90
+ <p className="listing-description">{item.description}</p>
91
+ )}
92
+ <BottomInfo item={item} isEditMode={isEditMode} />
93
+ </>
94
+ );
95
+
96
+ const BottomInfo = ({ item, isEditMode }) => {
97
+ const { '@type': itemType, event_url, subjects, contact_email } = item || {};
98
+ const isCcaEventType = itemType === 'cca-event';
99
+ const isExternal = event_url && !event_url.includes(config.settings.apiPath);
92
100
 
93
101
  return (
94
- <div className="ui fluid eventCards">
95
- {items.map((item, index) => (
96
- <div className="u-item listing-item simple-listing-item" key={item.UID}>
97
- <div className="wrapper">
98
- <Card fluid>
99
- <Card.Content>
100
- <Grid stackable columns={12}>
101
- <Grid.Column width={2}>
102
- {!!item.start && StartDate(item.start)}
103
- </Grid.Column>
104
- <Grid.Column width={10}>
105
- <div className="event-details">
106
- <h3 className="listing-header">
107
- <UniversalLink href={getEventUrl(item)}>
108
- {item.title}
109
- </UniversalLink>
110
- </h3>
111
- {!!item.start && (
112
- <div className="listing-body-dates">
113
- <span className="event-date">
114
- <Icon className="ri-calendar-line" />
115
- <When
116
- start={item.start}
117
- end={item.end}
118
- whole_day={true}
119
- open_end={item.open_end}
120
- />
121
- </span>
122
- </div>
123
- )}
124
- {!!item.location && (
125
- <div className="listing-body-dates">
126
- <span className="event-date">
127
- <Icon className="map marker alternate" />
128
- {item.location}
129
- </span>
130
- </div>
131
- )}
132
- {item.description && (
133
- <p className="listing-description">
134
- {item.description}
135
- </p>
136
- )}
137
- <div className="bottom-info">
138
- {!!item.subjects && item.subjects.length > 0 && (
139
- <>
140
- <div className="subjects">
141
- {item.subjects.map((tag) => (
142
- <Label key={tag} size="small">
143
- {tag}
144
- </Label>
145
- ))}
146
- </div>
147
-
148
- <Separator />
149
- </>
150
- )}
151
- <div className="source">
152
- <ConditionalLink item={item} condition={!isEditMode}>
153
- <FormattedMessage
154
- id="Climate-ADAPT page for this event"
155
- defaultMessage="Climate-ADAPT page for this event"
156
- />
157
- </ConditionalLink>
158
- </div>
159
- {!!item.contact_email && (
160
- <>
161
- <Separator />
162
- <div className="email-info">
163
- <Icon className="mail" />
164
- <a
165
- className="contact_email"
166
- title=""
167
- href={goToContact(item.contact_email)}
168
- target="_blank"
169
- rel="noreferrer"
170
- >
171
- {item.contact_email}
172
- </a>
173
- </div>
174
- </>
175
- )}
176
- </div>
177
- </div>
178
- </Grid.Column>
179
- </Grid>
180
- </Card.Content>
181
- </Card>
102
+ <>
103
+ {(!isExternal || isCcaEventType) && (
104
+ <div className="event-organisation">
105
+ <FormattedMessage
106
+ id="Organised by EEA"
107
+ defaultMessage="Organised by EEA"
108
+ />
109
+ <Image
110
+ className="eea-logo"
111
+ src={eeaLogo}
112
+ alt="European Environment Agency"
113
+ title="European Environment Agency"
114
+ />
115
+ </div>
116
+ )}
117
+ <div className="bottom-info">
118
+ {subjects && subjects.length > 0 && (
119
+ <div className="subjects">
120
+ {subjects.map((tag) => (
121
+ <Label key={tag} size="small">
122
+ {tag}
123
+ </Label>
124
+ ))}
182
125
  </div>
126
+ )}
127
+
128
+ <div className="source">
129
+ <ConditionalLink item={item} condition={!isEditMode}>
130
+ <FormattedMessage
131
+ id="Climate-ADAPT page for this event"
132
+ defaultMessage="Climate-ADAPT page for this event"
133
+ />
134
+ </ConditionalLink>
183
135
  </div>
136
+ {contact_email && (
137
+ <div className="email-info">
138
+ <Icon name="mail" />
139
+ <a
140
+ className="contact_email"
141
+ href={goToContact(contact_email)}
142
+ target="_blank"
143
+ rel="noreferrer"
144
+ >
145
+ {contact_email}
146
+ </a>
147
+ </div>
148
+ )}
149
+ </div>
150
+ </>
151
+ );
152
+ };
153
+
154
+ const EventCardsListingView = ({ items, isEditMode }) => {
155
+ return (
156
+ <div className="ui fluid eventCards">
157
+ {items.map((item) => (
158
+ <EventCard key={item.UID} item={item} isEditMode={isEditMode} />
184
159
  ))}
185
160
  </div>
186
161
  );