refactor(gallery): use gallery component in gallery demande
This commit is contained in:
parent
664ef63e74
commit
3560d73b58
4 changed files with 23 additions and 27 deletions
|
@ -4,14 +4,17 @@ class Attachment::GalleryItemComponent < ApplicationComponent
|
|||
include GalleryHelper
|
||||
attr_reader :attachment
|
||||
|
||||
def initialize(attachment:)
|
||||
def initialize(attachment:, gallery_demande: false)
|
||||
@attachment = attachment
|
||||
@gallery_demande = gallery_demande
|
||||
end
|
||||
|
||||
def blob
|
||||
attachment.blob
|
||||
end
|
||||
|
||||
def gallery_demande? = @gallery_demande
|
||||
|
||||
def libelle
|
||||
attachment.record.class.in?([Champs::PieceJustificativeChamp, Champs::TitreIdentiteChamp]) ? attachment.record.libelle : 'Pièce jointe au message'
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue