app/views/shared/_submissions.erb
<% submissions.each do |solution| %>
<div class="<%= submissions.highlight_owner? && solution.owner?(current_user) ? "note" : "success" %> clearfix">
<h6 style="margin-bottom:0.5em">
<a class="anchor" href="#<%= solution.id %>" name="<%= solution.id %>"><b>#<%= solution.position %></b></a>
<%= solution.user.name %> / <%= profile_link(solution.user) %> -
<b>Score: <%= solution.score %></b> -
<span style="font-size:0.9em"><%= solution.created_at.strftime("%m/%d/%y @ %H:%M") %></span>
</h6>
<pre style="margin-bottom:0">
<% VimGolf::Keylog.new(solution.script, solution.created_at).each do |key| %><% if key.size > 1 %><span class="entry-script"><%= key %></span><% else %><%= key %><% end %><% end %>
</pre>
<% solution.comments.each do |c| %>
<p class="comment"><%= profile_link(c) %>: <%= c.comment %></p>
<% end %>
<p style="padding:0.5em 0 0 0; margin:0">
<b><%= pluralize solution.comments.size, 'comment' %></b>
<% if current_user %>
- <a href="" onclick="toggle('comments-<%= solution.id %>'); return false">
Comment <% if submissions.player_can_edit?(solution) %> / Edit <% end %>
</a>
<% end %>
</p>
<div id="comments-<%= solution.id %>" class="comments">
<%= form_for :comment, :url => comment_entry_path(submissions.challenge_id, solution.id) do |f| %>
<%= f.text_area "text", :rows => 2, :class => :text, :style => 'width:98%' %><br/>
<%= f.submit "Comment", class: 'action comment-button' %>
<% if submissions.player_can_delete?(solution) %>
<%= link_to "Delete Entry", delete_entry_path(submissions.challenge_id, solution.id), :class => 'action delete' %>
<% end %>
<% end %>
</div>
</div>
<% end %>