diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-24 13:19:09 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-25 00:31:49 +0400 |
commit | ca752e64fbf1cd03ff3eff1ada80a1cfbcd9b2b4 (patch) | |
tree | ae92b5d4a5792eb9f7535c38109b1903a1fce0fc | |
parent | ca105d0462090b1650019890feeeef3fdd356209 (diff) |
Fix mispelling and ambiguous id in UserTeam.without_project
-rw-r--r-- | app/controllers/projects/teams_controller.rb | 2 | ||||
-rw-r--r-- | app/models/user_team.rb | 2 | ||||
-rw-r--r-- | app/views/dashboard/_teams.html.haml | 6 | ||||
-rw-r--r-- | app/views/layouts/_head_panel.html.haml | 3 | ||||
-rw-r--r-- | app/views/projects/teams/available.html.haml (renamed from app/views/projects/teams/avaliable.html.haml) | 0 | ||||
-rw-r--r-- | app/views/team_members/index.html.haml | 2 | ||||
-rw-r--r-- | app/views/teams/new.html.haml | 2 | ||||
-rw-r--r-- | config/routes.rb | 2 |
8 files changed, 6 insertions, 13 deletions
diff --git a/app/controllers/projects/teams_controller.rb b/app/controllers/projects/teams_controller.rb index c04835ed153..3ca724aaf4d 100644 --- a/app/controllers/projects/teams_controller.rb +++ b/app/controllers/projects/teams_controller.rb @@ -1,6 +1,6 @@ class Projects::TeamsController < Projects::ApplicationController - def avaliable + def available @teams = current_user.is_admin? ? UserTeam.scoped : current_user.user_teams @teams = @teams.without_project(project) unless @teams.any? diff --git a/app/models/user_team.rb b/app/models/user_team.rb index e3037bcd1aa..b28a6a041ac 100644 --- a/app/models/user_team.rb +++ b/app/models/user_team.rb @@ -17,7 +17,7 @@ class UserTeam < ActiveRecord::Base scope :with_member, ->(user){ joins(:user_team_user_relationships).where(user_team_user_relationships: {user_id: user.id}) } scope :with_project, ->(project){ joins(:user_team_project_relationships).where(user_team_project_relationships: {project_id: project})} - scope :without_project, ->(project){ where("id NOT IN (:ids)", ids: (a = with_project(project); a.blank? ? 0 : a))} + scope :without_project, ->(project){ where("user_teams.id NOT IN (:ids)", ids: (a = with_project(project); a.blank? ? 0 : a))} scope :created_by, ->(user){ where(owner_id: user) } class << self diff --git a/app/views/dashboard/_teams.html.haml b/app/views/dashboard/_teams.html.haml index 4250faac685..b047acf8d4a 100644 --- a/app/views/dashboard/_teams.html.haml +++ b/app/views/dashboard/_teams.html.haml @@ -1,16 +1,12 @@ .teams_box %h5.title - My Teams + Teams %small (#{@teams.count}) %span.right = link_to new_team_path, class: "btn very_small info" do %i.icon-plus New Team - %span.right - = link_to teams_path, class: "btn very_small info" do - %i.icon-user - All Teams %ul.well-list - @teams.each do |team| %li diff --git a/app/views/layouts/_head_panel.html.haml b/app/views/layouts/_head_panel.html.haml index de4117ae296..8f4f3d7815f 100644 --- a/app/views/layouts/_head_panel.html.haml +++ b/app/views/layouts/_head_panel.html.haml @@ -8,9 +8,6 @@ %span.separator %h1.project_name= title %ul.nav - %li - = link_to teams_path, title: "Teams of users", class: 'has_bottom_tooltip', 'data-original-title' => 'Teams list' do - %i.icon-group - if current_user.is_admin? %li = link_to admin_root_path, title: "Admin area", class: 'has_bottom_tooltip', 'data-original-title' => 'Admin area' do diff --git a/app/views/projects/teams/avaliable.html.haml b/app/views/projects/teams/available.html.haml index 814e216d6ad..814e216d6ad 100644 --- a/app/views/projects/teams/avaliable.html.haml +++ b/app/views/projects/teams/available.html.haml diff --git a/app/views/team_members/index.html.haml b/app/views/team_members/index.html.haml index f694ccbca93..6425302b83b 100644 --- a/app/views/team_members/index.html.haml +++ b/app/views/team_members/index.html.haml @@ -10,7 +10,7 @@ %span.right = link_to import_project_team_members_path(@project), class: "btn small grouped", title: "Import team from another project" do Import team from another project - = link_to avaliable_project_teams_path(@project), class: "btn small grouped", title: "Assign project to team of users" do + = link_to available_project_teams_path(@project), class: "btn small grouped", title: "Assign project to team of users" do Assign project to Team of users = link_to new_project_team_member_path(@project), class: "btn success small grouped", title: "New Team Member" do New Team Member diff --git a/app/views/teams/new.html.haml b/app/views/teams/new.html.haml index a068c51e6ab..12695f2b5ae 100644 --- a/app/views/teams/new.html.haml +++ b/app/views/teams/new.html.haml @@ -8,7 +8,7 @@ = f.label :name do Team name is .input - = f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left" + = f.text_field :name, placeholder: "Ex. Ruby Developers", class: "xxlarge left" = f.submit 'Create team', class: "btn primary" %hr diff --git a/config/routes.rb b/config/routes.rb index 387f94ba025..ba350a70bfa 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -272,7 +272,7 @@ Gitlab::Application.routes.draw do scope module: :projects do resources :teams, only: [] do collection do - get :avaliable + get :available post :assign end member do |