Class: Decidim::MembersCell

Inherits:
ViewModel
  • Object
show all
Includes:
ApplicationHelper, CardHelper, CellsPaginateHelper, LayoutHelper
Defined in:
decidim-core/app/cells/decidim/members_cell.rb

Overview

This cell is intended to be used on profiles. Lists the members of the given user group.

Instance Method Summary collapse

Methods included from CardHelper

#card_for

Instance Method Details

#membership_cell_nameObject


17
18
19
20
21
# File 'decidim-core/app/cells/decidim/members_cell.rb', line 17

def membership_cell_name
  return "decidim/user_group_admin_membership_profile" if options[:from_admin].presence

  "decidim/user_group_membership_profile"
end

#membershipsObject


23
24
25
26
27
28
29
30
31
32
# File 'decidim-core/app/cells/decidim/members_cell.rb', line 23

def memberships
  @memberships ||= case options[:role].to_s
                   when "member"
                     Decidim::UserGroups::MemberMemberships.for(model).page(params[:page]).per(20)
                   when "admin"
                     Decidim::UserGroups::AdminMemberships.for(model).page(params[:page]).per(20)
                   else
                     Decidim::UserGroups::AcceptedMemberships.for(model).page(params[:page]).per(20)
                   end
end

#showObject


13
14
15
# File 'decidim-core/app/cells/decidim/members_cell.rb', line 13

def show
  render :show
end