diff options
author | Robert Speicher <rspeicher@gmail.com> | 2016-05-21 18:04:28 -0500 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-05-23 12:38:11 -0400 |
commit | 692f11b05d6ec751d1944cb025812481345329a8 (patch) | |
tree | f2ced9752d115cea3a1b36e2301eadab0c6ac61d /app/views/projects/commits | |
parent | 66cebb6f61193a5fb4199b85580a312ed6d94b42 (diff) | |
download | gitlab-ce-692f11b05d6ec751d1944cb025812481345329a8.tar.gz |
Render a collection for the Commits atom feedrs-event-atom-partial
Diffstat (limited to 'app/views/projects/commits')
-rw-r--r-- | app/views/projects/commits/_commit.atom.builder | 14 | ||||
-rw-r--r-- | app/views/projects/commits/show.atom.builder | 15 |
2 files changed, 15 insertions, 14 deletions
diff --git a/app/views/projects/commits/_commit.atom.builder b/app/views/projects/commits/_commit.atom.builder new file mode 100644 index 00000000000..1657fb46163 --- /dev/null +++ b/app/views/projects/commits/_commit.atom.builder @@ -0,0 +1,14 @@ +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 diff --git a/app/views/projects/commits/show.atom.builder b/app/views/projects/commits/show.atom.builder index e310fafd82c..30bb7412073 100644 --- a/app/views/projects/commits/show.atom.builder +++ b/app/views/projects/commits/show.atom.builder @@ -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 |