Class: Decidim::UserProfileCell

Inherits:
CardMCell
  • Object
show all
Includes:
SanitizeHelper
Defined in:
decidim-core/app/cells/decidim/user_profile_cell.rb

Overview

This cell renders the profile of the given user.

Direct Known Subclasses

UserGroupMembershipProfileCell

Instance Method Summary collapse

Methods inherited from CardMCell

#show

Methods included from CardHelper

#card_for

Instance Method Details

#avatarObject



35
36
37
# File 'decidim-core/app/cells/decidim/user_profile_cell.rb', line 35

def avatar
  present(user).avatar_url(variant: :big, host: organization.host)
end

#descriptionObject



31
32
33
# File 'decidim-core/app/cells/decidim/user_profile_cell.rb', line 31

def description
  html_truncate(decidim_html_escape(user.about.to_s), length: 100)
end

#presented_resourceObject



39
40
41
# File 'decidim-core/app/cells/decidim/user_profile_cell.rb', line 39

def presented_resource
  @presented_resource ||= user.class.name.include?("Presenter") ? model : present(user)
end

#resource_pathObject



20
21
22
# File 'decidim-core/app/cells/decidim/user_profile_cell.rb', line 20

def resource_path
  decidim.profile_path(user.nickname)
end

#unlinked_user_dataObject



12
13
14
# File 'decidim-core/app/cells/decidim/user_profile_cell.rb', line 12

def unlinked_user_data
  render
end

#userObject



16
17
18
# File 'decidim-core/app/cells/decidim/user_profile_cell.rb', line 16

def user
  model
end

#user_dataObject



8
9
10
# File 'decidim-core/app/cells/decidim/user_profile_cell.rb', line 8

def user_data
  render
end