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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
209f96be
Commit
209f96be
authored
Jun 17, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use project.team over project.users
parent
e940fbc7
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
23 deletions
+22
-23
app/controllers/issues_controller.rb
app/controllers/issues_controller.rb
+1
-1
app/models/group.rb
app/models/group.rb
+0
-6
app/models/project_team.rb
app/models/project_team.rb
+5
-0
app/views/groups/people.html.haml
app/views/groups/people.html.haml
+1
-13
app/views/issues/_form.html.haml
app/views/issues/_form.html.haml
+1
-1
app/views/issues/_issues.html.haml
app/views/issues/_issues.html.haml
+2
-2
app/views/users_groups/_users_group.html.haml
app/views/users_groups/_users_group.html.haml
+12
-0
No files found.
app/controllers/issues_controller.rb
View file @
209f96be
...
@@ -23,7 +23,7 @@ class IssuesController < ProjectResourceController
...
@@ -23,7 +23,7 @@ class IssuesController < ProjectResourceController
assignee_id
,
milestone_id
=
params
[
:assignee_id
],
params
[
:milestone_id
]
assignee_id
,
milestone_id
=
params
[
:assignee_id
],
params
[
:milestone_id
]
@assignee
=
@project
.
users
.
find
(
assignee_id
)
if
assignee_id
.
present?
&&
!
assignee_id
.
to_i
.
zero?
@assignee
=
@project
.
team
.
find
(
assignee_id
)
if
assignee_id
.
present?
&&
!
assignee_id
.
to_i
.
zero?
@milestone
=
@project
.
milestones
.
find
(
milestone_id
)
if
milestone_id
.
present?
&&
!
milestone_id
.
to_i
.
zero?
@milestone
=
@project
.
milestones
.
find
(
milestone_id
)
if
milestone_id
.
present?
&&
!
milestone_id
.
to_i
.
zero?
respond_to
do
|
format
|
respond_to
do
|
format
|
...
...
app/models/group.rb
View file @
209f96be
...
@@ -30,12 +30,6 @@ class Group < Namespace
...
@@ -30,12 +30,6 @@ class Group < Namespace
)
)
end
end
def
users
users
=
User
.
joins
(
:users_projects
).
where
(
users_projects:
{
project_id:
project_ids
})
users
=
users
<<
owner
users
.
uniq
end
def
human_name
def
human_name
name
name
end
end
...
...
app/models/project_team.rb
View file @
209f96be
...
@@ -21,6 +21,11 @@ class ProjectTeam
...
@@ -21,6 +21,11 @@ class ProjectTeam
end
end
end
end
def
find
user_id
user
=
project
.
users
.
find_by_id
(
user_id
)
user
||=
project
.
group
.
users
.
find_by_id
(
user_id
)
end
def
get_tm
user_id
def
get_tm
user_id
project
.
users_projects
.
find_by_user_id
(
user_id
)
project
.
users_projects
.
find_by_user_id
(
user_id
)
end
end
...
...
app/views/groups/people.html.haml
View file @
209f96be
...
@@ -16,16 +16,4 @@
...
@@ -16,16 +16,4 @@
(
#{
@members
.
count
}
)
(
#{
@members
.
count
}
)
%ul
.well-list
%ul
.well-list
-
@members
.
each
do
|
member
|
-
@members
.
each
do
|
member
|
-
user
=
member
.
user
=
render
'users_groups/users_group'
,
member:
member
-
next
unless
user
%li
=
image_tag
gravatar_icon
(
user
.
email
,
16
),
class:
"avatar s16"
%strong
=
user
.
name
%span
.cgray
=
user
.
username
%span
.pull-right
-
if
@group
.
owners
.
include?
(
user
)
%span
.label.label-info
Group Owner
-
else
=
member
.
human_access
app/views/issues/_form.html.haml
View file @
209f96be
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
Assign to
Assign to
.input
.input
.pull-left
.pull-left
=
f
.
select
(
:assignee_id
,
@project
.
users
.
alphabetically
.
collect
{
|
p
|
[
p
.
name
,
p
.
id
]
},
{
include_blank:
"Select a user"
},
{
class:
'chosen'
})
=
f
.
select
(
:assignee_id
,
@project
.
team
.
members
.
sort_by
(
&
:name
).
map
{
|
p
|
[
p
.
name
,
p
.
id
]
},
{
include_blank:
"Select a user"
},
{
class:
'chosen'
})
.pull-right
.pull-right
=
link_to
'Assign to me'
,
'#'
,
class:
'btn btn-small assign-to-me-link'
=
link_to
'Assign to me'
,
'#'
,
class:
'btn btn-small assign-to-me-link'
...
...
app/views/issues/_issues.html.haml
View file @
209f96be
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
%span
.update_issues_text
Update selected issues with
%span
.update_issues_text
Update selected issues with
.left
.left
=
select_tag
(
'update[status]'
,
options_for_select
([
'open'
,
'closed'
]),
prompt:
"Status"
)
=
select_tag
(
'update[status]'
,
options_for_select
([
'open'
,
'closed'
]),
prompt:
"Status"
)
=
select_tag
(
'update[assignee_id]'
,
options_from_collection_for_select
(
@project
.
users
.
all
,
"id"
,
"name"
,
params
[
:assignee_id
]),
prompt:
"Assignee"
)
=
select_tag
(
'update[assignee_id]'
,
options_from_collection_for_select
(
@project
.
team
.
members
,
"id"
,
"name"
,
params
[
:assignee_id
]),
prompt:
"Assignee"
)
=
select_tag
(
'update[milestone_id]'
,
options_from_collection_for_select
(
issues_active_milestones
,
"id"
,
"title"
,
params
[
:milestone_id
]),
prompt:
"Milestone"
)
=
select_tag
(
'update[milestone_id]'
,
options_from_collection_for_select
(
issues_active_milestones
,
"id"
,
"title"
,
params
[
:milestone_id
]),
prompt:
"Milestone"
)
=
hidden_field_tag
'update[issues_ids]'
,
[]
=
hidden_field_tag
'update[issues_ids]'
,
[]
=
hidden_field_tag
:status
,
params
[
:status
]
=
hidden_field_tag
:status
,
params
[
:status
]
...
@@ -50,7 +50,7 @@
...
@@ -50,7 +50,7 @@
Any
Any
=
link_to
project_issues_with_filter_path
(
@project
,
assignee_id:
0
)
do
=
link_to
project_issues_with_filter_path
(
@project
,
assignee_id:
0
)
do
Unassigned
Unassigned
-
@project
.
us
ers
.
sort_by
(
&
:name
).
each
do
|
user
|
-
@project
.
team
.
memb
ers
.
sort_by
(
&
:name
).
each
do
|
user
|
%li
%li
=
link_to
project_issues_with_filter_path
(
@project
,
assignee_id:
user
.
id
)
do
=
link_to
project_issues_with_filter_path
(
@project
,
assignee_id:
user
.
id
)
do
=
image_tag
gravatar_icon
(
user
.
email
),
class:
"avatar s16"
=
image_tag
gravatar_icon
(
user
.
email
),
class:
"avatar s16"
...
...
app/views/users_groups/_users_group.html.haml
0 → 100644
View file @
209f96be
-
user
=
member
.
user
-
return
unless
user
%li
=
image_tag
gravatar_icon
(
user
.
email
,
16
),
class:
"avatar s16"
%strong
=
user
.
name
%span
.cgray
=
user
.
username
%span
.pull-right
-
if
@group
.
owners
.
include?
(
user
)
%span
.label.label-info
Group Owner
-
else
=
member
.
human_access
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