Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
gitlab-ce
Commits
ca752e64
Commit
ca752e64
authored
Jan 24, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix mispelling and ambiguous id in UserTeam.without_project
parent
ca105d04
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
6 additions
and
13 deletions
+6
-13
app/controllers/projects/teams_controller.rb
app/controllers/projects/teams_controller.rb
+1
-1
app/models/user_team.rb
app/models/user_team.rb
+1
-1
app/views/dashboard/_teams.html.haml
app/views/dashboard/_teams.html.haml
+1
-5
app/views/layouts/_head_panel.html.haml
app/views/layouts/_head_panel.html.haml
+0
-3
app/views/projects/teams/available.html.haml
app/views/projects/teams/available.html.haml
+0
-0
app/views/team_members/index.html.haml
app/views/team_members/index.html.haml
+1
-1
app/views/teams/new.html.haml
app/views/teams/new.html.haml
+1
-1
config/routes.rb
config/routes.rb
+1
-1
No files found.
app/controllers/projects/teams_controller.rb
View file @
ca752e64
class
Projects::TeamsController
<
Projects
::
ApplicationController
class
Projects::TeamsController
<
Projects
::
ApplicationController
def
ava
li
able
def
ava
il
able
@teams
=
current_user
.
is_admin?
?
UserTeam
.
scoped
:
current_user
.
user_teams
@teams
=
current_user
.
is_admin?
?
UserTeam
.
scoped
:
current_user
.
user_teams
@teams
=
@teams
.
without_project
(
project
)
@teams
=
@teams
.
without_project
(
project
)
unless
@teams
.
any?
unless
@teams
.
any?
...
...
app/models/user_team.rb
View file @
ca752e64
...
@@ -17,7 +17,7 @@ class UserTeam < ActiveRecord::Base
...
@@ -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_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
: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
)
}
scope
:created_by
,
->
(
user
){
where
(
owner_id:
user
)
}
class
<<
self
class
<<
self
...
...
app/views/dashboard/_teams.html.haml
View file @
ca752e64
.teams_box
.teams_box
%h5
.title
%h5
.title
My
Teams
Teams
%small
%small
(
#{
@teams
.
count
}
)
(
#{
@teams
.
count
}
)
%span
.right
%span
.right
=
link_to
new_team_path
,
class:
"btn very_small info"
do
=
link_to
new_team_path
,
class:
"btn very_small info"
do
%i
.icon-plus
%i
.icon-plus
New Team
New Team
%span
.right
=
link_to
teams_path
,
class:
"btn very_small info"
do
%i
.icon-user
All Teams
%ul
.well-list
%ul
.well-list
-
@teams
.
each
do
|
team
|
-
@teams
.
each
do
|
team
|
%li
%li
...
...
app/views/layouts/_head_panel.html.haml
View file @
ca752e64
...
@@ -8,9 +8,6 @@
...
@@ -8,9 +8,6 @@
%span
.separator
%span
.separator
%h1
.project_name
=
title
%h1
.project_name
=
title
%ul
.nav
%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?
-
if
current_user
.
is_admin?
%li
%li
=
link_to
admin_root_path
,
title:
"Admin area"
,
class:
'has_bottom_tooltip'
,
'data-original-title'
=>
'Admin area'
do
=
link_to
admin_root_path
,
title:
"Admin area"
,
class:
'has_bottom_tooltip'
,
'data-original-title'
=>
'Admin area'
do
...
...
app/views/projects/teams/ava
li
able.html.haml
→
app/views/projects/teams/ava
il
able.html.haml
View file @
ca752e64
File moved
app/views/team_members/index.html.haml
View file @
ca752e64
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
%span
.right
%span
.right
=
link_to
import_project_team_members_path
(
@project
),
class:
"btn small grouped"
,
title:
"Import team from another project"
do
=
link_to
import_project_team_members_path
(
@project
),
class:
"btn small grouped"
,
title:
"Import team from another project"
do
Import team from another project
Import team from another project
=
link_to
ava
li
able_project_teams_path
(
@project
),
class:
"btn small grouped"
,
title:
"Assign project to team of users"
do
=
link_to
ava
il
able_project_teams_path
(
@project
),
class:
"btn small grouped"
,
title:
"Assign project to team of users"
do
Assign project to Team of users
Assign project to Team of users
=
link_to
new_project_team_member_path
(
@project
),
class:
"btn success small grouped"
,
title:
"New Team Member"
do
=
link_to
new_project_team_member_path
(
@project
),
class:
"btn success small grouped"
,
title:
"New Team Member"
do
New Team Member
New Team Member
...
...
app/views/teams/new.html.haml
View file @
ca752e64
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
=
f
.
label
:name
do
=
f
.
label
:name
do
Team name is
Team name is
.input
.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"
=
f
.
submit
'Create team'
,
class:
"btn primary"
%hr
%hr
...
...
config/routes.rb
View file @
ca752e64
...
@@ -272,7 +272,7 @@ Gitlab::Application.routes.draw do
...
@@ -272,7 +272,7 @@ Gitlab::Application.routes.draw do
scope
module: :projects
do
scope
module: :projects
do
resources
:teams
,
only:
[]
do
resources
:teams
,
only:
[]
do
collection
do
collection
do
get
:ava
li
able
get
:ava
il
able
post
:assign
post
:assign
end
end
member
do
member
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment