Skip to content

Commit baa48e4

Browse files
committed
feat: show platinum sponsor logo smaller, add calls to add your logo and add a text
1 parent 0b42f20 commit baa48e4

8 files changed

Lines changed: 86 additions & 17 deletions

File tree

frontend/src/components/Blocks/Listing/variations/SponsorCardListing.jsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,20 @@ import {
99
} from '@package/components';
1010

1111
const SponsorCardListing = (props) => {
12-
const { items, isEditMode, cols = 3, linkToPage = false } = props;
12+
const {
13+
items,
14+
isEditMode,
15+
cols = 3,
16+
linkToPage = false,
17+
randomize = true,
18+
} = props;
1319

14-
const randomized_items = items
15-
.map((value) => ({ value, sort: Math.random() }))
16-
.sort((a, b) => a.sort - b.sort)
17-
.map(({ value }) => value);
20+
const randomized_items = randomize
21+
? items
22+
.map((value) => ({ value, sort: Math.random() }))
23+
.sort((a, b) => a.sort - b.sort)
24+
.map(({ value }) => value)
25+
: items;
1826

1927
return (
2028
<PresetWrapper {...props} className="simple-card-listing">

frontend/src/components/FooterSponsors/FooterSponsors.jsx

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { Button } from '@package/components';
66
import { flattenToAppURL } from '@plone/volto/helpers';
77
import { UniversalLink } from '@plone/volto/components';
88

9+
import yourLogoHereSVG from './YourLogo.svg';
10+
911
const FooterSponsors = (props) => {
1012
const { type = 'platinum' } = props;
1113
const subrequest_key = `${type}_sponsors`;
@@ -31,24 +33,64 @@ const FooterSponsors = (props) => {
3133
);
3234
}, [dispatch, subrequest_key, type]);
3335

34-
const plural = sponsors?.items.length > 1 ? 's' : '';
36+
const plural = sponsors?.items.length > 1 ? 's' : '(s)';
3537
const capitalizedType = String(type[0]).toUpperCase() + String(type).slice(1);
38+
const sponsorItems = sponsors?.loaded
39+
? sponsors.items.length > 0 &&
40+
sponsors.items.map((item) => {
41+
item['size'] = 'thumb';
42+
return item;
43+
})
44+
: [];
45+
46+
const listingSize = 5;
47+
48+
if (sponsorItems.length > 0) {
49+
const remainder = sponsorItems.length % listingSize;
50+
if (remainder > 0) {
51+
const placeholdersToAdd = listingSize - remainder;
52+
for (let i = 0; i < placeholdersToAdd; i++) {
53+
sponsorItems.push({
54+
'@id': '/foundation/sponsorship',
55+
title: 'Put your logo here',
56+
size: 'thumb',
57+
isPlaceholder: true,
58+
image: {
59+
scales: { thumb: { download: yourLogoHereSVG } },
60+
},
61+
});
62+
}
63+
}
64+
}
65+
3666
return sponsors?.loaded
3767
? sponsors.items.length > 0 && (
3868
<div className={`footer-sponsors-listing ${subrequest_key}`}>
3969
<div className="footer-sponsors-listing-headline">
40-
<h3>{`Our proud ${capitalizedType} Sponsor${plural}`}</h3>
70+
<h3>Powering the Future of Open Sovereignty</h3>
4171
<Button
4272
as={UniversalLink}
4373
primary
4474
size="medium"
4575
href={flattenToAppURL('/foundation/sponsorship')}
4676
arrow={true}
4777
>
48-
Become a Sponsor
78+
Become a sponsor — every contribution shapes our future!
4979
</Button>
5080
</div>
51-
<SponsorCardListing items={sponsors.items || []} />
81+
<p>
82+
Plone thrives because of organizations that believe in secure,
83+
independent, and open technology. We are deeply grateful to our
84+
Platinum Sponsors for their visionary support in sustaining the
85+
world's most secure CMS. Join them in shaping the future of digital
86+
freedom.
87+
</p>
88+
89+
<SponsorCardListing
90+
items={sponsorItems || []}
91+
cols={listingSize}
92+
randomize={false}
93+
/>
5294
</div>
5395
)
5496
: '';
Lines changed: 3 additions & 0 deletions
Loading

frontend/src/components/cards/SponsorCard.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ import { UniversalLink } from '@plone/volto/components';
66
import { ListingImage } from '@package/components';
77

88
const SponsorCard = (props) => {
9-
let image = ListingImage({ item: props, className: 'item-image' });
9+
let image = ListingImage({
10+
item: props,
11+
className: 'item-image',
12+
size: props?.size,
13+
});
1014

1115
let cardClass = cx('item', {
1216
'sponsor-card': true,

frontend/theme/extras/custom.overrides

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,5 @@
5959
@import 'site/components/widgets/image_widget.less';
6060

6161
@import 'site/components/controlpanels/membership.less';
62-
@import 'site/components/footer_sponsors.less';
6362

6463
@import 'site/print.less';

frontend/theme/extras/site/components/footer_sponsors.less

Lines changed: 0 additions & 6 deletions
This file was deleted.

frontend/theme/extras/site/components/layout/footer.less

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
margin: 1rem 0 0 0;
44
box-shadow: 0px 5px 7px 5px rgba(119, 119, 119, 0.1);
55
font-family: @headerFontName;
6+
background-color: @footerLightGrey;
67

78
#footer-main {
89
display: flex;
@@ -66,6 +67,21 @@
6667
}
6768
}
6869

70+
.footer-sponsors-listing {
71+
padding-bottom: 2em;
72+
73+
.footer-sponsors-listing-headline {
74+
display: flex;
75+
flex-wrap: wrap;
76+
align-items: center;
77+
justify-content: space-between;
78+
}
79+
80+
.item {
81+
background-color: transparent;
82+
}
83+
}
84+
6985
#footer-small-wrapper {
7086
padding: 1.5rem;
7187
margin-top: 1.5rem;

frontend/theme/globals/site.variables

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@
118118
/*--- --------------------------------Plone.org Variables-------------------------------- ---*/
119119
/*--- -------------------------------------------------------------------------------- ---*/
120120

121+
@footerLightGrey: #f7f7f7;
122+
123+
121124
@footerBordersColor: @lightGrey;
122125
@footerColumnsTextColor: #222;
123126
@footerLastColumnTextColor: #737373;

0 commit comments

Comments
 (0)