Class: Decidim::ParticipatoryDocuments::SuggestionAuthorCell

Inherits:
ViewModel
  • Object
show all
Includes:
SanitizeHelper
Defined in:
app/cells/decidim/participatory_documents/suggestion_author_cell.rb

Instance Method Summary collapse

Instance Method Details

#author_avatar_urlObject



13
14
15
# File 'app/cells/decidim/participatory_documents/suggestion_author_cell.rb', line 13

def author_avatar_url
  model.author.avatar.attached? ? avatar_url : default_avatar_url(:thumb)
end

#author_nameObject



17
18
19
# File 'app/cells/decidim/participatory_documents/suggestion_author_cell.rb', line 17

def author_name
  model.author.name
end

#author_profile_pathObject



25
26
27
# File 'app/cells/decidim/participatory_documents/suggestion_author_cell.rb', line 25

def author_profile_path
  decidim.profile_path(model.author.nickname)
end

#avatarObject



21
22
23
# File 'app/cells/decidim/participatory_documents/suggestion_author_cell.rb', line 21

def avatar
  model.author.avatar.attached? ? model.author.avatar : nil
end

#creation_dateObject



29
30
31
32
33
# File 'app/cells/decidim/participatory_documents/suggestion_author_cell.rb', line 29

def creation_date
  date_at = model.try(:created_at)

  l date_at, format: :decidim_short
end

#showObject



8
9
10
11
# File 'app/cells/decidim/participatory_documents/suggestion_author_cell.rb', line 8

def show
  @suggestion = options[:suggestion]
  render
end

#suggestionObject



35
36
37
# File 'app/cells/decidim/participatory_documents/suggestion_author_cell.rb', line 35

def suggestion
  model
end