visualculture.prototype
clone your own copy | download snapshot

Snapshots | iceberg

No images in this repository’s iceberg at this time

Inside this repository

home.erb
text/html

Download raw (2.0 KB)

<% # -*- coding: UTF-8 -*- %>

<script>
$(window).load(function() {
  $('#active-projects').masonry({
    itemSelector: '.project'
  });
});
</script>

<!-- These are the latest 8 repos with an iceberg as defined in vc-server.rb-->
<% @home_repos.each do |repo| %>
<!-- I dont get why I need to convert to ascii here, and not in other cases
where i use repo.title-->
<% if repo.iceberg %>
<% begin %>
<% title = repo.title.force_encoding("ASCII-8BIT") %>
<% rescue NoMethodError %>
<% title = repo.title %>
<% end %>


<div class="project">
    <p class="project-type"><%= repo.category %></p>

    <h2 class="project-title">
        <a href="/<%= repo.web_path %>/view/latest/"><%= title %></a>
    </h2>

    <div class="iceberg">
    <% repo.iceberg[0...3].each_with_index do |img, i| %>
        <a href="/<%= repo.web_path %>/view/latest/"><img class="<%= i == 0 ? 'iceberg-pict-big' : 'iceberg-pict' %>" src="/<%= repo.web_path %>/thumbnail/latest/iceberg/<%= img %>"></a>
    <% end %>
    </div>

    <p class="project-source"><a href="/<%= repo.web_path %>/view/latest/">Source files</a></p>

    <div class="commit-list">
    <% ellipse = 0 %>
    <% previous_commit_date = Time.now %>
    <% repo.commits[0...3].each_with_index do |commit, i|%>
    <% if i != 0 %>
        <!-- Number of days between commits:-->
        <%  ellipse = (previous_commit_date.to_i - commit.committed_date.to_i) / (24*60*60) %>
        <%  ellipse = ellipse * 3 %>
    <% end %>
        <div class='ellipse' style='width: 5px; margin: auto; text-align: center; height: <%= ellipse %>px; border-left: 1px solid springgreen;'>&nbsp;</div>
        <div class='commit'>
            <p><span class='commit-author'><%= commit.author.name %></span><span class='commit-author-said'>said</span></p>
            <p class='commit-message'>&mdash; <%= commit.message %></p>
            <p class='commit-date'><%= commit.committed_date.strftime("%A, %d %B %Y") %></p>
        </div>
    <% previous_commit_date = commit.committed_date %>
    <% end %> 
    </div>
    
</div>
<% end %>
<% end %>