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
Kazuhiko Shiozaki
gitlab-ce
Commits
cd6280f4
Commit
cd6280f4
authored
Apr 05, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use data[:commits] hash from event to render push info on dashboard
parent
ff4471a3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
28 deletions
+9
-28
app/models/event.rb
app/models/event.rb
+2
-20
app/views/dashboard/show.atom.builder
app/views/dashboard/show.atom.builder
+3
-4
app/views/events/_commit.html.haml
app/views/events/_commit.html.haml
+4
-4
No files found.
app/models/event.rb
View file @
cd6280f4
...
@@ -200,7 +200,7 @@ class Event < ActiveRecord::Base
...
@@ -200,7 +200,7 @@ class Event < ActiveRecord::Base
# Max 20 commits from push DESC
# Max 20 commits from push DESC
def
commits
def
commits
@commits
||=
data
[
:commits
].
map
{
|
commit
|
repository
.
commit
(
commit
[
:id
])
}.
reverse
@commits
||=
data
[
:commits
].
reverse
end
end
def
commits_count
def
commits_count
...
@@ -221,26 +221,8 @@ class Event < ActiveRecord::Base
...
@@ -221,26 +221,8 @@ class Event < ActiveRecord::Base
end
end
end
end
def
repository
project
.
repository
end
def
parent_commit
repository
.
commit
(
commit_from
)
rescue
=>
ex
nil
end
def
last_commit
repository
.
commit
(
commit_to
)
rescue
=>
ex
nil
end
def
push_with_commits?
def
push_with_commits?
md_ref?
&&
commits
.
any?
&&
parent_commit
&&
last_commit
md_ref?
&&
commits
.
any?
&&
commit_from
&&
commit_to
rescue
Grit
::
NoSuchPathError
false
end
end
def
last_push_to_non_root?
def
last_push_to_non_root?
...
...
app/views/dashboard/show.atom.builder
View file @
cd6280f4
...
@@ -8,11 +8,10 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear
...
@@ -8,11 +8,10 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear
@events.each do |event|
@events.each do |event|
if event.proper?
if event.proper?
event = EventDecorator.decorate(event)
xml.entry do
xml.entry do
event_link = event
.feed_url
event_link = event
_feed_url(event)
event_title = event
.feed_title
event_title = event
_feed_title(event)
event_summary = event
.feed_summary
event_summary = event
_feed_summary(event)
xml.id "tag:#{request.host},#{event.created_at.strftime("%Y-%m-%d")}:#{event.id}"
xml.id "tag:#{request.host},#{event.created_at.strftime("%Y-%m-%d")}:#{event.id}"
xml.link :href => event_link
xml.link :href => event_link
...
...
app/views/events/_commit.html.haml
View file @
cd6280f4
%li
.commit
%li
.commit
%p
%p
=
link_to
commit
.
short_id
(
8
),
project_commit_path
(
project
,
commit
),
class:
"commit_short_id"
=
link_to
commit
[
:id
][
0
..
8
],
project_commit_path
(
project
,
commit
[
:id
]
),
class:
"commit_short_id"
%span
=
commit
.
author_name
%span
=
commit
[
:author
][
:name
]
–
–
=
image_tag
gravatar_icon
(
commit
.
author_email
),
class:
"avatar"
,
width:
16
=
image_tag
gravatar_icon
(
commit
[
:author
][
:email
]
),
class:
"avatar"
,
width:
16
=
gfm
escape_once
(
truncate
(
commit
.
title
,
length:
50
))
rescue
"--broken encoding"
=
gfm
escape_once
(
truncate
(
commit
[
:message
]
,
length:
50
))
rescue
"--broken encoding"
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