Commit 3c6e144608b655ff1b43ec33baf020d19d460ba8

Authored by Andrey Kumanyaev
Committed by Dmitriy Zaporozhets
1 parent a96cf3ad

add dashboard teams block

app/controllers/dashboard_controller.rb
@@ -18,6 +18,8 @@ class DashboardController < ApplicationController @@ -18,6 +18,8 @@ class DashboardController < ApplicationController
18 @projects 18 @projects
19 end 19 end
20 20
  21 + @teams = (UserTeam.with_member(current_user) + UserTeam.created_by(current_user)).uniq
  22 +
21 @projects = @projects.page(params[:page]).per(30) 23 @projects = @projects.page(params[:page]).per(30)
22 24
23 @events = Event.in_projects(current_user.authorized_projects.pluck(:id)) 25 @events = Event.in_projects(current_user.authorized_projects.pluck(:id))
app/views/dashboard/_sidebar.html.haml
  1 +- if @teams.present?
  2 + = render "teams", teams: @teams
1 - if @groups.present? 3 - if @groups.present?
2 = render "groups", groups: @groups 4 = render "groups", groups: @groups
3 = render "projects", projects: @projects 5 = render "projects", projects: @projects