Skip to content

Commit 883462f

Browse files
nunoeufrasioclaude
andcommitted
feat(training): small UI fixes
- rename menu label from "Trainings & Certs" to "Training & Certifications" - add Certification Verification Tool to useful links - move Download button to top-right corner of certification cards - move Download Certificate button to top-right corner of training cards Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Signed-off-by: Nuno Eufrasio <[email protected]>
1 parent ad050a5 commit 883462f

File tree

4 files changed

+49
-46
lines changed

4 files changed

+49
-46
lines changed

apps/lfx-one/src/app/layouts/main-layout/main-layout.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export class MainLayoutComponent {
106106
expanded: true,
107107
items: [
108108
{
109-
label: 'Trainings & Certs',
109+
label: 'Training & Certifications',
110110
icon: 'fa-light fa-graduation-cap',
111111
routerLink: '/me/training',
112112
},

apps/lfx-one/src/app/modules/trainings/components/certification-card/certification-card.component.html

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,42 @@
1616

1717
<!-- Col 2: Main content -->
1818
<div class="flex-1 min-w-0 flex flex-col gap-3">
19-
<!-- Top row: name + issuedBy | expired badge -->
19+
<!-- Top row: name + issuedBy | expired badge + download button -->
2020
<div class="flex items-start justify-between gap-4">
2121
<div class="flex flex-col gap-0.5 min-w-0">
2222
<h3 class="text-sm font-semibold text-gray-900 leading-snug" data-testid="cert-card-name">{{ cert().name }}</h3>
2323
<p class="text-xs text-gray-500">{{ cert().issuedBy }}</p>
2424
</div>
25-
@if (cert().status === 'expired') {
26-
<span
27-
class="flex-shrink-0 inline-flex items-center px-2.5 py-1 rounded-full text-xs font-medium bg-red-50 border border-red-200 text-red-700"
28-
data-testid="cert-card-expired-badge">
29-
Expired
30-
</span>
31-
}
25+
<div class="flex-shrink-0 flex items-center gap-2">
26+
@if (cert().status === 'expired') {
27+
<span
28+
class="inline-flex items-center px-2.5 py-1 rounded-full text-xs font-medium bg-red-50 border border-red-200 text-red-700"
29+
data-testid="cert-card-expired-badge">
30+
Expired
31+
</span>
32+
}
33+
@if (cert().downloadUrl) {
34+
<div data-testid="cert-card-actions">
35+
<lfx-button
36+
severity="secondary"
37+
styleClass="!text-xs !h-8 !py-0"
38+
label="Download"
39+
icon="fa-light fa-arrow-down-to-line"
40+
[href]="cert().downloadUrl!"
41+
target="_blank"
42+
rel="noopener noreferrer"
43+
[outlined]="true"
44+
data-testid="cert-card-download-btn" />
45+
</div>
46+
}
47+
</div>
3248
</div>
3349

3450
<!-- Description -->
3551
<p class="text-sm text-gray-600 line-clamp-2" [title]="cert().description" data-testid="cert-card-description">{{ cert().description }}</p>
3652

37-
<!-- Bottom row: meta fields + download button -->
38-
<div class="flex items-end justify-between gap-4 border-t border-gray-100 pt-3" data-testid="cert-card-meta-row">
53+
<!-- Bottom row: meta fields -->
54+
<div class="border-t border-gray-100 pt-3" data-testid="cert-card-meta-row">
3955
<div class="flex flex-wrap gap-x-8 gap-y-1.5 text-xs" data-testid="cert-card-meta">
4056
<div class="flex flex-col gap-0.5">
4157
<span class="text-gray-400">Date Earned</span>
@@ -54,22 +70,6 @@ <h3 class="text-sm font-semibold text-gray-900 leading-snug" data-testid="cert-c
5470
<span class="text-gray-500 font-mono" [title]="cert().certificateId" data-testid="cert-card-id">{{ cert().certificateId }}</span>
5571
</div>
5672
</div>
57-
58-
<!-- Download button (only when downloadUrl is available) -->
59-
@if (cert().downloadUrl) {
60-
<div class="flex-shrink-0" data-testid="cert-card-actions">
61-
<lfx-button
62-
severity="secondary"
63-
styleClass="!text-xs !h-8 !py-0"
64-
label="Download"
65-
icon="fa-light fa-arrow-down-to-line"
66-
[href]="cert().downloadUrl!"
67-
target="_blank"
68-
rel="noopener noreferrer"
69-
[outlined]="true"
70-
data-testid="cert-card-download-btn" />
71-
</div>
72-
}
7373
</div>
7474
</div>
7575
</div>

apps/lfx-one/src/app/modules/trainings/components/training-card/training-card.component.html

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
<!-- Col 2: Main content -->
1818
<div class="flex-1 min-w-0 flex flex-col gap-3">
19-
<!-- Top row: name + level badge + issuedBy | Continue Learning button -->
19+
<!-- Top row: name + level badge + issuedBy | Continue Learning / Download Certificate button -->
2020
<div class="flex items-start justify-between gap-4">
2121
<div class="flex flex-col gap-1 min-w-0">
2222
<div class="flex items-center gap-2 flex-wrap">
@@ -44,24 +44,7 @@ <h3 class="text-sm font-semibold text-gray-900 leading-snug" data-testid="traini
4444
[outlined]="true"
4545
data-testid="training-card-continue-btn" />
4646
</div>
47-
}
48-
</div>
49-
50-
<!-- Description -->
51-
<p class="text-sm text-gray-600 line-clamp-2" [title]="training().description" data-testid="training-card-description">
52-
{{ training().description }}
53-
</p>
54-
55-
<!-- Bottom row: date meta + download button (completed only) -->
56-
<div class="flex items-end justify-between gap-4 border-t border-gray-100 pt-3" data-testid="training-card-meta-row">
57-
<div class="flex flex-wrap gap-x-8 gap-y-1.5 text-xs" data-testid="training-card-meta">
58-
<div class="flex flex-col gap-0.5">
59-
<span class="text-gray-400">{{ dateLabel() }}</span>
60-
<span class="text-gray-700 font-medium" data-testid="training-card-date">{{ date() | date: 'MMM d, y' }}</span>
61-
</div>
62-
</div>
63-
64-
@if (downloadUrl()) {
47+
} @else if (downloadUrl()) {
6548
<div class="flex-shrink-0" data-testid="training-card-actions">
6649
<!-- TODO: replace !important overrides with a size="sm" input on ButtonComponent (LFXV2-TODO) -->
6750
<lfx-button
@@ -77,6 +60,21 @@ <h3 class="text-sm font-semibold text-gray-900 leading-snug" data-testid="traini
7760
</div>
7861
}
7962
</div>
63+
64+
<!-- Description -->
65+
<p class="text-sm text-gray-600 line-clamp-2" [title]="training().description" data-testid="training-card-description">
66+
{{ training().description }}
67+
</p>
68+
69+
<!-- Bottom row: date meta -->
70+
<div class="border-t border-gray-100 pt-3" data-testid="training-card-meta-row">
71+
<div class="flex flex-wrap gap-x-8 gap-y-1.5 text-xs" data-testid="training-card-meta">
72+
<div class="flex flex-col gap-0.5">
73+
<span class="text-gray-400">{{ dateLabel() }}</span>
74+
<span class="text-gray-700 font-medium" data-testid="training-card-date">{{ date() | date: 'MMM d, y' }}</span>
75+
</div>
76+
</div>
77+
</div>
8078
</div>
8179
</div>
8280
</div>

apps/lfx-one/src/app/modules/trainings/trainings-dashboard/trainings-dashboard.component.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ const USEFUL_LINKS = [
3333
url: 'https://training.linuxfoundation.org',
3434
description: 'Browse certifications, explore the full course catalog, and register for exams.',
3535
},
36+
{
37+
label: 'Certification Verification Tool',
38+
url: 'https://training.linuxfoundation.org/certification/verify/',
39+
description: 'Want proof of your certification? Use our Verification Tool to confirm and share the validity of your certifications.',
40+
},
3641
];
3742

3843
@Component({

0 commit comments

Comments
 (0)