BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
69751aac
Commit
69751aac
authored
Oct 01, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactoring event views
parent
663dd6fa
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
28 deletions
+40
-28
events_helper.rb
app/helpers/events_helper.rb
+14
-0
_event.html.haml
app/views/events/_event.html.haml
+6
-2
_common.html.haml
app/views/events/event/_common.html.haml
+0
-1
_push.html.haml
app/views/events/event/_push.html.haml
+20
-25
No files found.
app/helpers/events_helper.rb
View file @
69751aac
...
...
@@ -19,4 +19,18 @@ module EventsHelper
[
event
.
action_name
,
target
].
join
(
" "
)
end
def
event_image
event
event_image_path
=
if
event
.
push?
"event_push.png"
elsif
event
.
merged?
"event_mr_merged.png"
end
return
nil
unless
event_image_path
content_tag
:div
,
class:
'event_icon'
do
image_tag
event_image_path
end
end
end
app/views/events/_event.html.haml
View file @
69751aac
-
if
event
.
allowed?
%div
.event-item
=
event_image
(
event
)
=
image_tag
gravatar_icon
(
event
.
author_email
),
class:
"avatar"
-
if
event
.
push?
=
render
"events/event
_
push"
,
event:
event
=
render
"events/event
/
push"
,
event:
event
-
else
=
render
"events/event
_
common"
,
event:
event
=
render
"events/event
/
common"
,
event:
event
.clearfix
%span
.cgray.right
=
time_ago_in_words
(
event
.
created_at
)
ago.
...
...
app/views/events/
_event
_common.html.haml
→
app/views/events/
event/
_common.html.haml
View file @
69751aac
=
image_tag
gravatar_icon
(
event
.
author_email
),
class:
"avatar"
.event-title
%span
.author_name
=
link_to_author
event
%span
.event_label
{
class:
event
.
action_name
}=
event_action_name
(
event
)
...
...
app/views/events/
_event
_push.html.haml
→
app/views/events/
event/
_push.html.haml
View file @
69751aac
%div
.event_icon
=
image_tag
"event_push.png"
=
image_tag
gravatar_icon
(
event
.
author_email
),
class:
"avatar"
.event-title
%span
.author_name
=
link_to_author
event
%span
.event_label.pushed
#{
event
.
push_action_name
}
#{
event
.
ref_type
}
=
link_to
project_commits_path
(
event
.
project
,
event
.
ref_name
)
do
%strong
=
event
.
ref_name
at
%strong
=
link_to
event
.
project
.
name
,
event
.
project
.event-title
%span
.author_name
=
link_to_author
even
t
%span
.event_label.pushed
#{
event
.
push_action_name
}
#{
event
.
ref_type
}
=
link_to
project_commits_path
(
event
.
project
,
event
.
ref_name
)
do
%strong
=
event
.
ref_name
at
%strong
=
link_to
event
.
project
.
name
,
event
.
project
-
if
event
.
push_with_commits?
-
project
=
event
.
projec
t
.event-body
%ul
.unstyled.event_commits
-
few_commits
=
event
.
commits
[
0
...
2
]
-
few_commits
.
each
do
|
commit
|
=
render
"events/commit"
,
commit:
commit
,
project:
project
-
if
event
.
push_with_commits?
-
project
=
event
.
project
.event-body
%ul
.unstyled.event_commits
-
few_commits
=
event
.
commits
[
0
...
2
]
-
few_commits
.
each
do
|
commit
|
=
render
"events/commit"
,
commit:
commit
,
project:
project
-
if
event
.
commits_count
>
1
%li
.commits-stat
-
if
event
.
commits_count
>
2
%span
... and
#{
event
.
commits_count
-
2
}
more commits.
=
link_to
project_compare_path
(
event
.
project
,
from:
event
.
parent_commit
.
id
,
to:
event
.
last_commit
.
id
)
do
%strong
Compare
→
#{
event
.
parent_commit
.
id
[
0
..
7
]
}
...
#{
event
.
last_commit
.
id
[
0
..
7
]
}
.clearfix
-
if
event
.
commits_count
>
1
%li
.commits-stat
-
if
event
.
commits_count
>
2
%span
... and
#{
event
.
commits_count
-
2
}
more commits.
=
link_to
project_compare_path
(
event
.
project
,
from:
event
.
parent_commit
.
id
,
to:
event
.
last_commit
.
id
)
do
%strong
Compare
→
#{
event
.
parent_commit
.
id
[
0
..
7
]
}
...
#{
event
.
last_commit
.
id
[
0
..
7
]
}
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