diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-01-29 11:53:43 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-01-29 11:53:43 +0300 |
commit | a9288e554e55e843b95ab6f8109a4c610af64c83 (patch) | |
tree | 4076cf59b8191e318b93b4a74985053d351c7469 /app/controllers/users_controller.rb | |
parent | 6e1f9e746cb5dc555003b5398c46113ce83fceae (diff) |
Cleanup and make contribution calendar faster
Diffstat (limited to 'app/controllers/users_controller.rb')
-rw-r--r-- | app/controllers/users_controller.rb | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 28de2707778..9e5ea6cfa45 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -25,12 +25,12 @@ class UsersController < ApplicationController @title = @user.name + # Get user repositories and collect timestamps for commits user_repositories = visible_projects.map(&:repository) - @timestamps = Gitlab::CommitsCalendar.create_timestamp(user_repositories, - @user, false) + calendar = Gitlab::CommitsCalendar.new(user_repositories, @user) + @timestamps = calendar.timestamps @starting_year = (Time.now - 1.year).strftime("%Y") @starting_month = Date.today.strftime("%m").to_i - @last_commit_date = Gitlab::CommitsCalendar.last_commit_date(@timestamps) respond_to do |format| format.html @@ -38,19 +38,6 @@ class UsersController < ApplicationController end end - def activities - user = User.find_by_username!(params[:username]) - # Projects user can view - visible_projects = ProjectsFinder.new.execute(current_user) - - user_repositories = visible_projects.map(&:repository) - user_activities = Gitlab::CommitsCalendar.create_timestamp(user_repositories, - user, true) - user_activities = Gitlab::CommitsCalendar.commit_activity_match( - user_activities, params[:date]) - render json: user_activities.to_json - end - def determine_layout if current_user 'navless' |