Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-01-30 04:07:44 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-01-30 04:07:44 +0300
commitf1cf49218fb40b61f82ff74dbb7eaba32b439a5a (patch)
treede03aa30e4164bc51507f2583157f7a79e353ca9 /app/controllers/users_controller.rb
parenta3c2873f50f42016619f8ffc959cf9e20b5f340d (diff)
Improve contribution calendar on user page
* cache user contributions for day * ignore forks in calendar contribtuions
Diffstat (limited to 'app/controllers/users_controller.rb')
-rw-r--r--app/controllers/users_controller.rb9
1 files changed, 3 insertions, 6 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index ff5e31067fb..57d8ef09faf 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -28,13 +28,10 @@ class UsersController < ApplicationController
def calendar
visible_projects = ProjectsFinder.new.execute(current_user)
-
- # Get user repositories and collect timestamps for commits
- user_repositories = visible_projects.map(&:repository)
- calendar = Gitlab::CommitsCalendar.new(user_repositories, @user)
+ calendar = Gitlab::CommitsCalendar.new(visible_projects, @user)
@timestamps = calendar.timestamps
- @starting_year = (Time.now - 1.year).strftime("%Y")
- @starting_month = Date.today.strftime("%m").to_i
+ @starting_year = calendar.starting_year
+ @starting_month = calendar.starting_month
render 'calendar', layout: false
end