Sha256: 6a3b0de14c3da728c7da2dc072f18ed493feabedb6776f94cfbbc0fe27fdf615

Contents?: true

Size: 673 Bytes

Versions: 58

Compression:

Stored size: 673 Bytes

Contents

# frozen_string_literal: true

module Decidim
  # This cell is intended to be used on user profiles.
  # Lists the invitations to user groups the given user has.
  class UserGroupPendingInvitationsListCell < Decidim::ViewModel
    include Decidim::CellsPaginateHelper
    include Decidim::ApplicationHelper
    include Decidim::Core::Engine.routes.url_helpers
    include Decidim::CardHelper

    def show
      return if invitations.empty?
      return unless own_profile?

      render :show
    end

    def invitations
      @invitations ||= Decidim::UserGroups::InvitedMemberships.for(model)
    end

    def own_profile?
      current_user == model
    end
  end
end

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
decidim-core-0.28.4 app/cells/decidim/user_group_pending_invitations_list_cell.rb
decidim-core-0.27.9 app/cells/decidim/user_group_pending_invitations_list_cell.rb
decidim-core-0.28.3 app/cells/decidim/user_group_pending_invitations_list_cell.rb
decidim-core-0.27.8 app/cells/decidim/user_group_pending_invitations_list_cell.rb
decidim-core-0.28.2 app/cells/decidim/user_group_pending_invitations_list_cell.rb
decidim-core-0.27.7 app/cells/decidim/user_group_pending_invitations_list_cell.rb
decidim-core-0.28.1 app/cells/decidim/user_group_pending_invitations_list_cell.rb
decidim-core-0.27.6 app/cells/decidim/user_group_pending_invitations_list_cell.rb
decidim-core-0.26.10 app/cells/decidim/user_group_pending_invitations_list_cell.rb
decidim-core-0.26.9 app/cells/decidim/user_group_pending_invitations_list_cell.rb
decidim-core-0.28.0 app/cells/decidim/user_group_pending_invitations_list_cell.rb
decidim-core-0.27.5 app/cells/decidim/user_group_pending_invitations_list_cell.rb
decidim-core-0.28.0.rc5 app/cells/decidim/user_group_pending_invitations_list_cell.rb
decidim-core-0.28.0.rc4 app/cells/decidim/user_group_pending_invitations_list_cell.rb
decidim-core-0.26.8 app/cells/decidim/user_group_pending_invitations_list_cell.rb
decidim-core-0.27.4 app/cells/decidim/user_group_pending_invitations_list_cell.rb
decidim-core-0.27.3 app/cells/decidim/user_group_pending_invitations_list_cell.rb
decidim-core-0.26.7 app/cells/decidim/user_group_pending_invitations_list_cell.rb
decidim-core-0.26.5 app/cells/decidim/user_group_pending_invitations_list_cell.rb
decidim-core-0.27.2 app/cells/decidim/user_group_pending_invitations_list_cell.rb