Sha256: cae166eb53d9ce01f92f7a246c6eeba71992303d3dd193bca3683f297063adb8

Contents?: true

Size: 1.49 KB

Versions: 2

Compression:

Stored size: 1.49 KB

Contents

xml.rss("version" => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1/") do
	xml.channel do
		xml.title @elt.subject
		xml.link url_for(:only_path => false, :action => 'show', :id => @elt)
		xml.description @elt.subject

		Elt.find(:all,
			:select => 'SUM(value), elts.id, parent_id, elts.created_on, parent_id,' \
				+'elts_count, position, elts.person_id, subject, body, lft, rgt',
			:conditions => "lft > #{@elt.lft} AND rgt < #{@elt.rgt}",
			:order => 'SUM(value) IS NULL, SUM(value) DESC, created_on DESC',
			:group => 'elts.id, parent_id, elts.created_on, parent_id, elts_count,' \
				+'position, elts.person_id, subject, body, lft, rgt',
			:limit  => PAGE_ELT_LENGTH,
			:joins => "LEFT JOIN choices ON elt_id = elts.id").each do |item|

			xml.item do
				xml.title item.subject
				#xml.category(@elt.subject)
				xml.vote item.result
				xml.pubDate item.created_on

				if url_for(:only_path => false).match(/http:\/\/echarp.dyndns.org/) and @elt.id == 'blog'
					xml.link(url_for(:only_path => false, :controller => 'perso',
						:action => 'blog', :id => item.id+'.html'))
					xml.comments(url_for(:only_path => false, :controller => 'perso',
						:action => 'blog', :id => item.id+'.html'))
				else
					xml.link(url_for(:only_path => false, :action => 'show', :id => item))
					xml.comments(url_for(:only_path => false, :action => 'show', :id => item))
				end

				xml.tag!("dc:creator", item.person.name) if item.person

				xml.description "<p>"+format(item.body)+"</p>"
			end
		end
	end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
parlement-0.6 app/views/elt/vote_rss.rxml
parlement-0.7 app/views/elt/vote_rss.rxml