Refactor atom builder by using xml.atom layout
This commit is contained in:
parent
b16730fc83
commit
3c1700cde6
|
|
@ -14,7 +14,7 @@ module IssuesAction
|
|||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.atom { render layout: false }
|
||||
format.atom { render layout: 'xml.atom' }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
|
|||
format.html
|
||||
format.atom do
|
||||
load_events
|
||||
render layout: false
|
||||
render layout: 'xml.atom'
|
||||
end
|
||||
format.json do
|
||||
render json: {
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ class GroupsController < Groups::ApplicationController
|
|||
|
||||
format.atom do
|
||||
load_events
|
||||
render layout: false
|
||||
render layout: 'xml.atom'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class Projects::CommitsController < Projects::ApplicationController
|
|||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.atom { render layout: false }
|
||||
format.atom { render layout: 'xml.atom' }
|
||||
|
||||
format.json do
|
||||
pager_json(
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ class Projects::IssuesController < Projects::ApplicationController
|
|||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.atom { render layout: false }
|
||||
format.atom { render layout: 'xml.atom' }
|
||||
format.json do
|
||||
render json: {
|
||||
html: view_to_html_string("projects/issues/_issues"),
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ class ProjectsController < Projects::ApplicationController
|
|||
|
||||
format.atom do
|
||||
load_events
|
||||
render layout: false
|
||||
render layout: 'xml.atom'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ class UsersController < ApplicationController
|
|||
|
||||
format.atom do
|
||||
load_events
|
||||
render layout: false
|
||||
render layout: 'xml.atom'
|
||||
end
|
||||
|
||||
format.json do
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
xml.instruct!
|
||||
xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://search.yahoo.com/mrss/" do
|
||||
xml.title "#{current_user.name} issues"
|
||||
xml.link href: url_for(params), rel: "self", type: "application/atom+xml"
|
||||
xml.link href: issues_dashboard_url, rel: "alternate", type: "text/html"
|
||||
xml.id issues_dashboard_url
|
||||
xml.updated @issues.first.updated_at.xmlschema if @issues.reorder(nil).any?
|
||||
xml.title "#{current_user.name} issues"
|
||||
xml.link href: url_for(params), rel: "self", type: "application/atom+xml"
|
||||
xml.link href: issues_dashboard_url, rel: "alternate", type: "text/html"
|
||||
xml.id issues_dashboard_url
|
||||
xml.updated @issues.first.updated_at.xmlschema if @issues.reorder(nil).any?
|
||||
|
||||
xml << render(partial: 'issues/issue', collection: @issues) if @issues.reorder(nil).any?
|
||||
end
|
||||
xml << render(partial: 'issues/issue', collection: @issues) if @issues.reorder(nil).any?
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
xml.instruct!
|
||||
xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://search.yahoo.com/mrss/" do
|
||||
xml.title "Activity"
|
||||
xml.link href: dashboard_projects_url(rss_url_options), rel: "self", type: "application/atom+xml"
|
||||
xml.link href: dashboard_projects_url, rel: "alternate", type: "text/html"
|
||||
xml.id dashboard_projects_url
|
||||
xml.updated @events[0].updated_at.xmlschema if @events[0]
|
||||
xml.title "Activity"
|
||||
xml.link href: dashboard_projects_url(rss_url_options), rel: "self", type: "application/atom+xml"
|
||||
xml.link href: dashboard_projects_url, rel: "alternate", type: "text/html"
|
||||
xml.id dashboard_projects_url
|
||||
xml.updated @events[0].updated_at.xmlschema if @events[0]
|
||||
|
||||
xml << render(partial: 'events/event', collection: @events) if @events.any?
|
||||
end
|
||||
xml << render(partial: 'events/event', collection: @events) if @events.any?
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
xml.instruct!
|
||||
xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://search.yahoo.com/mrss/" do
|
||||
xml.title "#{@group.name} issues"
|
||||
xml.link href: url_for(params), rel: "self", type: "application/atom+xml"
|
||||
xml.link href: issues_group_url, rel: "alternate", type: "text/html"
|
||||
xml.id issues_group_url
|
||||
xml.updated @issues.first.updated_at.xmlschema if @issues.reorder(nil).any?
|
||||
xml.title "#{@group.name} issues"
|
||||
xml.link href: url_for(params), rel: "self", type: "application/atom+xml"
|
||||
xml.link href: issues_group_url, rel: "alternate", type: "text/html"
|
||||
xml.id issues_group_url
|
||||
xml.updated @issues.first.updated_at.xmlschema if @issues.reorder(nil).any?
|
||||
|
||||
xml << render(partial: 'issues/issue', collection: @issues) if @issues.reorder(nil).any?
|
||||
end
|
||||
xml << render(partial: 'issues/issue', collection: @issues) if @issues.reorder(nil).any?
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
xml.instruct!
|
||||
xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://search.yahoo.com/mrss/" do
|
||||
xml.title "#{@group.name} activity"
|
||||
xml.link href: group_url(@group, rss_url_options), rel: "self", type: "application/atom+xml"
|
||||
xml.link href: group_url(@group), rel: "alternate", type: "text/html"
|
||||
xml.id group_url(@group)
|
||||
xml.updated @events[0].updated_at.xmlschema if @events[0]
|
||||
xml.title "#{@group.name} activity"
|
||||
xml.link href: group_url(@group, rss_url_options), rel: "self", type: "application/atom+xml"
|
||||
xml.link href: group_url(@group), rel: "alternate", type: "text/html"
|
||||
xml.id group_url(@group)
|
||||
xml.updated @events[0].updated_at.xmlschema if @events[0]
|
||||
|
||||
xml << render(@events) if @events.any?
|
||||
end
|
||||
xml << render(@events) if @events.any?
|
||||
|
|
|
|||
|
|
@ -0,0 +1,4 @@
|
|||
xml.instruct!
|
||||
xml.feed 'xmlns' => 'http://www.w3.org/2005/Atom', 'xmlns:media' => 'http://search.yahoo.com/mrss/' do
|
||||
xml << yield
|
||||
end
|
||||
|
|
@ -1,10 +1,7 @@
|
|||
xml.instruct!
|
||||
xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://search.yahoo.com/mrss/" do
|
||||
xml.title "#{@project.name}:#{@ref} commits"
|
||||
xml.link href: namespace_project_commits_url(@project.namespace, @project, @ref, rss_url_options), rel: "self", type: "application/atom+xml"
|
||||
xml.link href: namespace_project_commits_url(@project.namespace, @project, @ref), rel: "alternate", type: "text/html"
|
||||
xml.id namespace_project_commits_url(@project.namespace, @project, @ref)
|
||||
xml.updated @commits.first.committed_date.xmlschema if @commits.any?
|
||||
xml.title "#{@project.name}:#{@ref} commits"
|
||||
xml.link href: namespace_project_commits_url(@project.namespace, @project, @ref, rss_url_options), rel: "self", type: "application/atom+xml"
|
||||
xml.link href: namespace_project_commits_url(@project.namespace, @project, @ref), rel: "alternate", type: "text/html"
|
||||
xml.id namespace_project_commits_url(@project.namespace, @project, @ref)
|
||||
xml.updated @commits.first.committed_date.xmlschema if @commits.any?
|
||||
|
||||
xml << render(@commits) if @commits.any?
|
||||
end
|
||||
xml << render(@commits) if @commits.any?
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
xml.instruct!
|
||||
xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://search.yahoo.com/mrss/" do
|
||||
xml.title "#{@project.name} issues"
|
||||
xml.link href: url_for(params), rel: "self", type: "application/atom+xml"
|
||||
xml.link href: namespace_project_issues_url(@project.namespace, @project), rel: "alternate", type: "text/html"
|
||||
xml.id namespace_project_issues_url(@project.namespace, @project)
|
||||
xml.updated @issues.first.updated_at.xmlschema if @issues.reorder(nil).any?
|
||||
xml.title "#{@project.name} issues"
|
||||
xml.link href: url_for(params), rel: "self", type: "application/atom+xml"
|
||||
xml.link href: namespace_project_issues_url(@project.namespace, @project), rel: "alternate", type: "text/html"
|
||||
xml.id namespace_project_issues_url(@project.namespace, @project)
|
||||
xml.updated @issues.first.updated_at.xmlschema if @issues.reorder(nil).any?
|
||||
|
||||
xml << render(partial: 'issues/issue', collection: @issues) if @issues.reorder(nil).any?
|
||||
end
|
||||
xml << render(partial: 'issues/issue', collection: @issues) if @issues.reorder(nil).any?
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
xml.instruct!
|
||||
xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://search.yahoo.com/mrss/" do
|
||||
xml.title "#{@project.name} activity"
|
||||
xml.link href: namespace_project_url(@project.namespace, @project, rss_url_options), rel: "self", type: "application/atom+xml"
|
||||
xml.link href: namespace_project_url(@project.namespace, @project), rel: "alternate", type: "text/html"
|
||||
xml.id namespace_project_url(@project.namespace, @project)
|
||||
xml.updated @events[0].updated_at.xmlschema if @events[0]
|
||||
xml.title "#{@project.name} activity"
|
||||
xml.link href: namespace_project_url(@project.namespace, @project, rss_url_options), rel: "self", type: "application/atom+xml"
|
||||
xml.link href: namespace_project_url(@project.namespace, @project), rel: "alternate", type: "text/html"
|
||||
xml.id namespace_project_url(@project.namespace, @project)
|
||||
xml.updated @events[0].updated_at.xmlschema if @events[0]
|
||||
|
||||
xml << render(@events) if @events.any?
|
||||
end
|
||||
xml << render(@events) if @events.any?
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
xml.instruct!
|
||||
xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://search.yahoo.com/mrss/" do
|
||||
xml.title "#{@user.name} activity"
|
||||
xml.link href: user_url(@user, :atom), rel: "self", type: "application/atom+xml"
|
||||
xml.link href: user_url(@user), rel: "alternate", type: "text/html"
|
||||
xml.id user_url(@user)
|
||||
xml.updated @events[0].updated_at.xmlschema if @events[0]
|
||||
xml.title "#{@user.name} activity"
|
||||
xml.link href: user_url(@user, :atom), rel: "self", type: "application/atom+xml"
|
||||
xml.link href: user_url(@user), rel: "alternate", type: "text/html"
|
||||
xml.id user_url(@user)
|
||||
xml.updated @events[0].updated_at.xmlschema if @events[0]
|
||||
|
||||
xml << render(@events) if @events.any?
|
||||
end
|
||||
xml << render(@events) if @events.any?
|
||||
|
|
|
|||
Loading…
Reference in New Issue