diff --git a/lib/repair_html.rb b/lib/repair_html.rb index 87222b809..a16963e98 100644 --- a/lib/repair_html.rb +++ b/lib/repair_html.rb @@ -49,3 +49,16 @@ def repair_html( html, debug=false ) depth.downto(0).each { |x| res<<= %{} } res end + +def showArticle( article, language ) + if /]*>/ =~ article.compiled_content + image=$& + else + image=%{basic logo} + end + presentation=%{
#{image} +
+ #{article[:title]} » +
} + %{
#{link_to(presentation, article)}
} +end diff --git a/multi/blog.erb b/multi/blog.erb index 10a90bca2..35762c4bf 100644 --- a/multi/blog.erb +++ b/multi/blog.erb @@ -5,7 +5,7 @@ menupriority: 2 noSubMenu: true ----- <% - number_of_articles=5 + number_of_articles=18 number_of_char_for_resume=800 language=@item_rep.path.sub(/\/Scratch\//,'').sub(/\/.*$/,'') last_articles = @items.select do |a| @@ -61,10 +61,10 @@ fr: Articles populaires
- Magritte pleasure principle -
- Learn Haskell Fast and Hard » -
+ Magritte pleasure principle +
+ Learn Haskell Fast and Hard » +
@@ -72,28 +72,23 @@ fr: Articles populaires

-en: Last <%= number_of_articles %> Articles +en: <%= number_of_articles %> lastest Articles fr: Les <%= number_of_articles %> derniers articles

-<% last_articles.each do |a| %> -
-

<%= calendar_for( a[:created_at], language ) %> - <%= link_to(a[:title]+%{ »}, a) %>

-
- <%= repair_html ( excerptize( a.reps[0].compiled_content, {:length => number_of_char_for_resume} ) ) %> +
+<% +i=2 +last_articles.each do |a| + i+=1 %> + <%= showArticle(a, language) %> + <% if i % 3 == 2 %>
-
-

-fr: <%= link_to(%{en lire plus »}, a) %> -en: <%= link_to(%{Read more »}, a) %> -

-
-
-
+ <% end %> <% end %> +