<% user = User.find(response.response_by) rescue nil %> <% if user.nil? || user.member_profile.avatar.nil? || user.member_profile.avatar.thumb.url == "thumb_person.png" avatar = "/assets/thumb_person.png" else avatar = user.member_profile.avatar.thumb.url end %> <%= user.name if !user.nil? %>
<% dt = DateTime.parse(response.created_at.to_s) %> <%= dt.strftime("%d %B %Y - %H:%M") %>
<% if !user.nil? && user.id.to_s == current_user.id.to_s %> Delete <% end %> <% if response.user_tags.include?(current_user.id.to_s) %> Reply <% end %>
<% response.user_tags.each do |u| user = User.find(u) rescue nil if !user.nil? if user.member_profile.avatar.nil? || user.member_profile.avatar.thumb.url == "thumb_person.png" avatar = "/assets/thumb_person.png" else avatar = user.member_profile.avatar.thumb.url end end %>
<% if !user.nil? %> " src="<%= avatar %>" data-avatar-id="<%= user.id.to_s %>"> <%= user.name rescue ""%> <% else %> <%= user.name rescue "Member was deleted"%> <% end %>
<% end %>
" data-user-tags="<%= response.user_tags.to_s %>" data-response-id="<%= response.id.to_s %>"> <%= response.response.html_safe %>