2011-05-02 10:09:43 +00:00
|
|
|
-----
|
|
|
|
kind: blog
|
|
|
|
title: Blog
|
|
|
|
menupriority: 2
|
|
|
|
noSubMenu: true
|
|
|
|
-----
|
2011-05-04 14:52:16 +00:00
|
|
|
<% content_for :js do %>
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready( function(){$('.list').hide();$('#tagcloud a').removeAttr("href")} );
|
|
|
|
function tagSelected(id) {
|
|
|
|
$('.list').hide();
|
|
|
|
$('#'+id).fadeIn();
|
|
|
|
$('.tag.selected').removeClass('selected');
|
|
|
|
$('#tag_'+id).addClass('selected');
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
<% end %>
|
2011-05-02 10:09:43 +00:00
|
|
|
<%
|
|
|
|
number_of_articles=5
|
|
|
|
number_of_char_for_resume=800
|
|
|
|
language=@item_rep.path.sub(/\/Scratch\//,'').sub(/\/.*$/,'')
|
|
|
|
last_articles = @items.select do |a|
|
|
|
|
a.reps[0].path =~ /\/#{language}\// && a[:kind] == 'article'
|
|
|
|
end
|
|
|
|
last_articles=last_articles.sort { |x,y| y[:created_at] <=> x[:created_at] }[0..(number_of_articles-1)]
|
|
|
|
|
|
|
|
%>
|
|
|
|
|
2011-05-04 15:16:43 +00:00
|
|
|
<div id="elementblock">
|
2011-07-11 10:06:21 +00:00
|
|
|
<ul class="menu">
|
2011-07-11 13:40:44 +00:00
|
|
|
<li> <a href="#last-articles">↓ <%= number_of_articles %> latest articles ↓</a> </li>
|
|
|
|
<li> <a href="#tagcloud">↓ Tag Cloud ↓</a></li>
|
|
|
|
<li> <a href="#archives">↓ Achives ↓</a></li>
|
2011-05-02 10:09:43 +00:00
|
|
|
</ul>
|
2011-05-04 15:16:43 +00:00
|
|
|
</div>
|
2011-05-02 10:09:43 +00:00
|
|
|
|
|
|
|
<h2 id="last-articles">
|
|
|
|
Last <%= number_of_articles %> Articles
|
|
|
|
</h2>
|
|
|
|
|
|
|
|
<% last_articles.each do |a| %>
|
2011-05-02 14:23:59 +00:00
|
|
|
<article>
|
2011-05-02 10:09:43 +00:00
|
|
|
<%= calendar_for( a[:created_at], language ) %>
|
2011-05-02 14:23:59 +00:00
|
|
|
<h1> <%= link_to(a[:title]+%{ <span class="nicer">»</span>}, a) %> </h1>
|
|
|
|
|
|
|
|
<div class="content">
|
|
|
|
<%= repair_html ( excerptize( a.reps[0].compiled_content, {:length => number_of_char_for_resume} ) ) %>
|
|
|
|
|
|
|
|
<div class="flush"></div>
|
|
|
|
<div>
|
|
|
|
<p>
|
2011-05-04 14:52:16 +00:00
|
|
|
<%= link_to(%{Read more <span class="nicer">»</span>}, a, :class => "small") %>
|
2011-05-02 14:23:59 +00:00
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
|
2011-05-02 10:09:43 +00:00
|
|
|
</div>
|
2011-05-02 14:23:59 +00:00
|
|
|
</article>
|
|
|
|
<hr/>
|
2011-05-02 10:09:43 +00:00
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<div class="corps">
|
2011-05-04 14:52:16 +00:00
|
|
|
<h2>Tag Cloud</h2>
|
|
|
|
<div>
|
|
|
|
<%= tagCloud %>
|
|
|
|
</div>
|
2011-05-02 10:09:43 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<h2 id="archives">Archives</h2>
|
|
|
|
|
|
|
|
<%= generateBlogSubMenu(language) %>
|