summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Kumanyaev <me@zzet.org>2013-01-19 21:48:46 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-01-24 22:31:24 +0200
commit3c6e144608b655ff1b43ec33baf020d19d460ba8 (patch)
tree16585b503eb6c6b89cb35c34687bf6f1cdbc3275
parenta96cf3ad09c06fb5bfe668a77edc5d7adb2d092f (diff)
downloadgitlab-ce-3c6e144608b655ff1b43ec33baf020d19d460ba8.tar.gz
add dashboard teams block
-rw-r--r--app/controllers/dashboard_controller.rb2
-rw-r--r--app/views/dashboard/_sidebar.html.haml2
2 files changed, 4 insertions, 0 deletions
diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb
index c0ec4708e0a..1322973489c 100644
--- a/app/controllers/dashboard_controller.rb
+++ b/app/controllers/dashboard_controller.rb
@@ -18,6 +18,8 @@ class DashboardController < ApplicationController
@projects
end
+ @teams = (UserTeam.with_member(current_user) + UserTeam.created_by(current_user)).uniq
+
@projects = @projects.page(params[:page]).per(30)
@events = Event.in_projects(current_user.authorized_projects.pluck(:id))
diff --git a/app/views/dashboard/_sidebar.html.haml b/app/views/dashboard/_sidebar.html.haml
index 9830cdf4f6b..7c6daf6ec31 100644
--- a/app/views/dashboard/_sidebar.html.haml
+++ b/app/views/dashboard/_sidebar.html.haml
@@ -1,3 +1,5 @@
+- if @teams.present?
+ = render "teams", teams: @teams
- if @groups.present?
= render "groups", groups: @groups
= render "projects", projects: @projects