sharieswebsite/content/html/en/blog.erb

71 lines
1.9 KiB
Text
Raw Normal View History

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">
<ul class="menu">
2011-07-11 13:40:44 +00:00
<li> <a href="#last-articles">&darr; <%= number_of_articles %> latest articles &darr;</a> </li>
<li> <a href="#tagcloud">&darr; Tag Cloud &darr;</a></li>
<li> <a href="#archives">&darr; Achives &darr;</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| %>
<article>
2011-05-02 10:09:43 +00:00
<%= calendar_for( a[:created_at], language ) %>
<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") %>
</p>
</div>
2011-05-02 10:09:43 +00:00
</div>
</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) %>