Skip to content

Commit d0b91ce

Browse files
committed
feat: add business partner link to case studies
- Add business-partner module with logo and website fields - Add partner relationship field to case studies - Display partnership section on case study detail pages - Style partnership box with responsive layout - Add partner logo and link functionality
1 parent 22815b5 commit d0b91ce

5 files changed

Lines changed: 151 additions & 1 deletion

File tree

website/app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ function createAposConfig() {
125125
'cases-tags': {},
126126
'case-studies': {},
127127
'case-studies-page': {},
128+
'business-partner': {},
128129
'categories': {},
129130
'vacancies': {},
130131
'vacancies-list-widget': {},

website/modules/@apostrophecms/admin-bar/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = {
1212
},
1313
{
1414
label: 'Cases',
15-
items: ['case-studies', 'cases-tags'],
15+
items: ['case-studies', 'cases-tags', 'business-partner'],
1616
},
1717
{
1818
label: 'Categories',

website/modules/asset/ui/src/scss/_cases.scss

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,3 +1394,89 @@
13941394
}
13951395
}
13961396
}
1397+
1398+
// Partnership section
1399+
.cs_partnership {
1400+
z-index: 2;
1401+
text-decoration: none;
1402+
display: block;
1403+
width: 100%;
1404+
max-width: 687px;
1405+
min-width: 430px;
1406+
padding: 0 20px;
1407+
1408+
@include breakpoint-medium {
1409+
position: absolute;
1410+
top: 40px;
1411+
left: 0;
1412+
padding: 0;
1413+
}
1414+
1415+
&:hover,
1416+
&:focus {
1417+
text-decoration: none;
1418+
1419+
.cs_partnership-box {
1420+
box-shadow: 0 4px 12px rgba($black, 0.15);
1421+
transform: translateY(-2px);
1422+
}
1423+
}
1424+
}
1425+
1426+
.cs_partnership-box {
1427+
background-color: $white;
1428+
padding: 8px;
1429+
display: flex;
1430+
flex-direction: row;
1431+
align-items: center;
1432+
justify-content: center;
1433+
gap: 16px;
1434+
text-align: center;
1435+
transition: all 0.3s ease;
1436+
1437+
@include breakpoint-medium {
1438+
flex-direction: column;
1439+
width: 114px;
1440+
padding: 12px;
1441+
gap: 8px;
1442+
}
1443+
}
1444+
1445+
.cs_partnership-label {
1446+
display: flex;
1447+
flex-direction: row;
1448+
align-items: center;
1449+
gap: 2px;
1450+
1451+
.cs_partnership-text:nth-child(3) {
1452+
display: none;
1453+
}
1454+
1455+
@include breakpoint-medium {
1456+
flex-direction: column;
1457+
align-items: center;
1458+
}
1459+
}
1460+
1461+
.cs_partnership-text {
1462+
@include font-settings(11px, 110%, $font-weight-extra-bold);
1463+
color: $gray-500;
1464+
display: block;
1465+
1466+
@include breakpoint-medium {
1467+
text-transform: uppercase;
1468+
}
1469+
}
1470+
1471+
.cs_partnership-logo {
1472+
max-width: 100%;
1473+
height: auto;
1474+
max-height: 36px;
1475+
width: auto;
1476+
object-fit: contain;
1477+
display: block;
1478+
1479+
@include breakpoint-medium {
1480+
max-height: 46px;
1481+
}
1482+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
module.exports = {
2+
extend: '@apostrophecms/piece-type',
3+
options: {
4+
label: 'Business Partner',
5+
pluralLabel: 'Business Partners',
6+
slugPrefix: 'business-partner-',
7+
sort: {
8+
title: 1,
9+
},
10+
shortcut: false,
11+
},
12+
fields: {
13+
add: {
14+
title: {
15+
label: 'Partner Name',
16+
type: 'string',
17+
required: true,
18+
},
19+
partnerLogo: {
20+
label: 'Partner Logo',
21+
type: 'area',
22+
required: true,
23+
options: {
24+
max: 1,
25+
min: 1,
26+
widgets: {
27+
'@apostrophecms/image': {},
28+
},
29+
},
30+
},
31+
partnerWebsite: {
32+
label: 'Partner Website',
33+
type: 'string',
34+
required: true,
35+
help: "Link to partner's official website (must include http(s) protocol).",
36+
placeholder: 'https://example.com',
37+
},
38+
},
39+
group: {
40+
basics: {
41+
label: 'Basics',
42+
fields: ['title', 'partnerLogo', 'partnerWebsite'],
43+
},
44+
},
45+
},
46+
};
47+

website/modules/case-studies/index.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,21 @@ module.exports = {
5050
},
5151
help: 'Select technologies utilized in the project.',
5252
},
53+
_partner: {
54+
label: 'Partner',
55+
type: 'relationship',
56+
withType: 'business-partner',
57+
max: 1,
58+
builders: {
59+
project: {
60+
title: 1,
61+
slug: 1,
62+
partnerLogo: 1,
63+
partnerWebsite: 1,
64+
},
65+
},
66+
help: 'Select a partner for this case study.',
67+
},
5368
_caseStudyType: {
5469
label: 'Case Study Type',
5570
type: 'relationship',
@@ -144,6 +159,7 @@ module.exports = {
144159
'_stack',
145160
'_caseStudyType',
146161
'_industry',
162+
'_partner',
147163
'portfolioTitle',
148164
'descriptor',
149165
'prodLink',

0 commit comments

Comments
 (0)