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
4dd5d9c8
Commit
4dd5d9c8
authored
Nov 12, 2011
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #185 – Show branch name for commits on activities & dashboard pages
parent
c1c64d98
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
25 additions
and
7 deletions
+25
-7
app/assets/stylesheets/projects.css.scss
app/assets/stylesheets/projects.css.scss
+8
-0
app/models/repository.rb
app/models/repository.rb
+2
-2
app/views/dashboard/index.html.haml
app/views/dashboard/index.html.haml
+2
-0
app/views/layouts/project.html.haml
app/views/layouts/project.html.haml
+1
-1
app/views/projects/_recent_commits.html.haml
app/views/projects/_recent_commits.html.haml
+3
-1
lib/commit_ext.rb
lib/commit_ext.rb
+2
-0
spec/requests/dashboard_spec.rb
spec/requests/dashboard_spec.rb
+1
-0
spec/requests/projects_spec.rb
spec/requests/projects_spec.rb
+6
-3
No files found.
app/assets/stylesheets/projects.css.scss
View file @
4dd5d9c8
...
@@ -344,4 +344,12 @@ body.project-page table .commit {
...
@@ -344,4 +344,12 @@ body.project-page table .commit {
background
:
#2c5c66
;
background
:
#2c5c66
;
color
:white
;
color
:white
;
}
}
&
.issue
{
background
:
#D12F19
;
color
:white
;
}
&
.commit
{
background
:
#2c5c66
;
color
:white
;
}
}
}
app/models/repository.rb
View file @
4dd5d9c8
...
@@ -73,7 +73,7 @@ class Repository
...
@@ -73,7 +73,7 @@ class Repository
def
fresh_commits
(
n
=
10
)
def
fresh_commits
(
n
=
10
)
commits
=
heads
.
map
do
|
h
|
commits
=
heads
.
map
do
|
h
|
repo
.
commits
(
h
.
name
,
n
)
repo
.
commits
(
h
.
name
,
n
)
.
each
{
|
c
|
c
.
head
=
h
}
end
.
flatten
.
uniq
{
|
c
|
c
.
id
}
end
.
flatten
.
uniq
{
|
c
|
c
.
id
}
commits
.
sort!
do
|
x
,
y
|
commits
.
sort!
do
|
x
,
y
|
...
@@ -85,7 +85,7 @@ class Repository
...
@@ -85,7 +85,7 @@ class Repository
def
commits_since
(
date
)
def
commits_since
(
date
)
commits
=
heads
.
map
do
|
h
|
commits
=
heads
.
map
do
|
h
|
repo
.
log
(
h
.
name
,
nil
,
:since
=>
date
)
repo
.
log
(
h
.
name
,
nil
,
:since
=>
date
)
.
each
{
|
c
|
c
.
head
=
h
}
end
.
flatten
.
uniq
{
|
c
|
c
.
id
}
end
.
flatten
.
uniq
{
|
c
|
c
.
id
}
commits
.
sort!
do
|
x
,
y
|
commits
.
sort!
do
|
x
,
y
|
...
...
app/views/dashboard/index.html.haml
View file @
4dd5d9c8
...
@@ -27,6 +27,8 @@
...
@@ -27,6 +27,8 @@
%a
.project-update
{
:href
=>
dashboard_feed_path
(
project
,
update
)}
%a
.project-update
{
:href
=>
dashboard_feed_path
(
project
,
update
)}
=
image_tag
gravatar_icon
(
update
.
author_email
),
:class
=>
"left"
,
:width
=>
40
=
image_tag
gravatar_icon
(
update
.
author_email
),
:class
=>
"left"
,
:width
=>
40
%span
.update-title
%span
.update-title
-
if
update
.
kind_of?
(
Grit
::
Commit
)
%span
.tag.commit
=
update
.
head
.
name
=
dashboard_feed_title
(
update
)
=
dashboard_feed_title
(
update
)
%span
.update-author
%span
.update-author
%strong
=
update
.
author_name
%strong
=
update
.
author_name
...
...
app/views/layouts/project.html.haml
View file @
4dd5d9c8
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
.git_url_wrapper
.git_url_wrapper
%input
.git-url.text
{
:id
=>
""
,
:name
=>
""
,
:readonly
=>
""
,
:type
=>
"text"
,
:value
=>
@project
.
url_to_repo
,
:class
=>
"one_click_select"
}
%input
.git-url.text
{
:id
=>
""
,
:name
=>
""
,
:readonly
=>
""
,
:type
=>
"text"
,
:value
=>
@project
.
url_to_repo
,
:class
=>
"one_click_select"
}
%aside
%aside
=
link_to
"
History
"
,
project_path
(
@project
),
:class
=>
current_page?
(
:controller
=>
"projects"
,
:action
=>
"show"
,
:id
=>
@project
)
?
"current"
:
nil
=
link_to
"
Activities
"
,
project_path
(
@project
),
:class
=>
current_page?
(
:controller
=>
"projects"
,
:action
=>
"show"
,
:id
=>
@project
)
?
"current"
:
nil
=
link_to
"Tree"
,
tree_project_path
(
@project
),
:class
=>
current_page?
(
:controller
=>
"projects"
,
:action
=>
"tree"
,
:id
=>
@project
)
?
"current"
:
nil
=
link_to
"Tree"
,
tree_project_path
(
@project
),
:class
=>
current_page?
(
:controller
=>
"projects"
,
:action
=>
"tree"
,
:id
=>
@project
)
?
"current"
:
nil
=
link_to
"Commits"
,
project_commits_path
(
@project
),
:class
=>
current_page?
(
:controller
=>
"commits"
,
:action
=>
"index"
,
:project_id
=>
@project
)
?
"current"
:
nil
=
link_to
"Commits"
,
project_commits_path
(
@project
),
:class
=>
current_page?
(
:controller
=>
"commits"
,
:action
=>
"index"
,
:project_id
=>
@project
)
?
"current"
:
nil
=
link_to
team_project_path
(
@project
),
:class
=>
(
current_page?
(
:controller
=>
"projects"
,
:action
=>
"team"
,
:id
=>
@project
)
||
controller
.
controller_name
==
"team_members"
)
?
"current"
:
nil
do
=
link_to
team_project_path
(
@project
),
:class
=>
(
current_page?
(
:controller
=>
"projects"
,
:action
=>
"team"
,
:id
=>
@project
)
||
controller
.
controller_name
==
"team_members"
)
?
"current"
:
nil
do
...
...
app/views/projects/_recent_commits.html.haml
View file @
4dd5d9c8
...
@@ -22,7 +22,9 @@
...
@@ -22,7 +22,9 @@
-
else
-
else
=
image_tag
"no_avatar.png"
,
:class
=>
"left"
,
:width
=>
40
,
:style
=>
"padding-right:5px;"
=
image_tag
"no_avatar.png"
,
:class
=>
"left"
,
:width
=>
40
,
:style
=>
"padding-right:5px;"
.title
.title
%p
=
link_to
truncate
(
commit
.
safe_message
,
:length
=>
40
),
project_commit_path
(
@project
,
:id
=>
commit
.
id
)
%p
%span
.tag.commit
=
commit
.
head
.
name
=
link_to
truncate
(
commit
.
safe_message
,
:length
=>
40
),
project_commit_path
(
@project
,
:id
=>
commit
.
id
)
%span
%span
%span
.author
%span
.author
...
...
lib/commit_ext.rb
View file @
4dd5d9c8
module
CommitExt
module
CommitExt
attr_accessor
:head
def
safe_message
def
safe_message
message
.
encode
(
"UTF-8"
,
message
.
encode
(
"UTF-8"
,
:invalid
=>
:replace
,
:invalid
=>
:replace
,
...
...
spec/requests/dashboard_spec.rb
View file @
4dd5d9c8
...
@@ -22,6 +22,7 @@ describe "Dashboard" do
...
@@ -22,6 +22,7 @@ describe "Dashboard" do
it
"should have news feed"
do
it
"should have news feed"
do
within
"#news-feed"
do
within
"#news-feed"
do
page
.
should
have_content
(
"master"
)
page
.
should
have_content
(
@project
.
commit
.
author
.
name
)
page
.
should
have_content
(
@project
.
commit
.
author
.
name
)
page
.
should
have_content
(
@project
.
commit
.
safe_message
)
page
.
should
have_content
(
@project
.
commit
.
safe_message
)
end
end
...
...
spec/requests/projects_spec.rb
View file @
4dd5d9c8
...
@@ -72,10 +72,13 @@ describe "Projects" do
...
@@ -72,10 +72,13 @@ describe "Projects" do
current_path
.
should
==
project_path
(
@project
)
current_path
.
should
==
project_path
(
@project
)
end
end
it
"should beahave like dashboard"
do
it
"should beahave like activities page"
do
page
.
should
have_content
(
"History"
)
within
".commit"
do
page
.
should
have_content
(
"master"
)
page
.
should
have_content
(
@project
.
commit
.
author
.
name
)
page
.
should
have_content
(
@project
.
commit
.
safe_message
)
end
end
end
end
end
describe
"GET /projects/team"
do
describe
"GET /projects/team"
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