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

Correctif : conserve les variants d'images mais retire les prévisualisations de pdf #10440

Merged
merged 1 commit into from
May 22, 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
Binary file added app/assets/images/pdf-placeholder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions app/views/instructeurs/dossiers/pieces_jointes.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
- if blob.content_type.in?(AUTHORIZED_PDF_TYPES)
= link_to blob.url, id: blob.id, data: { iframe: true, src: blob.url }, class: 'gallery-link', type: blob.content_type, title: "#{champ.libelle} -- #{blob.filename}" do
.thumbnail
= image_tag(attachment.representation(resize_to_limit: [400, 400]).processed.url, loading: :lazy)
= image_tag("pdf-placeholder.png")
.fr-btn.fr-btn--tertiary.fr-btn--icon-left.fr-icon-eye{ role: :button }
Visualiser
.champ-libelle
Expand All @@ -21,7 +21,7 @@
- elsif blob.content_type.in?(AUTHORIZED_IMAGE_TYPES)
= link_to image_url(blob.url), title: "#{champ.libelle} -- #{blob.filename}", data: { src: blob.url }, class: 'gallery-link' do
.thumbnail
= image_tag(attachment.representation(resize_to_limit: [400, 400]).processed.url, loading: :lazy)
= image_tag(attachment.variant(resize_to_limit: [400, 400]).processed.url, loading: :lazy)
.fr-btn.fr-btn--tertiary.fr-btn--icon-left.fr-icon-eye{ role: :button }
Visualiser
.champ-libelle
Expand Down
4 changes: 2 additions & 2 deletions app/views/shared/champs/piece_justificative/_show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
- if blob.content_type.in?(AUTHORIZED_PDF_TYPES)
= link_to blob.url, id: blob.id, data: { iframe: true, src: blob.url }, class: 'gallery-link', type: blob.content_type, title: "#{champ.libelle} -- #{blob.filename}" do
.thumbnail
= image_tag(attachment.representation(resize_to_limit: [400, 400]).processed.url, loading: :lazy)
= image_tag("pdf-placeholder.png")
.fr-btn.fr-btn--tertiary.fr-btn--icon-left.fr-icon-eye{ role: :button }
= 'Visualiser'

- elsif blob.content_type.in?(AUTHORIZED_IMAGE_TYPES)
= link_to image_url(blob.url), title: "#{champ.libelle} -- #{blob.filename}", data: { src: blob.url }, class: 'gallery-link' do
.thumbnail
= image_tag(attachment.representation(resize_to_limit: [400, 400]).processed.url, loading: :lazy)
= image_tag(attachment.variant(resize_to_limit: [400, 400]).processed.url, loading: :lazy)
.fr-btn.fr-btn--tertiary.fr-btn--icon-left.fr-icon-eye{ role: :button }
= 'Visualiser'
- else
Expand Down
Loading