Sha256: 50962535f9daa3a6d82a087f0b5f4279bf7f53db1a4e97c9521113ab07873fd4

Contents?: true

Size: 792 Bytes

Versions: 3

Compression:

Stored size: 792 Bytes

Contents

# frozen_string_literal: true

module Decidim
  class ProfileCell < Decidim::ViewModel
    include Decidim::ApplicationHelper
    include Decidim::Core::Engine.routes.url_helpers
    include Decidim::UserProfileHelper
    include Decidim::AriaSelectedLinkToHelper
    include ActiveLinkTo

    delegate :current_organization, :current_user, to: :controller

    def show
      render :show
    end

    def profile_holder
      model
    end

    def content_cell
      context[:content_cell]
    end

    def active_content
      context[:active_content]
    end

    def own_profile?
      current_user && current_user == profile_holder
    end

    def profile_tabs
      return render :user_group_tabs if profile_holder.is_a?(Decidim::UserGroup)
      render :user_tabs
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
decidim-core-0.15.2 app/cells/decidim/profile_cell.rb
decidim-core-0.15.1 app/cells/decidim/profile_cell.rb
decidim-core-0.15.0 app/cells/decidim/profile_cell.rb