diff --git a/views/_news.erb b/views/_news.erb index 4c2bee2f..7ba5d862 100644 --- a/views/_news.erb +++ b/views/_news.erb @@ -34,45 +34,8 @@
<%== erb :'_news_profile_comment', layout: false, locals: {profile_comment: event.profile_comment, event: event} %> <% elsif event.tip_id %> - <% actioning_site = event.actioning_site_dataset.select(:id, :username, :title, :domain, :stripe_customer_id, :plan_type).first %> - <% event_site = event.site_dataset.select(:id, :username, :title, :domain, :stripe_customer_id, :plan_type).first %> - <% tip = event.tip %> -
-
-
- <% if actioning_site %> - - <% end %> -
- -
-
- <% if actioning_site %> - <% if current_site && current_site.id == actioning_site.id %> - You - <% else %> - <% if actioning_site.supporter? %><% end %><%= actioning_site.username %> - <% end %> - <% else %> - An anonymous donor - <% end %> - - sent a <%= tip.amount_string %> tip to - <% if current_site && event_site.id == current_site.id %> - you! - <% else %> - <% if event_site.supporter? %><% end %><%= event_site.username %>! - <% end %> -
- - <%= tip.message %> -
- - - <%= event.created_at.ago %> - -
- +
+ <%== erb :'_news_tip', layout: false, locals: {tip: event.tip, event: event} %> <% elsif event.follow_id %> <% actioning_site = event.actioning_site_dataset.select(:id, :username, :title, :domain, :stripe_customer_id, :plan_type).first %> <% next if actioning_site.nil? %> diff --git a/views/_news_tip.erb b/views/_news_tip.erb new file mode 100644 index 00000000..6a717a9f --- /dev/null +++ b/views/_news_tip.erb @@ -0,0 +1,36 @@ +<% actioning_site = event.tip.actioning_site_dataset.select(:id, :username, :stripe_customer_id, :plan_type, :parent_site_id).first %> +<% event_site = event.site_dataset.select(:id, :username, :stripe_customer_id, :plan_type, :parent_site_id).first %> + +
+ +
+ <% if actioning_site %> + + <% end %> +
+ +
+ <% if actioning_site %> + <% if current_site && current_site.id == actioning_site.id %> + You + <% else %> + <% if actioning_site.supporter? %><% end %><%= actioning_site.username %> + <% end %> + <% else %> + An anonymous donor + <% end %> + + sent a <%= tip.amount_string %> tip to + <% if current_site && event_site.id == current_site.id %> + you + <% else %> + <% if event_site.supporter? %><% end %><%= event_site.username %> + <% end %> +
+ + + <%= event.created_at.ago %> + +
+ +
<%== sanitize_comment tip.message %>