Class: Decidim::UserProfileCell
- Inherits:
-
CardCell
- Object
- CardCell
- Decidim::UserProfileCell
- Defined in:
- app/cells/decidim/user_profile_cell.rb
Overview
This cell renders the card of a user to show in followers and followed lists.
Instance Method Summary collapse
Instance Method Details
#avatar ⇒ Object
14 15 16 |
# File 'app/cells/decidim/user_profile_cell.rb', line 14 def avatar present(user).avatar_url end |
#presented_resource ⇒ Object
26 27 28 |
# File 'app/cells/decidim/user_profile_cell.rb', line 26 def presented_resource @presented_resource ||= user.class.name.include?("Presenter") ? model : present(user) end |
#resource_path ⇒ Object
22 23 24 |
# File 'app/cells/decidim/user_profile_cell.rb', line 22 def resource_path user.try(:profile_url) || decidim.profile_path(user.nickname) end |
#role ⇒ Object
18 19 20 |
# File 'app/cells/decidim/user_profile_cell.rb', line 18 def role return "admin" if user.admin? end |