Class: Decidim::ProfilesController

Inherits:
ApplicationController show all
Includes:
Flaggable, HasProfileBreadcrumb, UserGroups
Defined in:
app/controllers/decidim/profiles_controller.rb

Overview

The controller to handle the user’s public profile page.

i18n-tasks-use t(‘decidim.profiles.show.badges’) i18n-tasks-use t(‘decidim.profiles.show.groups’) i18n-tasks-use t(‘decidim.profiles.show.group_admins’) i18n-tasks-use t(‘decidim.profiles.show.group_members’)

Instance Method Summary collapse

Methods included from UserGroups

#enforce_user_groups_enabled

Methods included from UserBlockedChecker

#check_user_block_status, #check_user_not_blocked

Methods included from NeedsSnippets

#snippets

Methods included from Headers::HttpCachingDisabler

#disable_http_caching

Methods included from HasStoredPath

#skip_store_location?, #store_current_location

Methods included from TranslatableAttributes

#default_locale?

Methods included from RegistersPermissions

register_permissions

Methods included from NeedsOrganization

enhance_controller, extended, included

Instance Method Details

#activityObject



88
89
90
91
92
# File 'app/controllers/decidim/profiles_controller.rb', line 88

def activity
  @content_cell = "decidim/user_activity"
  @title_key = "activity"
  render :show
end

#badgesObject



42
43
44
45
46
# File 'app/controllers/decidim/profiles_controller.rb', line 42

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

#followersObject



36
37
38
39
40
# File 'app/controllers/decidim/profiles_controller.rb', line 36

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

#followingObject



30
31
32
33
34
# File 'app/controllers/decidim/profiles_controller.rb', line 30

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

#group_adminsObject



64
65
66
67
68
69
70
# File 'app/controllers/decidim/profiles_controller.rb', line 64

def group_admins
  enforce_permission_to :manage, :user_group, user_group: profile_holder

  @content_cell = "decidim/group_admins"
  @title_key = "group_admins"
  render :show
end

#group_invitesObject



80
81
82
83
84
85
86
# File 'app/controllers/decidim/profiles_controller.rb', line 80

def group_invites
  enforce_permission_to :manage, :user_group, user_group: profile_holder

  @content_cell = "decidim/group_invites"
  @title_key = "group_invites"
  render :show
end

#group_membersObject



72
73
74
75
76
77
78
# File 'app/controllers/decidim/profiles_controller.rb', line 72

def group_members
  enforce_permission_to :manage, :user_group, user_group: profile_holder

  @content_cell = "decidim/group_members"
  @title_key = "group_members"
  render :show
end

#groupsObject



48
49
50
51
52
53
54
# File 'app/controllers/decidim/profiles_controller.rb', line 48

def groups
  enforce_user_groups_enabled

  @content_cell = "decidim/groups"
  @title_key = "groups"
  render :show
end

#membersObject



56
57
58
59
60
61
62
# File 'app/controllers/decidim/profiles_controller.rb', line 56

def members
  enforce_user_groups_enabled

  @content_cell = "decidim/members"
  @title_key = "members"
  render :show
end

#showObject



24
25
26
27
28
# File 'app/controllers/decidim/profiles_controller.rb', line 24

def show
  return redirect_to profile_members_path if profile_holder.is_a?(Decidim::UserGroup)

  redirect_to profile_activity_path(nickname: params[:nickname])
end