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
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
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
30 deletions
+42
-30
app/helpers/events_helper.rb
app/helpers/events_helper.rb
+14
-0
app/views/events/_event.html.haml
app/views/events/_event.html.haml
+6
-2
app/views/events/_event_push.html.haml
app/views/events/_event_push.html.haml
+0
-27
app/views/events/event/_common.html.haml
app/views/events/event/_common.html.haml
+0
-1
app/views/events/event/_push.html.haml
app/views/events/event/_push.html.haml
+22
-0
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_push.html.haml
deleted
100644 → 0
View file @
663dd6fa
%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
-
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
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
0 → 100644
View file @
69751aac
.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
-
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
]
}
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