diff --git a/app/controllers/static_pages_controller.rb b/app/controllers/static_pages_controller.rb index 4941b00..0eca997 100644 --- a/app/controllers/static_pages_controller.rb +++ b/app/controllers/static_pages_controller.rb @@ -1,6 +1,12 @@ class StaticPagesController < ApplicationController def about_us + dcc_news_feed_url = "https://opidor.fr/category/dmp-news/feed/" + @dcc_news_feed = Feedjira::Feed.fetch_and_parse(dcc_news_feed_url) + respond_to do |format| + format.rss { redirect_to dcc_news_feed_url } + format.html +end end def contact_us diff --git a/app/views/branded/static_pages/about_us.html.erb b/app/views/branded/static_pages/about_us.html.erb index 2925fec..0597992 100644 --- a/app/views/branded/static_pages/about_us.html.erb +++ b/app/views/branded/static_pages/about_us.html.erb @@ -2,6 +2,46 @@

<%= t("about_page.title")%>

-
-<%= raw t("about_page.body_text_html")%> + + + +
+
+
+ + <%= raw t("about_page.body_text_html")%> +
+
+ <% news_left = @dcc_news_feed.entries.count %> + <% @dcc_news_feed.entries.each do |entry| %> +

<%= entry.title.sanitize %>

+ <% summary = entry.summary.sanitize %> + <% summary = summary.gsub(/\A])+>/, "") %> + <% summary = summary.gsub(/\A])+>/, "") %> + <% name = summary[/\A[\s\w]*([^,])/].strip %> + <% summary = summary.gsub(/\A.*div>/, "") %> + <% summary = summary.gsub(/

.*\z/, "") %> +

<%= raw summary.strip %>

+

Par <%= entry.author %> on <%= entry.published.strftime("%d/%m/%Y") %>

+

Voir plus sur le <%= link_to "site OPIDoR", entry.url %>

+
+ + <%if news_left.to_i > 1 then %> +
+ <%else%> +
+ <%end%> + <% news_left = news_left - 1 %> + <% end %> +
+
+
\ No newline at end of file