Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
b3563f96e597
Commit
b3563f96
authored
Nov 06, 2011
by
Dmitriy Zaporozhets
Browse files
Improved commit author detection
parent
61a311496b9b
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/models/project.rb
View file @
b3563f96
...
...
@@ -50,6 +50,11 @@
code
end
def
team_member_by_name_or_email
(
email
=
nil
,
name
=
nil
)
user
=
users
.
where
(
"email like ? or name like ?"
,
email
,
name
).
first
users_projects
.
find_by_user_id
(
user
.
id
)
if
user
end
def
common_notes
notes
.
where
(
:noteable_type
=>
[
""
,
nil
])
end
...
...
app/views/projects/_tree_item.html.haml
View file @
b3563f96
...
...
@@ -13,6 +13,6 @@
ago
%td
.commit
=
link_to
truncate
(
content_commit
.
safe_message
,
:length
=>
fixed_mode?
?
40
:
80
),
project_commit_path
(
@project
,
content_commit
),
:class
=>
"tree-commit-link"
-
user
=
@project
.
users
.
find_by
_email
(
content_commit
.
author_email
)
-
if
user
=
link_to
"[
#{
user
.
name
}
]"
,
project_team_member_path
(
@project
,
@project
.
users_projects
.
find_by_user_id
(
user
.
id
)
)
-
tm
=
@project
.
team_member_by_name_or
_email
(
content_commit
.
author_email
,
content_commit
.
author_name
)
-
if
tm
=
link_to
"[
#{
tm
.
user
_
name
}
]"
,
project_team_member_path
(
@project
,
tm
)
Write
Preview
Supports
Markdown
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