Skip to content

Instantly share code, notes, and snippets.

@trosage
Created July 17, 2012 19:51
Show Gist options
  • Save trosage/3131599 to your computer and use it in GitHub Desktop.
Save trosage/3131599 to your computer and use it in GitHub Desktop.
<% selected = true if !logged_in? || @topic_groups || current_user.selected_topic?(topic_group_unit) %>
<li class="topic <%= "my-topic" if selected %>">
<%= link_to topic_group_unit, :class => "collection" do %>
<div class="quarter primary badge-container">
<%= badge_image topic_group_unit, :link => false %>
<!-- <span class="icon icon-new-corner"></span> -->
<% if current_user && current_user.has_badge?(topic_group_unit.badge) %>
<span class="icon icon-unlocked-corner"></span>
<% end %>
</div>
<h4><%= topic_group_unit.title %></h4>
<div class="badge-count">
<%= topic_group_unit.badge_count %>
<span><%= topic_group_unit.badge_count > 1 ? "badge".pluralize : "badge" %></span>
</div>
<p class="two-quarter"><%= topic_group_unit.description %></p>
<% end %>
<div class="buttons-container">
<% if logged_in? %>
<%= link_to_start_unit topic_group_unit, :text => "Start Badge", :class => "button" %>
<% else %>
<%= link_to_unit topic_group_unit, "View Badge", :class => "button" %>
<% end %>
</div>
</li>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment