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
fb11004d
Commit
fb11004d
authored
May 25, 2016
by
Douwe Maan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'rs-event-atom-partial' into 'master'
Remove `event_to_atom` helper See merge request !4234
parents
99cd4191
692f11b0
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
39 additions
and
48 deletions
+39
-48
app/helpers/events_helper.rb
app/helpers/events_helper.rb
+0
-22
app/views/dashboard/projects/index.atom.builder
app/views/dashboard/projects/index.atom.builder
+1
-3
app/views/events/_event.atom.builder
app/views/events/_event.atom.builder
+20
-0
app/views/groups/show.atom.builder
app/views/groups/show.atom.builder
+1
-3
app/views/projects/commits/_commit.atom.builder
app/views/projects/commits/_commit.atom.builder
+14
-0
app/views/projects/commits/show.atom.builder
app/views/projects/commits/show.atom.builder
+1
-14
app/views/projects/show.atom.builder
app/views/projects/show.atom.builder
+1
-3
app/views/users/show.atom.builder
app/views/users/show.atom.builder
+1
-3
No files found.
app/helpers/events_helper.rb
View file @
fb11004d
...
...
@@ -159,28 +159,6 @@ module EventsHelper
"--broken encoding"
end
def
event_to_atom
(
xml
,
event
)
if
event
.
visible_to_user?
(
current_user
)
xml
.
entry
do
event_link
=
event_feed_url
(
event
)
event_title
=
event_feed_title
(
event
)
event_summary
=
event_feed_summary
(
event
)
xml
.
id
"tag:
#{
request
.
host
}
,
#{
event
.
created_at
.
strftime
(
"%Y-%m-%d"
)
}
:
#{
event
.
id
}
"
xml
.
link
href:
event_link
xml
.
title
truncate
(
event_title
,
length:
80
)
xml
.
updated
event
.
created_at
.
xmlschema
xml
.
media
:thumbnail
,
width:
"40"
,
height:
"40"
,
url:
image_url
(
avatar_icon
(
event
.
author_email
))
xml
.
author
do
|
author
|
xml
.
name
event
.
author_name
xml
.
email
event
.
author_email
end
xml
.
summary
(
type:
"xhtml"
)
{
|
x
|
x
<<
event_summary
unless
event_summary
.
nil?
}
end
end
end
def
event_row_class
(
event
)
if
event
.
body?
"event-block"
...
...
app/views/dashboard/projects/index.atom.builder
View file @
fb11004d
...
...
@@ -6,7 +6,5 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear
xml.id dashboard_projects_url
xml.updated @events[0].updated_at.xmlschema if @events[0]
@events.each do |event|
event_to_atom(xml, event)
end
xml << render(partial: 'events/event', collection: @events) if @events.any?
end
app/views/events/_event.atom.builder
0 → 100644
View file @
fb11004d
return unless event.visible_to_user?(current_user)
xml.entry do
xml.id "tag:#{request.host},#{event.created_at.strftime("%Y-%m-%d")}:#{event.id}"
xml.link href: event_feed_url(event)
xml.title truncate(event_feed_title(event), length: 80)
xml.updated event.created_at.xmlschema
xml.media :thumbnail, width: "40", height: "40", url: image_url(avatar_icon(event.author_email))
xml.author do
xml.name event.author_name
xml.email event.author_email
end
xml.summary(type: "xhtml") do |summary|
event_summary = event_feed_summary(event)
summary << event_summary unless event_summary.nil?
end
end
app/views/groups/show.atom.builder
View file @
fb11004d
...
...
@@ -6,7 +6,5 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear
xml.id group_url(@group)
xml.updated @events[0].updated_at.xmlschema if @events[0]
@events.each do |event|
event_to_atom(xml, event)
end
xml << render(@events) if @events.any?
end
app/views/projects/commits/_commit.atom.builder
0 → 100644
View file @
fb11004d
xml.entry do
xml.id namespace_project_commit_url(@project.namespace, @project, id: commit.id)
xml.link href: namespace_project_commit_url(@project.namespace, @project, id: commit.id)
xml.title truncate(commit.title, length: 80)
xml.updated commit.committed_date.xmlschema
xml.media :thumbnail, width: "40", height: "40", url: image_url(avatar_icon(commit.author_email))
xml.author do |author|
xml.name commit.author_name
xml.email commit.author_email
end
xml.summary markdown(commit.description, pipeline: :single_line)
end
app/views/projects/commits/show.atom.builder
View file @
fb11004d
...
...
@@ -6,18 +6,5 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear
xml.id namespace_project_commits_url(@project.namespace, @project, @ref)
xml.updated @commits.first.committed_date.xmlschema if @commits.any?
@commits.each do |commit|
xml.entry do
xml.id namespace_project_commit_url(@project.namespace, @project, id: commit.id)
xml.link href: namespace_project_commit_url(@project.namespace, @project, id: commit.id)
xml.title truncate(commit.title, length: 80)
xml.updated commit.committed_date.xmlschema
xml.media :thumbnail, width: "40", height: "40", url: image_url(avatar_icon(commit.author_email))
xml.author do |author|
xml.name commit.author_name
xml.email commit.author_email
end
xml.summary markdown(commit.description, pipeline: :single_line)
end
end
xml << render(@commits) if @commits.any?
end
app/views/projects/show.atom.builder
View file @
fb11004d
...
...
@@ -6,7 +6,5 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear
xml.id namespace_project_url(@project.namespace, @project)
xml.updated @events[0].updated_at.xmlschema if @events[0]
@events.each do |event|
event_to_atom(xml, event)
end
xml << render(@events) if @events.any?
end
app/views/users/show.atom.builder
View file @
fb11004d
...
...
@@ -6,7 +6,5 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear
xml.id user_url(@user)
xml.updated @events[0].updated_at.xmlschema if @events[0]
@events.each do |event|
event_to_atom(xml, event)
end
xml << render(@events) if @events.any?
end
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