Sha256: 6c50a6b992bcd8e53ed3fa5651aa3af5831bf3b3cd6e92b41ca32084fe618185

Contents?: true

Size: 822 Bytes

Versions: 4

Compression:

Stored size: 822 Bytes

Contents

# frozen_string_literal: true

module Decidim
  # The controller to handle the user's public profile page.
  class ProfilesController < Decidim::ApplicationController
    helper Decidim::Messaging::ConversationHelper

    helper_method :user, :active_content

    def show
      return redirect_to notifications_path if current_user == user
      @content_cell = "decidim/following"
    end

    def following
      @content_cell = "decidim/following"
      render :show
    end

    def followers
      @content_cell = "decidim/followers"
      render :show
    end

    def badges
      @content_cell = "decidim/badges"
      render :show
    end

    private

    def user
      @user ||= Decidim::User.find_by!(
        nickname: params[:nickname],
        organization: current_organization
      )
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
decidim-core-0.14.4 app/controllers/decidim/profiles_controller.rb
decidim-core-0.14.3 app/controllers/decidim/profiles_controller.rb
decidim-core-0.14.2 app/controllers/decidim/profiles_controller.rb
decidim-core-0.14.1 app/controllers/decidim/profiles_controller.rb