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
Tatuya Kamada
gitlab-ce
Commits
a29db26c
Commit
a29db26c
authored
Feb 18, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor and restyle team page for project
parent
e9d8d074
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
59 additions
and
57 deletions
+59
-57
app/assets/stylesheets/sections/projects.scss
app/assets/stylesheets/sections/projects.scss
+4
-0
app/controllers/team_members_controller.rb
app/controllers/team_members_controller.rb
+3
-1
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+0
-8
app/models/user_team_project_relationship.rb
app/models/user_team_project_relationship.rb
+4
-0
app/views/team_members/_assigned_team.html.haml
app/views/team_members/_assigned_team.html.haml
+10
-0
app/views/team_members/_assigned_teams.html.haml
app/views/team_members/_assigned_teams.html.haml
+4
-0
app/views/team_members/_show_team.html.haml
app/views/team_members/_show_team.html.haml
+0
-15
app/views/team_members/_team.html.haml
app/views/team_members/_team.html.haml
+3
-3
app/views/team_members/_team_member.html.haml
app/views/team_members/_team_member.html.haml
+5
-5
app/views/team_members/_teams.html.haml
app/views/team_members/_teams.html.haml
+0
-16
app/views/team_members/index.html.haml
app/views/team_members/index.html.haml
+26
-9
No files found.
app/assets/stylesheets/sections/projects.scss
View file @
a29db26c
...
@@ -115,3 +115,7 @@ ul.nav.nav-projects-tabs {
...
@@ -115,3 +115,7 @@ ul.nav.nav-projects-tabs {
}
}
}
}
}
}
.team_member_row
form
{
margin
:
0px
;
}
app/controllers/team_members_controller.rb
View file @
a29db26c
...
@@ -4,7 +4,9 @@ class TeamMembersController < ProjectResourceController
...
@@ -4,7 +4,9 @@ class TeamMembersController < ProjectResourceController
before_filter
:authorize_admin_project!
,
except:
[
:index
,
:show
]
before_filter
:authorize_admin_project!
,
except:
[
:index
,
:show
]
def
index
def
index
@teams
=
UserTeam
.
scoped
@team
=
@project
.
users_projects
.
scoped
@team
=
@team
.
send
(
params
[
:type
])
if
%w(masters developers reporters guests)
.
include?
(
params
[
:type
])
@team
=
@team
.
sort_by
(
&
:project_access
).
reverse
.
group_by
(
&
:project_access
)
end
end
def
show
def
show
...
...
app/helpers/projects_helper.rb
View file @
a29db26c
module
ProjectsHelper
module
ProjectsHelper
def
grouper_project_members
(
project
)
@project
.
users_projects
.
sort_by
(
&
:project_access
).
reverse
.
group_by
(
&
:project_access
)
end
def
grouper_project_teams
(
project
)
@project
.
user_team_project_relationships
.
sort_by
(
&
:greatest_access
).
reverse
.
group_by
(
&
:greatest_access
)
end
def
remove_from_project_team_message
(
project
,
user
)
def
remove_from_project_team_message
(
project
,
user
)
"You are going to remove
#{
user
.
name
}
from
#{
project
.
name
}
project team. Are you sure?"
"You are going to remove
#{
user
.
name
}
from
#{
project
.
name
}
project team. Are you sure?"
end
end
...
...
app/models/user_team_project_relationship.rb
View file @
a29db26c
...
@@ -26,6 +26,10 @@ class UserTeamProjectRelationship < ActiveRecord::Base
...
@@ -26,6 +26,10 @@ class UserTeamProjectRelationship < ActiveRecord::Base
user_team
.
name
user_team
.
name
end
end
def
human_max_access
UserTeam
.
access_roles
.
key
(
greatest_access
)
end
private
private
def
check_greatest_access
def
check_greatest_access
...
...
app/views/team_members/_assigned_team.html.haml
0 → 100644
View file @
a29db26c
%li
{
id:
dom_id
(
team
),
class:
"user_team_row team_#{team.id}"
}
.pull-right
-
if
can?
(
current_user
,
:admin_team_member
,
@project
)
=
link_to
resign_project_team_path
(
@project
,
team
),
method: :delete
,
confirm:
"Are you shure?"
,
class:
"btn btn-remove btn-tiny"
do
%i
.icon-minus.icon-white
%strong
=
link_to
team
.
name
,
team_path
(
team
),
title:
team
.
name
,
class:
"dark"
%br
%small
.cgray
Members:
#{
team
.
members
.
count
}
%small
.cgray
Max access:
#{
team_relation
.
human_max_access
}
app/views/team_members/_assigned_teams.html.haml
0 → 100644
View file @
a29db26c
.ui-box
%ul
.well-list
-
@project
.
user_team_project_relationships
.
sort_by
(
&
:team_name
).
each
do
|
team_relation
|
=
render
"team_members/assigned_team"
,
team_relation:
team_relation
,
team:
team_relation
.
user_team
app/views/team_members/_show_team.html.haml
deleted
100644 → 0
View file @
e9d8d074
-
team
=
team_rel
.
user_team
-
allow_admin
=
can?
current_user
,
:admin_team_member
,
@project
%li
{
id:
dom_id
(
team
),
class:
"user_team_row team_#{team.id}"
}
.row
.span6
%strong
=
link_to
team
.
name
,
team_path
(
team
),
title:
team
.
name
,
class:
"dark"
%br
%small
.cgray
Members:
#{
team
.
members
.
count
}
.span5.pull-right
.pull-right
-
if
allow_admin
.left
=
link_to
resign_project_team_path
(
@project
,
team
),
method: :delete
,
confirm:
"Are you shure?"
,
class:
"btn btn-remove small"
do
%i
.icon-minus.icon-white
app/views/team_members/_team.html.haml
View file @
a29db26c
-
grouper_project_members
(
@project
)
.
each
do
|
access
,
members
|
-
@team
.
each
do
|
access
,
members
|
.ui-box
.ui-box
%h5
.title
%h5
.title
=
Project
.
access_options
.
key
(
access
).
pluralize
=
Project
.
access_options
.
key
(
access
).
pluralize
%small
=
members
.
size
%small
=
members
.
size
%ul
.well-list
%ul
.well-list
-
members
.
sort_by
(
&
:user_name
).
each
do
|
up
|
-
members
.
sort_by
(
&
:user_name
).
each
do
|
team_member
|
=
render
(
partial:
'team_members/show'
,
locals:
{
member:
up
})
=
render
'team_members/team_member'
,
member:
team_member
:javascript
:javascript
...
...
app/views/team_members/_
show
.html.haml
→
app/views/team_members/_
team_member
.html.haml
View file @
a29db26c
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
-
allow_admin
=
can?
current_user
,
:admin_project
,
@project
-
allow_admin
=
can?
current_user
,
:admin_project
,
@project
%li
{
id:
dom_id
(
user
),
class:
"team_member_row user_#{user.id}"
}
%li
{
id:
dom_id
(
user
),
class:
"team_member_row user_#{user.id}"
}
.row
.row
.span
6
.span
4
=
link_to
project_team_member_path
(
@project
,
user
),
title:
user
.
name
,
class:
"dark"
do
=
link_to
project_team_member_path
(
@project
,
user
),
title:
user
.
name
,
class:
"dark"
do
=
image_tag
gravatar_icon
(
user
.
email
,
40
),
class:
"avatar s32"
=
image_tag
gravatar_icon
(
user
.
email
,
40
),
class:
"avatar s32"
=
link_to
project_team_member_path
(
@project
,
user
),
title:
user
.
name
,
class:
"dark"
do
=
link_to
project_team_member_path
(
@project
,
user
),
title:
user
.
name
,
class:
"dark"
do
...
@@ -10,18 +10,18 @@
...
@@ -10,18 +10,18 @@
%br
%br
%small
.cgray
=
user
.
email
%small
.cgray
=
user
.
email
.span
5
.pull-right
.span
4
.pull-right
-
if
allow_admin
-
if
allow_admin
.left
.left
=
form_for
(
member
,
as: :team_member
,
url:
project_team_member_path
(
@project
,
member
.
user
))
do
|
f
|
=
form_for
(
member
,
as: :team_member
,
url:
project_team_member_path
(
@project
,
member
.
user
))
do
|
f
|
=
f
.
select
:project_access
,
options_for_select
(
UsersProject
.
access_roles
,
member
.
project_access
),
{},
class:
"medium project-access-select span2"
=
f
.
select
:project_access
,
options_for_select
(
UsersProject
.
access_roles
,
member
.
project_access
),
{},
class:
"medium project-access-select span2"
.pull-right
.pull-right
-
if
current_user
==
user
-
if
current_user
==
user
%span
.
btn.disabled
This is you!
%span
.
label
This is you!
-
if
@project
.
namespace_owner
==
user
-
if
@project
.
namespace_owner
==
user
%span
.
btn.disabled
Owner
%span
.
label
Owner
-
elsif
user
.
blocked
-
elsif
user
.
blocked
%span
.
btn.disabled.blocked
Blocked
%span
.
label
Blocked
-
elsif
allow_admin
-
elsif
allow_admin
=
link_to
project_team_member_path
(
@project
,
user
),
confirm:
remove_from_project_team_message
(
@project
,
user
),
method: :delete
,
class:
"btn-tiny btn btn-remove"
do
=
link_to
project_team_member_path
(
@project
,
user
),
confirm:
remove_from_project_team_message
(
@project
,
user
),
method: :delete
,
class:
"btn-tiny btn btn-remove"
do
%i
.icon-minus.icon-white
%i
.icon-minus.icon-white
...
...
app/views/team_members/_teams.html.haml
deleted
100644 → 0
View file @
e9d8d074
-
grouper_project_teams
(
@project
).
each
do
|
access
,
teams
|
.ui-box
%h5
.title
=
UserTeam
.
access_roles
.
key
(
access
).
pluralize
%small
=
teams
.
size
%ul
.well-list
-
teams
.
sort_by
(
&
:team_name
).
each
do
|
tofr
|
=
render
(
partial:
'team_members/show_team'
,
locals:
{
team_rel:
tofr
})
:javascript
$
(
function
(){
$
(
'
.repo-access-select, .project-access-select
'
).
live
(
"
change
"
,
function
()
{
$
(
this
.
form
).
submit
();
});
})
app/views/team_members/index.html.haml
View file @
a29db26c
...
@@ -18,16 +18,33 @@
...
@@ -18,16 +18,33 @@
%hr
%hr
.clearfix
.clearfix
%div
.team-table
.row
=
render
partial:
"team_members/team"
,
locals:
{
project:
@project
}
.span3
%ul
.nav.nav-pills.nav-stacked
%li
{
class:
(
"active"
if
!
params
[
:type
])}
=
link_to
project_team_members_path
(
type:
nil
)
do
All
%li
{
class:
(
"active"
if
params
[
:type
]
==
'masters'
)}
=
link_to
project_team_members_path
(
type:
'masters'
)
do
Masters
%li
{
class:
(
"active"
if
params
[
:type
]
==
'developers'
)}
=
link_to
project_team_members_path
(
type:
'developers'
)
do
Developers
%li
{
class:
(
"active"
if
params
[
:type
]
==
'reporters'
)}
=
link_to
project_team_members_path
(
type:
'reporters'
)
do
Reporters
%li
{
class:
(
"active"
if
params
[
:type
]
==
'guests'
)}
=
link_to
project_team_members_path
(
type:
'guests'
)
do
Guests
%h5
Assigned teams
(
#{
@project
.
user_teams
.
count
}
)
%div
=
render
"team_members/assigned_teams"
,
project:
@project
.span9
%div
.team-table
=
render
"team_members/team"
,
project:
@project
%h3
.page_title
Assigned teams
(
#{
@project
.
user_teams
.
count
}
)
%hr
.clearfix
%div
.team-table
=
render
partial:
"team_members/teams"
,
locals:
{
project:
@project
}
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