From 3c6e144608b655ff1b43ec33baf020d19d460ba8 Mon Sep 17 00:00:00 2001 From: Andrey Kumanyaev Date: Sat, 19 Jan 2013 21:48:46 +0400 Subject: [PATCH] add dashboard teams block --- app/controllers/dashboard_controller.rb | 2 ++ app/views/dashboard/_sidebar.html.haml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index c0ec4708..13229734 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 9830cdf4..7c6daf6e 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