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
iv
gitlab-ce
Commits
663dd6fa
Commit
663dd6fa
authored
Oct 01, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactored events output. Added links to authors of events
parent
433387be
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
43 additions
and
54 deletions
+43
-54
app/assets/stylesheets/sections/events.scss
app/assets/stylesheets/sections/events.scss
+0
-9
app/helpers/events_helper.rb
app/helpers/events_helper.rb
+22
-0
app/helpers/issues_helper.rb
app/helpers/issues_helper.rb
+1
-1
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+4
-0
app/models/event.rb
app/models/event.rb
+4
-0
app/views/events/_event.html.haml
app/views/events/_event.html.haml
+3
-10
app/views/events/_event_common.html.haml
app/views/events/_event_common.html.haml
+8
-0
app/views/events/_event_issue.html.haml
app/views/events/_event_issue.html.haml
+0
-8
app/views/events/_event_membership_changed.html.haml
app/views/events/_event_membership_changed.html.haml
+0
-9
app/views/events/_event_merge_request.html.haml
app/views/events/_event_merge_request.html.haml
+0
-16
app/views/events/_event_push.html.haml
app/views/events/_event_push.html.haml
+1
-1
No files found.
app/assets/stylesheets/sections/events.scss
View file @
663dd6fa
...
...
@@ -5,32 +5,23 @@
.event_label
{
&
.pushed
{
padding
:
0
2px
;
@extend
.alert
;
@extend
.alert-info
;
}
&
.opened
{
padding
:
0
2px
;
@extend
.alert
;
@extend
.alert-success
;
}
&
.closed
{
padding
:
0
2px
;
@extend
.alert
;
@extend
.alert-error
;
}
&
.merged
{
padding
:
0
2px
;
@extend
.alert
;
@extend
.alert-success
;
}
&
.left
,
&
.joined
{
padding
:
0
2px
;
@extend
.alert
;
float
:none
;
}
}
...
...
app/helpers/events_helper.rb
0 → 100644
View file @
663dd6fa
module
EventsHelper
def
link_to_author
(
event
)
project
=
event
.
project
tm
=
project
.
team_member_by_id
(
event
.
author_id
)
if
tm
link_to
event
.
author_name
,
project_team_member_path
(
project
,
tm
)
else
event
.
author_name
end
end
def
event_action_name
(
event
)
target
=
if
event
.
target_type
event
.
target_type
.
titleize
.
downcase
else
'project'
end
[
event
.
action_name
,
target
].
join
(
" "
)
end
end
app/helpers/issues_helper.rb
View file @
663dd6fa
app/helpers/projects_helper.rb
View file @
663dd6fa
...
...
@@ -6,5 +6,9 @@ module ProjectsHelper
def
remove_from_team_message
(
project
,
member
)
"You are going to remove
#{
member
.
user_name
}
from
#{
project
.
name
}
. Are you sure?"
end
def
link_to_project
project
link_to
project
.
name
,
project
end
end
app/models/event.rb
View file @
663dd6fa
...
...
@@ -58,6 +58,10 @@ class Event < ActiveRecord::Base
end
end
def
target_title
target
.
try
:title
end
def
push?
action
==
self
.
class
::
Pushed
&&
valid_push?
end
...
...
app/views/events/_event.html.haml
View file @
663dd6fa
-
if
event
.
allowed?
%div
.event-item
-
if
event
.
issue?
=
render
"events/event_issue"
,
event:
event
-
elsif
event
.
merge_request?
=
render
"events/event_merge_request"
,
event:
event
-
elsif
event
.
push?
-
if
event
.
push?
=
render
"events/event_push"
,
event:
event
-
elsif
event
.
membership_changed?
=
render
"events/event_membership_changed"
,
event:
event
-
else
=
render
"events/event_common"
,
event:
event
%span
.cgray.right
=
time_ago_in_words
(
event
.
created_at
)
...
...
app/views/events/_event_common.html.haml
0 → 100644
View file @
663dd6fa
=
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
)
=
link_to
[
event
.
project
,
event
.
target
]
do
%strong
=
truncate
event
.
target_title
at
=
link_to_project
event
.
project
app/views/events/_event_issue.html.haml
deleted
100644 → 0
View file @
433387be
=
image_tag
gravatar_icon
(
event
.
author_email
),
class:
"avatar"
.event-title
%strong
.author_name
#{
event
.
author_name
}
%span
.event_label
{
class:
event
.
action_name
}
#{
event
.
action_name
}
issue
=
link_to
project_issue_path
(
event
.
project
,
event
.
issue
)
do
%strong
=
truncate
event
.
issue_title
at
%strong
=
link_to
event
.
project
.
name
,
event
.
project
app/views/events/_event_membership_changed.html.haml
deleted
100644 → 0
View file @
433387be
=
image_tag
gravatar_icon
(
event
.
author_email
),
class:
"avatar"
.event-title
%strong
.author_name
#{
event
.
author_name
}
%span
.event_label
{
class:
event
.
action_name
}
#{
event
.
action_name
}
project
%strong
=
link_to
event
.
project_name
,
event
.
project
%span
.cgray
=
time_ago_in_words
(
event
.
created_at
)
ago.
app/views/events/_event_merge_request.html.haml
deleted
100644 → 0
View file @
433387be
-
if
event
.
action_name
==
"merged"
.event_icon
=
image_tag
"event_mr_merged.png"
=
image_tag
gravatar_icon
(
event
.
author_email
),
class:
"avatar"
.event-title
%strong
.author_name
#{
event
.
author_name
}
%span
.event_label
{
class:
event
.
action_name
}
#{
event
.
action_name
}
merge request
=
link_to
project_merge_request_path
(
event
.
project
,
event
.
merge_request
)
do
%strong
=
truncate
event
.
merge_request_title
at
%strong
=
link_to
event
.
project
.
name
,
event
.
project
.event-body
.event-info
%span
=
event
.
merge_request
.
source_branch
→
%span
=
event
.
merge_request
.
target_branch
app/views/events/_event_push.html.haml
View file @
663dd6fa
...
...
@@ -3,7 +3,7 @@
=
image_tag
gravatar_icon
(
event
.
author_email
),
class:
"avatar"
.event-title
%s
trong
.author_name
#{
event
.
author_name
}
%s
pan
.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
...
...
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