Skip to content

Commit

Permalink
improve mail (#111)
Browse files Browse the repository at this point in the history
Signed-off-by: Mirko Mollik <mirkomollik@gmail.com>
  • Loading branch information
cre8 authored Oct 14, 2024
1 parent e829c57 commit a705f4a
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 21 deletions.
7 changes: 4 additions & 3 deletions viewer/scripts/mail-template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
.hash-tags {
margin-top: 10px;
}
.hash-tags span {
.hash-tags a {
background-color: #eeeeee;
border-radius: 4px;
padding: 5px 10px;
Expand Down Expand Up @@ -212,11 +212,12 @@
</h3>
<p>{{this.summary}}</p>
<br>
<a href="{{this.url}}" target="_blank">Read More</a>
<a href="{{this.url}}" target="_blank"><b>Read More</b></a>
<br>
<br>
<div class="hash-tags">
{{#each this.hashTags}}
<span>#{{this}}</span>
<a href="{{this.url}}">#{{this.value}}</span>
{{/each}}
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions viewer/scripts/newsletter.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const caseStudies = caseStudyFiles.map(caseStudy => {
companyUrl: wallet.companyUrl ?? wallet.urlWebsite,
}))
content.url = `${url}/case-studies/${encodeURIComponent(id)}`;
content.hashTags = content.hashTags.map(tag => ({url: `${url}/case-studies?tag=${encodeURIComponent(tag)}`, value: tag}));
return content;
});

Expand Down
38 changes: 21 additions & 17 deletions viewer/src/app/case-studies/case-studies-data.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@

import { CaseStudy } from './types';

export const casestudyData: CaseStudy[] = [
{
headline:
'Spherity and RCS Global introduce the first Catena-X Certified Battery Passport Solution',
summary:
'Spherity and RCS Global have launched the first Catena-X certified Battery Passport Solution called Claritas. This solution enhances transparency in the battery supply chain, ensuring compliance with global sustainability and ethical sourcing standards. Integrating seamlessly with the Catena-X ecosystem, it facilitates data exchange and lifecycle management, supporting circular economy goals. The passport helps companies meet EU regulations, reduce costs, and improve sustainability reporting, focusing on repair, recycling, and carbon footprint management. This innovation marks a significant step toward responsible battery production and supply chain accountability.',
createdAt: '2024-05-15',
imageUrl:
'https://cdn.prod.website-files.com/66a91e51440a74950f23fc8f/66c6c510b1a8b8421be7f9b3_Spherity%20x%20RCS%20Global-Catena-x%20certifed%201%20updated.jpg',
url: 'https://www.spherity.com/newsroom/catena-x-certified-battery-passport-solution',
stage: 'production',
hashTags: ['Battery Passport', 'CatenaX', 'Sustanability'],
references: ['spherity-wallet'],
stakeholders: [
"headline": "Spherity and RCS Global launch Catena-X Battery Passport",
"summary": "Spherity and RCS Global have launched the first Catena-X certified Battery Passport Solution called Claritas. This solution enhances transparency in the battery supply chain, ensuring compliance with global sustainability and ethical sourcing standards. Integrating seamlessly with the Catena-X ecosystem, it facilitates data exchange and lifecycle management, supporting circular economy goals. The passport helps companies meet EU regulations, reduce costs, and improve sustainability reporting, focusing on repair, recycling, and carbon footprint management. This innovation marks a significant step toward responsible battery production and supply chain accountability.",
"createdAt": "2024-05-15",
"imageUrl": "https://cdn.prod.website-files.com/66a91e51440a74950f23fc8f/66c6c510b1a8b8421be7f9b3_Spherity%20x%20RCS%20Global-Catena-x%20certifed%201%20updated.jpg",
"url": "https://www.spherity.com/newsroom/catena-x-certified-battery-passport-solution",
"stage": "production",
"hashTags": [
"Battery Passport",
"CatenaX",
"Sustanability"
],
"references": [
"spherity-wallet"
],
"stakeholders": [
{
name: 'RCS Global',
contact: 'https://www.rcsglobal.com/',
},
"name": "RCS Global",
"contact": "https://www.rcsglobal.com/"
}
],
id: 'battery-passport',
},
"id": "battery-passport"
}
];
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
<app-case-studies-list-embedded
[caseStudies]="caseStudies"
></app-case-studies-list-embedded>
@if(caseStudies.length === 0) {
<h4>No case studies found.</h4>
}
</div>
<div fxFlex fxLayout="column" fxLayoutGap="16px">
<mat-card>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { CaseStudiesListEmbeddedComponent } from '../case-studies-list-embedded/
import { MatDialog } from '@angular/material/dialog';
import { CaseStudiesAddComponent } from '../case-studies-add/case-studies-add.component';
import { FlexLayoutServerModule } from '@ngbracket/ngx-layout/server';
import { MatSnackBar } from '@angular/material/snack-bar';

@Component({
selector: 'app-case-studies-list',
Expand Down Expand Up @@ -46,7 +47,8 @@ export class CaseStudiesListComponent implements OnInit, OnDestroy {
public caseStudiesService: CaseStudiesService,
private route: ActivatedRoute,
private router: Router,
private dialog: MatDialog
private dialog: MatDialog,
private snackbar: MatSnackBar
) {}

ngOnInit(): void {
Expand All @@ -59,6 +61,20 @@ export class CaseStudiesListComponent implements OnInit, OnDestroy {
caseStudy.hashTags?.includes(this.filter as string)
);
this.applyFilter();
if (this.caseStudies.length === 0) {
const found = this.caseStudiesService
.getTags()
.find((tag) => tag === this.filter);
if (!found) {
this.snackbar
.open(
`No case studies found for tag: ${this.filter}`,
'Reset filter'
)
.afterDismissed()
.subscribe(() => this.router.navigate([]));
}
}
}
});
this.route.fragment.subscribe((fragment) => {
Expand Down

0 comments on commit a705f4a

Please sign in to comment.