Skip to content

Instantly share code, notes, and snippets.

@riklomas
Forked from anonymous/gist:1408742
Created November 30, 2011 11:22
Show Gist options
  • Save riklomas/1408744 to your computer and use it in GitHub Desktop.
Save riklomas/1408744 to your computer and use it in GitHub Desktop.
<% nmonth = "" %>
<li>
<ul class="weeks">
<li>Week</li>
<% navigation_weeks.each do |w| %>
<li class="<%= (controller_name == "posts" || controller_name == "things") && params[:action]=="index" && params[:week].present? && params[:year].present? && params[:week]==w.week.to_s && params[:year]==w.year.to_s ? 'active' : '' %>">
<%= link_to posts_path(:week => w.week, :year => w.year), :class => 'tip', :title => week_dates(w.week, w.year) do %>
<%= w.week %>
<% if nmonth != week_month(w.week, w.year) %>
<span class="<%= week_month(w.week, w.year).downcase %>"><%= week_month(w.week, w.year) %></span>
<% end %>
<% end %>
</li>
<% nmonth = week_month(w.week, w.year) %>
<% end %>
</ul>
</li>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment