Class: UsersController

Inherits:
ApplicationController show all
Defined in:
app/controllers/users_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#redirect_back_or_default

Methods included from PageLayoutHelper

#blank_container, #container_class, #fluid_layout, #header_title, #nav, #page_card_attributes, #page_card_meta_tags, #page_description, #page_image, #page_title, #sidebar

Methods included from GitlabRoutingHelper

#activity_project_path, #edit_project_path, #edit_project_url, #issue_path, #issue_url, #merge_request_path, #merge_request_url, #milestone_path, #project_builds_path, #project_commits_path, #project_files_path, #project_path, #project_pipelines_path, #project_snippet_url, #project_url, #runner_path, #runners_path, #toggle_subscription_path

Methods included from Gitlab::GonHelper

#add_gon_variables

Methods included from Gitlab::CurrentSettings

#current_application_settings, #fake_application_settings

Instance Method Details

#calendarObject


61
62
63
64
65
66
67
68
# File 'app/controllers/users_controller.rb', line 61

def calendar
  calendar = contributions_calendar
  @timestamps = calendar.timestamps
  @starting_year = calendar.starting_year
  @starting_month = calendar.starting_month

  render 'calendar', layout: false
end

#calendar_activitiesObject


70
71
72
73
74
75
# File 'app/controllers/users_controller.rb', line 70

def calendar_activities
  @calendar_date = Date.parse(params[:date]) rescue Date.today
  @events = contributions_calendar.events_by_date(@calendar_date)

  render 'calendar_activities', layout: false
end

#contributedObject


48
49
50
51
52
53
54
55
56
57
58
59
# File 'app/controllers/users_controller.rb', line 48

def contributed
  load_contributed_projects

  respond_to do |format|
    format.html { render 'show' }
    format.json do
      render json: {
        html: view_to_html_string("shared/projects/_list", projects: @contributed_projects)
      }
    end
  end
end

#groupsObject


22
23
24
25
26
27
28
29
30
31
32
33
# File 'app/controllers/users_controller.rb', line 22

def groups
  load_groups

  respond_to do |format|
    format.html { render 'show' }
    format.json do
      render json: {
        html: view_to_html_string("shared/groups/_list", groups: @groups)
      }
    end
  end
end

#projectsObject


35
36
37
38
39
40
41
42
43
44
45
46
# File 'app/controllers/users_controller.rb', line 35

def projects
  load_projects

  respond_to do |format|
    format.html { render 'show' }
    format.json do
      render json: {
        html: view_to_html_string("shared/projects/_list", projects: @projects, remote: true)
      }
    end
  end
end

#showObject


6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/controllers/users_controller.rb', line 6

def show
  respond_to do |format|
    format.html

    format.atom do
      load_events
      render layout: false
    end

    format.json do
      load_events
      pager_json("events/_events", @events.count)
    end
  end
end