% events.each do |event| %> <% if event.profile_comment_id %>
<%== erb :'_news_profile_comment', layout: false, locals: {profile_comment: event.profile_comment, event: event} %> <% elsif event.follow_id %>
<% actioning_site = event.actioning_site_dataset.select(:id, :username, :title, :domain, :stripe_customer_id).first %> <% event_site = event.site_dataset.select(:id, :username, :title, :domain, :stripe_customer_id).first %> <% if current_site && current_site.id == actioning_site.id %>
You
<% else %>
<% if actioning_site.supporter? %>
<% end %>
<%= actioning_site.username %>
<% end %> followed <% if current_site && event_site.id == current_site.id %>
you
<% else %>
<% if event_site.supporter? %>
<% end %>
<%= event_site.username %>
<% end %>
<%= event.created_at.ago %>
<% elsif event.site_change_id %>
<% event_site = event.site_dataset.select(:id, :username, :title, :domain).first %> <% if current_site && event_site.id == current_site.id %> Your site was updated. <% else %>
<%= event_site.title.shorten(45) %>
has been updated. <% end %>
<% binding.pry %>
<%= event.created_at.ago %>
<% site_change_filenames = event.site_change.site_change_filenames %> <% unless site_change_filenames.empty? %>
<% site_change_filenames.each do |f| %>
"> <% if site_change_file_display_class(f) == 'html' %>
<% elsif site_change_file_display_class(f) == 'image' %>
<% elsif site_change_file_display_class(f) == 'misc' %>
<%= File.extname(f).sub('.', '') %>
<% end %>
<%= File.basename f %>
<% end %>
<% end %> <% end %> <% if !event.follow_id %> <%== erb :'_news_actions', layout: false, locals: {event: event} %> <% end %> <% if event.comments_dataset.count > 0 %>
<% event.comments.each do |comment| %> <% comment_actioning_site = comment.actioning_site_dataset.select(:id, :title, :domain, :username, :stripe_customer_id).first %>
<% if comment_actioning_site.supporter? %>
<% end %>
<%= comment_actioning_site.username %>
<%= comment.created_at.ago %>
<%= comment.message %>
<% comment_likes_count = comment.comment_likes_dataset.count %> <% if current_site %>
<%= comment.site_likes?(current_site) ? 'Unlike' : 'Like' %><%= comment_likes_count > 0 ? " (#{comment_likes_count})" : '' %>
<% else %> <% if comment_likes_count > 0 %> <%= comment_likes_count %> <%= comment_likes_count == 1 ? 'like' : 'likes' %> <% end %> <% end %> <% if current_site %> <% if event.site_id == current_site.id || comment.actioning_site_id == current_site.id %>
Delete
<% end %> <% end %>
<% end %>
<% end %>
<% end %>
<% if @page_count > 1 %>
<% if @current_page != 1 %>
<% end %> <% 1.upto(@page_count) do |num| %> <% if num == @current_page %> <%= num %> <% else %>
<%= num %>
<% end %> <% end %> <% if @current_page != @page_count %>
<% end %>
<% end %>
<%== erb :'_news_templates', layout: false %>
<%= comment.message %>