id="entry_<%= entry_exists ? entry.id : "blank" %>" data-mark-read-url="<%= entry_exists && entry_id && context_url(entry_context, :api_v1_context_discussion_topic_discussion_entry_mark_read_url, discussion_topic_id, entry_id) %>">
<% unless hide_student_names %>
<%= avatar((entry.try_rescue(:user_id)), context_code: entry_context.asset_string) %>
<% end %>
<%= entry_context.id if entry_context && entry_context.is_a?(Course) %>
<%= user_content(entry.try_rescue(:message)) || nbsp %>
<% if entry && entry.attachment %>
<% end %>
<% entries ||= []; @grouped_entries ||= {} %>
<% if entry && !skip_sub_entries %>
<% entries = @grouped_entries[entry.id] %>
<% entries ||= [] #entry.discussion_subentries.active %>
<% if entries.length > 3 %>
<% end %>
<% entries.each_with_index do |entry, idx| %>
<%= render :partial => "discussion_topics/sub_entry", :locals => {:entry => entry, :hide_entry => entries.length > 3 && idx < entries.length - 2} %>
<% end %>
<% end %>
<% if entry && entry.editor_id && entry.editor_id != entry.user_id %>
<%= t :edited_comment, "This comment was edited by %{user}.", :user => link_to(context_user_name(entry_context, entry.editor_id), context_url(entry_context, :context_user_url, entry.editor_id)) %>
<% end %>
<%= render :partial => 'discussion_topics/sub_entry', :locals => {:entry => nil, :parent_entry => entry || topic} %>