Merge pull request #10440 from demarches-simplifiees/keep-variants-but-not-pdf-previews
Correctif : conserve les variants d'images mais retire les prévisualisations de pdf
This commit is contained in:
commit
958215f0ea
3 changed files with 4 additions and 4 deletions
BIN
app/assets/images/pdf-placeholder.png
Normal file
BIN
app/assets/images/pdf-placeholder.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.5 KiB |
|
@ -11,7 +11,7 @@
|
||||||
- if blob.content_type.in?(AUTHORIZED_PDF_TYPES)
|
- 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
|
= 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
|
.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 }
|
.fr-btn.fr-btn--tertiary.fr-btn--icon-left.fr-icon-eye{ role: :button }
|
||||||
Visualiser
|
Visualiser
|
||||||
.champ-libelle
|
.champ-libelle
|
||||||
|
@ -21,7 +21,7 @@
|
||||||
- elsif blob.content_type.in?(AUTHORIZED_IMAGE_TYPES)
|
- 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
|
= link_to image_url(blob.url), title: "#{champ.libelle} -- #{blob.filename}", data: { src: blob.url }, class: 'gallery-link' do
|
||||||
.thumbnail
|
.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 }
|
.fr-btn.fr-btn--tertiary.fr-btn--icon-left.fr-icon-eye{ role: :button }
|
||||||
Visualiser
|
Visualiser
|
||||||
.champ-libelle
|
.champ-libelle
|
||||||
|
|
|
@ -11,14 +11,14 @@
|
||||||
- if blob.content_type.in?(AUTHORIZED_PDF_TYPES)
|
- 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
|
= 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
|
.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 }
|
.fr-btn.fr-btn--tertiary.fr-btn--icon-left.fr-icon-eye{ role: :button }
|
||||||
= 'Visualiser'
|
= 'Visualiser'
|
||||||
|
|
||||||
- elsif blob.content_type.in?(AUTHORIZED_IMAGE_TYPES)
|
- 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
|
= link_to image_url(blob.url), title: "#{champ.libelle} -- #{blob.filename}", data: { src: blob.url }, class: 'gallery-link' do
|
||||||
.thumbnail
|
.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 }
|
.fr-btn.fr-btn--tertiary.fr-btn--icon-left.fr-icon-eye{ role: :button }
|
||||||
= 'Visualiser'
|
= 'Visualiser'
|
||||||
- else
|
- else
|
||||||
|
|
Loading…
Reference in a new issue