-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
110 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
url = polymorphic_url([diary.owner, diary]) | ||
feed.entry(diary, :url => url) do |entry| | ||
entry.title(diary.title) | ||
if diary.node.cc_licensed | ||
entry.rights("Licence CC by-sa http://creativecommons.org/licenses/by-sa/3.0/deed.fr") | ||
end | ||
epub = content_tag(:div, link_to("Télécharger ce contenu au format Epub", "#{url}.epub")) | ||
entry.content(diary.body + epub + atom_comments_link(url), :type => 'html') | ||
entry.author do |author| | ||
author.name(diary.owner.name) | ||
end | ||
diary.node.popular_tags.each do |tag| | ||
entry.category(:term => tag.name) | ||
end | ||
entry.wfw :commentRss, "http://#{MY_DOMAIN}/nodes/#{diary.node.id}/comments.atom" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
feed.entry(news, :published => news.node.created_at) do |entry| | ||
url = news_url news | ||
entry.title(news.title) | ||
if news.node.cc_licensed | ||
entry.rights("Licence CC by-sa http://creativecommons.org/licenses/by-sa/3.0/deed.fr") | ||
end | ||
first = content_tag(:div, news.body) | ||
links = content_tag(:ul, news.links.map.with_index do |l,i| | ||
content_tag(:li, "lien n°#{i+1} : ".html_safe + | ||
link_to(l.title, "http://#{MY_DOMAIN}/redirect/#{l.id}", :title => l.url, :hreflang => l.lang)) | ||
end.join.html_safe) | ||
second = content_tag(:div, news.second_part) | ||
if news.published? | ||
epub = content_tag(:div, link_to("Télécharger ce contenu au format Epub", "#{url}.epub")) | ||
else | ||
epub = "" | ||
end | ||
comments = atom_comments_link(url) | ||
entry.content(first + links + second + epub + comments, :type => 'html') | ||
news.attendees.each do |attendee| | ||
entry.author do |author| | ||
author.name(attendee.name) | ||
end | ||
end | ||
entry.category(:term => news.section.title) | ||
news.node.popular_tags.each do |tag| | ||
entry.category(:term => tag.name) | ||
end | ||
if news.published? | ||
entry.wfw :commentRss, "http://#{MY_DOMAIN}/nodes/#{news.node.id}/comments.atom" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
feed.entry(poll, :published => poll.node.created_at) do |entry| | ||
url = poll_url(poll) | ||
entry.title(poll.title) | ||
epub = content_tag(:div, link_to("Télécharger ce contenu au format Epub", "#{url}.epub")) | ||
entry.content(poll_body(poll) + epub + atom_comments_link(url), :type => 'html') | ||
entry.author do |author| | ||
author.name(poll.node.user.name) | ||
end | ||
poll.node.popular_tags.each do |tag| | ||
entry.category(:term => tag.name) | ||
end | ||
entry.wfw :commentRss, "http://#{MY_DOMAIN}/nodes/#{poll.node.id}/comments.atom" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
url = forum_post_url(:forum_id => post.forum, :id => post) | ||
feed.entry(post, :url => url) do |entry| | ||
entry.title(post.title) | ||
epub = content_tag(:div, link_to("Télécharger ce contenu au format Epub", "#{url}.epub")) | ||
entry.content(post.body + epub + atom_comments_link(url), :type => 'html') | ||
entry.author do |author| | ||
author.name(post.user.name) | ||
end | ||
entry.category(:term => post.forum.title) | ||
post.node.popular_tags.each do |tag| | ||
entry.category(:term => tag.name) | ||
end | ||
entry.wfw :commentRss, "http://#{MY_DOMAIN}/nodes/#{post.node.id}/comments.atom" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
feed.entry(tracker) do |entry| | ||
entry.title("#{tracker.category.title} : #{tracker.title}") | ||
entry.content(tracker.body + atom_comments_link(tracker_url tracker), :type => 'html') | ||
entry.author do |author| | ||
author.name(tracker.user.try(:name) || 'Anonyme') | ||
end | ||
entry.category(:term => tracker.category.title) | ||
tracker.node.popular_tags.each do |tag| | ||
entry.category(:term => tag.name) | ||
end | ||
entry.wfw :commentRss, "http://#{MY_DOMAIN}/nodes/#{tracker.node.id}/comments.atom" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
feed.entry(wiki_page) do |entry| | ||
entry.title(wiki_page.title) | ||
url = wiki_page_url wiki_page | ||
epub = content_tag(:div, link_to("Télécharger ce contenu au format Epub", "#{url}.epub")) | ||
entry.content(wiki_page.body + epub + atom_comments_link(url), :type => 'html') | ||
entry.author do |author| | ||
author.name(wiki_page.node.user.try :name) | ||
end | ||
wiki_page.node.popular_tags.each do |tag| | ||
entry.category(:term => tag.name) | ||
end | ||
entry.wfw :commentRss, "http://#{MY_DOMAIN}/nodes/#{wiki_page.node.id}/comments.atom" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters