Class: Decidim::Assemblies::AssemblyPresenter
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Decidim::Assemblies::AssemblyPresenter
show all
- Includes:
- TranslationsHelper
- Defined in:
- decidim-assemblies/app/presenters/decidim/assemblies/assembly_presenter.rb
Instance Method Summary
collapse
empty_translatable, ensure_translatable, multi_translation, translated_in_current_locale?
#default_locale?
Instance Method Details
#assembly ⇒ Object
52
53
54
|
# File 'decidim-assemblies/app/presenters/decidim/assemblies/assembly_presenter.rb', line 52
def assembly
__getobj__
end
|
#assembly_type ⇒ Object
40
41
42
43
44
|
# File 'decidim-assemblies/app/presenters/decidim/assemblies/assembly_presenter.rb', line 40
def assembly_type
return if assembly.assembly_type.blank?
translated_attribute(assembly.assembly_type.title)
end
|
#banner_image_url ⇒ Object
12
13
14
|
# File 'decidim-assemblies/app/presenters/decidim/assemblies/assembly_presenter.rb', line 12
def banner_image_url
assembly.attached_uploader(:banner_image).url(host: assembly.organization.host)
end
|
#closing_date ⇒ Object
30
31
32
|
# File 'decidim-assemblies/app/presenters/decidim/assemblies/assembly_presenter.rb', line 30
def closing_date
formatted_date(assembly.closing_date)
end
|
#creation_date ⇒ Object
22
23
24
|
# File 'decidim-assemblies/app/presenters/decidim/assemblies/assembly_presenter.rb', line 22
def creation_date
formatted_date(assembly.creation_date)
end
|
#duration ⇒ Object
34
35
36
37
38
|
# File 'decidim-assemblies/app/presenters/decidim/assemblies/assembly_presenter.rb', line 34
def duration
return I18n.t("indefinite_duration", scope: "decidim.assemblies.assemblies.description") if (date = assembly.duration).blank?
formatted_date(date)
end
|
46
47
48
49
50
|
# File 'decidim-assemblies/app/presenters/decidim/assemblies/assembly_presenter.rb', line 46
def formatted_date(date)
return if date.blank?
I18n.l(date, format: :decidim_short)
end
|
#hero_image_url ⇒ Object
8
9
10
|
# File 'decidim-assemblies/app/presenters/decidim/assemblies/assembly_presenter.rb', line 8
def hero_image_url
assembly.attached_uploader(:hero_image).url(host: assembly.organization.host)
end
|
#included_at ⇒ Object
26
27
28
|
# File 'decidim-assemblies/app/presenters/decidim/assemblies/assembly_presenter.rb', line 26
def included_at
formatted_date(assembly.included_at)
end
|