Class: Decidim::UserProfileCell

Inherits:
CardCell
  • Object
show all
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

#avatarObject



14
15
16
# File 'app/cells/decidim/user_profile_cell.rb', line 14

def avatar
  present(user).avatar_url
end

#presented_resourceObject



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_pathObject



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

#roleObject



18
19
20
# File 'app/cells/decidim/user_profile_cell.rb', line 18

def role
  return "admin" if user.admin?
end