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.27.1 app/cells/decidim/user_group_pending_invitations_list_cell.rb
decidim-core-0.26.4 app/cells/decidim/user_group_pending_invitations_list_cell.rb
decidim-core-0.27.0 app/cells/decidim/user_group_pending_invitations_list_cell.rb
decidim-core-0.26.3 app/cells/decidim/user_group_pending_invitations_list_cell.rb
decidim-core-0.27.0.rc2 app/cells/decidim/user_group_pending_invitations_list_cell.rb
decidim-core-0.27.0.rc1 app/cells/decidim/user_group_pending_invitations_list_cell.rb
decidim-core-0.26.2 app/cells/decidim/user_group_pending_invitations_list_cell.rb
decidim-core-0.26.1 app/cells/decidim/user_group_pending_invitations_list_cell.rb
decidim-core-0.26.0 app/cells/decidim/user_group_pending_invitations_list_cell.rb
decidim-core-0.26.0.rc2 app/cells/decidim/user_group_pending_invitations_list_cell.rb
decidim-core-0.26.0.rc1 app/cells/decidim/user_group_pending_invitations_list_cell.rb
decidim-core-0.25.2 app/cells/decidim/user_group_pending_invitations_list_cell.rb
decidim-core-0.25.1 app/cells/decidim/user_group_pending_invitations_list_cell.rb
decidim-core-0.25.0 app/cells/decidim/user_group_pending_invitations_list_cell.rb
decidim-core-0.25.0.rc4 app/cells/decidim/user_group_pending_invitations_list_cell.rb
decidim-core-0.25.0.rc3 app/cells/decidim/user_group_pending_invitations_list_cell.rb
decidim-core-0.25.0.rc2 app/cells/decidim/user_group_pending_invitations_list_cell.rb
decidim-core-0.25.0.rc1 app/cells/decidim/user_group_pending_invitations_list_cell.rb
decidim-core-0.24.3 app/cells/decidim/user_group_pending_invitations_list_cell.rb
decidim-core-0.23.6 app/cells/decidim/user_group_pending_invitations_list_cell.rb