Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 fix(card): fichier tĂ©lĂ©charger et ratio carte de tĂ©lĂ©chargement [DS-3580] #938

Merged
merged 2 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/component/card/example/download/sample/card-download.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
const card = locals.card || {}
const content = card.content || {}
const data = {
img: imgData('img/placeholder.A4.png', 'unknown'),
img: imgData('img/placeholder.3x4.png', 'unknown'),
title: "Télécharger le/la [Typologie de document] « [Nom du document] »",
href: '/example/img/placeholder.3x4.png',
href: '/example/img/placeholder.3x4.pdf',
download: true,
content: {
description: "Texte de description (facultatif)",
Expand Down
7 changes: 4 additions & 3 deletions src/component/card/example/sample/card-default.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ if (card.img || card.vid) {

switch (true) {
case card.img !== undefined:
data.header.img = { ...imgData('img/placeholder.16x9.png', 'unknown'), ...card.img};
const imgRatio = card.img && card.img.ratio || '16x9';
data.header.img = { ...imgData(`img/placeholder.${imgRatio}.png`, 'unknown'), ...card.img};
break;

case card.vid !== undefined:
Expand Down Expand Up @@ -86,10 +87,10 @@ if (card.download) {
data.download = true;
if (!data.content.details) {
data.content.details = [];
data.content.details.push({ label: 'PNG - 1,1 ko', position: 'end'});
data.content.details.push({ label: 'PDF - 48 ko', position: 'end'});
} else {
const hasEnd = data.content.details.find(detail => detail.position === 'end');
if (!hasEnd) data.content.details.push({ label: 'PNG - 1,1 ko', position: 'end'});
if (!hasEnd) data.content.details.push({ label: 'PDF - 48 ko', position: 'end'});
}
}

Expand Down
2 changes: 1 addition & 1 deletion tool/build/copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const copyImages = (removeOrphans) => {
const src = root('tool/example/img');
const dest = root('example/img');

copyDir(src, dest, ['jpg', 'png', 'svg'], removeOrphans);
copyDir(src, dest, ['jpg', 'png', 'svg', 'pdf'], removeOrphans);
};

const copyAssets = (removeOrphans) => {
Expand Down
Binary file modified tool/example/img/placeholder-transcription.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tool/example/img/placeholder.16x9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 0 additions & 6 deletions tool/example/img/placeholder.16x9.svg

This file was deleted.

Binary file modified tool/example/img/placeholder.1x1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 0 additions & 6 deletions tool/example/img/placeholder.1x1.svg

This file was deleted.

Binary file added tool/example/img/placeholder.2x3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tool/example/img/placeholder.32x9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tool/example/img/placeholder.3x2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tool/example/img/placeholder.3x4.pdf
Binary file not shown.
Binary file modified tool/example/img/placeholder.3x4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tool/example/img/placeholder.4x3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tool/example/img/placeholder.9x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 0 additions & 6 deletions tool/example/img/placeholder.9x16.svg

This file was deleted.

Binary file modified tool/example/img/placeholder.A4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 0 additions & 6 deletions tool/example/img/placeholder.A4.svg

This file was deleted.