Class: Decidim::InitiativesVotes::VoteCell

Inherits:
ViewModel
  • Object
show all
Defined in:
app/cells/decidim/initiatives_votes/vote_cell.rb

Instance Method Summary collapse

Instance Method Details

#date_of_birthObject



28
29
30
# File 'app/cells/decidim/initiatives_votes/vote_cell.rb', line 28

def date_of_birth
  [:date_of_birth]
end

#document_numberObject



24
25
26
# File 'app/cells/decidim/initiatives_votes/vote_cell.rb', line 24

def document_number
  [:document_number]
end

#initiative_idObject



12
13
14
# File 'app/cells/decidim/initiatives_votes/vote_cell.rb', line 12

def initiative_id
  model.initiative.reference
end

#initiative_titleObject



16
17
18
# File 'app/cells/decidim/initiatives_votes/vote_cell.rb', line 16

def initiative_title
  decidim_sanitize_translated(model.initiative.title)
end

#name_and_surnameObject



20
21
22
# File 'app/cells/decidim/initiatives_votes/vote_cell.rb', line 20

def name_and_surname
  [:name_and_surname]
end

#postal_codeObject



32
33
34
# File 'app/cells/decidim/initiatives_votes/vote_cell.rb', line 32

def postal_code
  [:postal_code]
end

#scopeObject



40
41
42
43
44
45
# File 'app/cells/decidim/initiatives_votes/vote_cell.rb', line 40

def scope
  return I18n.t("decidim.scopes.global") if model.decidim_scope_id.nil?
  return I18n.t("decidim.initiatives.unavailable_scope") if model.scope.blank?

  translated_attribute(model.scope.name)
end

#showObject



8
9
10
# File 'app/cells/decidim/initiatives_votes/vote_cell.rb', line 8

def show
  render
end

#time_and_dateObject



36
37
38
# File 'app/cells/decidim/initiatives_votes/vote_cell.rb', line 36

def time_and_date
  model.created_at
end