Class: Decidim::UserProfileCell
- Inherits:
-
CardMCell
- Object
- ViewModel
- CardMCell
- Decidim::UserProfileCell
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.
Instance Method Summary
collapse
Methods inherited from CardMCell
#show
Methods included from CardHelper
#card_for
Instance Method Details
#avatar ⇒ Object
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
|
#description ⇒ Object
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_resource ⇒ Object
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_path ⇒ Object
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_data ⇒ Object
12
13
14
|
# File 'decidim-core/app/cells/decidim/user_profile_cell.rb', line 12
def unlinked_user_data
render
end
|
#user ⇒ Object
16
17
18
|
# File 'decidim-core/app/cells/decidim/user_profile_cell.rb', line 16
def user
model
end
|
#user_data ⇒ Object
8
9
10
|
# File 'decidim-core/app/cells/decidim/user_profile_cell.rb', line 8
def user_data
render
end
|