From 3d92560e7a722992de6fb87427df50211cc918f2 Mon Sep 17 00:00:00 2001 From: Eric Schultz Date: Tue, 5 Jan 2021 15:57:24 -0600 Subject: [PATCH] Use proxy-only urls for all ActiveStorage images --- app/views/app_data/_nonprofit.jbuilder | 2 +- app/views/app_data/_profile.jbuilder | 2 +- app/views/campaigns/_create.jbuilder | 10 +++++----- app/views/campaigns/_settings_modal.html.erb | 2 +- app/views/campaigns/show.html.erb | 4 ++-- app/views/events/_edit_form.html.erb | 2 +- app/views/events/show.html.erb | 4 ++-- app/views/events/stats.html.erb | 4 ++-- app/views/layouts/_admin_menu.html.erb | 2 +- app/views/layouts/_user_menu.html.erb | 2 +- app/views/nonprofits/_edit.html.erb | 2 +- app/views/nonprofits/_header_content.html.erb | 2 +- app/views/nonprofits/_overview_media.html.erb | 2 +- app/views/nonprofits/_settings_modals.html.erb | 2 +- app/views/nonprofits/donate.html.erb | 4 ++-- app/views/nonprofits/email/_footer.html.erb | 2 +- app/views/nonprofits/show.html.erb | 4 ++-- app/views/nonprofits/supporter_form.html.erb | 2 +- app/views/profiles/show.html.erb | 2 +- 19 files changed, 28 insertions(+), 28 deletions(-) diff --git a/app/views/app_data/_nonprofit.jbuilder b/app/views/app_data/_nonprofit.jbuilder index de5be506..389ddd13 100644 --- a/app/views/app_data/_nonprofit.jbuilder +++ b/app/views/app_data/_nonprofit.jbuilder @@ -9,5 +9,5 @@ json.extract! nonprofit, :id, :name, #basics :no_anon #options json.url nonprofit_path(nonprofit) json.logo do - json.normal url_for(nonprofit.logo_by_size(:normal)) + json.normal rails_storage_proxy_url(nonprofit.logo_by_size(:normal)) end \ No newline at end of file diff --git a/app/views/app_data/_profile.jbuilder b/app/views/app_data/_profile.jbuilder index 9807308c..9ff3ae00 100644 --- a/app/views/app_data/_profile.jbuilder +++ b/app/views/app_data/_profile.jbuilder @@ -4,4 +4,4 @@ # Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE json.extract! profile, :id, :name, :country, :picture json.url profile_path(profile) -json.pic_tiny url_for(profile.picture_by_size(:tiny)) if profile.picture.attached? +json.pic_tiny rails_storage_proxy_url(profile.picture_by_size(:tiny)) if profile.picture.attached? diff --git a/app/views/campaigns/_create.jbuilder b/app/views/campaigns/_create.jbuilder index 2c95c4f8..827b465a 100644 --- a/app/views/campaigns/_create.jbuilder +++ b/app/views/campaigns/_create.jbuilder @@ -12,15 +12,15 @@ json.url campaign_url(nonprofit) if campaign.main_image.attached? json.main_image do - json.full url_for(campaign.main_image) - json.normal url_for(campaign.main_image_by_size(:normal)) - json.thumb url_for(campaign.main_image_by_size(:thumb)) + json.full rails_storage_proxy_url(campaign.main_image) + json.normal rails_storage_proxy_url(campaign.main_image_by_size(:normal)) + json.thumb rails_storage_proxy_url(campaign.main_image_by_size(:thumb)) end end if campaign.background_image.attached? json.background_image do - json.full url_for(campaign.background_image) - json.normal url_for(campaign.background_image_by_size(:normal)) + json.full rails_storage_proxy_url(campaign.background_image) + json.normal rails_storage_proxy_url(campaign.background_image_by_size(:normal)) end end \ No newline at end of file diff --git a/app/views/campaigns/_settings_modal.html.erb b/app/views/campaigns/_settings_modal.html.erb index 915cbbbb..c2c54715 100644 --- a/app/views/campaigns/_settings_modal.html.erb +++ b/app/views/campaigns/_settings_modal.html.erb @@ -69,7 +69,7 @@

Used for previews and social media

");'> + ? rails_storage_proxy_url(@campaign.main_image_by_size(:thumb)) : '' %>");'> Edit
diff --git a/app/views/campaigns/show.html.erb b/app/views/campaigns/show.html.erb index 30188d2b..b15ec5d7 100644 --- a/app/views/campaigns/show.html.erb +++ b/app/views/campaigns/show.html.erb @@ -46,13 +46,13 @@ <%= content_for :facebook_tags do %> - "> + "> <% end %> <%= content_for :twitter_tags do %> - "> + "> <% end %> <% if current_campaign_editor? %> diff --git a/app/views/events/_edit_form.html.erb b/app/views/events/_edit_form.html.erb index d8ab9737..b3d7c10f 100644 --- a/app/views/events/_edit_form.html.erb +++ b/app/views/events/_edit_form.html.erb @@ -85,7 +85,7 @@

Used for sharing on social media

-
")'> +
")'> Edit
diff --git a/app/views/events/show.html.erb b/app/views/events/show.html.erb index 7b8335f0..8e5ce159 100644 --- a/app/views/events/show.html.erb +++ b/app/views/events/show.html.erb @@ -10,13 +10,13 @@ <%= content_for :facebook_tags do %> - " /> + " /> <% end %> <%= content_for :twitter_tags do %> - " /> + " /> <% end %> <%= content_for :javascripts do %> diff --git a/app/views/events/stats.html.erb b/app/views/events/stats.html.erb index 135a1442..2519a5db 100644 --- a/app/views/events/stats.html.erb +++ b/app/views/events/stats.html.erb @@ -9,13 +9,13 @@ <%= content_for :facebook_tags do %> - " /> + " /> <% end %> <%= content_for :twitter_tags do %> - " /> + " /> <% end %> <%= content_for :javascripts do %> diff --git a/app/views/layouts/_admin_menu.html.erb b/app/views/layouts/_admin_menu.html.erb index e12a4582..a3bbd032 100644 --- a/app/views/layouts/_admin_menu.html.erb +++ b/app/views/layouts/_admin_menu.html.erb @@ -3,7 +3,7 @@ <% if current_role?([:nonprofit_admin,:nonprofit_associate]) %>
- <%= image_tag administered_nonprofit.logo_by_size(:small), class:"sideNav-profile" %> + <%= image_tag rails_storage_proxy_url(administered_nonprofit.logo_by_size(:small)), class:"sideNav-profile" %> <%= administered_nonprofit.name %> diff --git a/app/views/layouts/_user_menu.html.erb b/app/views/layouts/_user_menu.html.erb index a53860f1..303cf38b 100644 --- a/app/views/layouts/_user_menu.html.erb +++ b/app/views/layouts/_user_menu.html.erb @@ -5,7 +5,7 @@
<% if current_user.profile.picture.attached? %> - <%= image_tag current_user.profile.picture_by_size(:tiny), class: 'sideNav-profile' %> + <%= image_tag rails_storage_proxy_url(current_user.profile.picture_by_size(:tiny)), class: 'sideNav-profile' %> <% else %> <% end %> diff --git a/app/views/nonprofits/_edit.html.erb b/app/views/nonprofits/_edit.html.erb index 5fdf68ff..415f7f0a 100644 --- a/app/views/nonprofits/_edit.html.erb +++ b/app/views/nonprofits/_edit.html.erb @@ -99,7 +99,7 @@
-
")'> +
")'> Upload
diff --git a/app/views/nonprofits/_header_content.html.erb b/app/views/nonprofits/_header_content.html.erb index bcd9f19f..916470cd 100644 --- a/app/views/nonprofits/_header_content.html.erb +++ b/app/views/nonprofits/_header_content.html.erb @@ -4,7 +4,7 @@ <% if @nonprofit.logo.attached? %> <% end %> diff --git a/app/views/nonprofits/show.html.erb b/app/views/nonprofits/show.html.erb index 26177c21..80489d83 100755 --- a/app/views/nonprofits/show.html.erb +++ b/app/views/nonprofits/show.html.erb @@ -8,12 +8,12 @@ <%= content_for :facebook_tags do %> - " /> + " /> <% end %> <%= content_for :twitter_tags do %> - " /> + " /> <% end %> <%= content_for :stylesheets do %> diff --git a/app/views/nonprofits/supporter_form.html.erb b/app/views/nonprofits/supporter_form.html.erb index ab9761b1..6daceed5 100644 --- a/app/views/nonprofits/supporter_form.html.erb +++ b/app/views/nonprofits/supporter_form.html.erb @@ -18,7 +18,7 @@
<% if @nonprofit.logo.attached? %> - <%= image_tag url_for(@nonprofit.logo_by_size(:normal)) %> + <%= image_tag rails_storage_proxy_url(@nonprofit.logo_by_size(:normal)) %> <% end %> <% if params[:title] %>

<%= params[:title] %>

diff --git a/app/views/profiles/show.html.erb b/app/views/profiles/show.html.erb index d283f7f1..5a8a4e4a 100644 --- a/app/views/profiles/show.html.erb +++ b/app/views/profiles/show.html.erb @@ -15,7 +15,7 @@
- diff --git a/app/views/nonprofits/_overview_media.html.erb b/app/views/nonprofits/_overview_media.html.erb index 89734e33..93c0a342 100644 --- a/app/views/nonprofits/_overview_media.html.erb +++ b/app/views/nonprofits/_overview_media.html.erb @@ -6,7 +6,7 @@
- <%= image_tag @nonprofit.main_image_by_size(:nonprofit_carousel) %> + <%= image_tag rails_storage_proxy_url(@nonprofit.main_image_by_size(:nonprofit_carousel)) %>
diff --git a/app/views/nonprofits/_settings_modals.html.erb b/app/views/nonprofits/_settings_modals.html.erb index 30d941b9..4003ac6c 100644 --- a/app/views/nonprofits/_settings_modals.html.erb +++ b/app/views/nonprofits/_settings_modals.html.erb @@ -24,7 +24,7 @@

-
")'> +
")'> Select
diff --git a/app/views/nonprofits/donate.html.erb b/app/views/nonprofits/donate.html.erb index ee271c60..5ccf543d 100755 --- a/app/views/nonprofits/donate.html.erb +++ b/app/views/nonprofits/donate.html.erb @@ -34,13 +34,13 @@ <%= content_for :facebook_tags do %> - + <% end %> <%= content_for :twitter_tags do %> - " /> + " /> <% end %> <% content_for :body_id do %>donate<% end %> diff --git a/app/views/nonprofits/email/_footer.html.erb b/app/views/nonprofits/email/_footer.html.erb index 7274b58e..f32e3085 100644 --- a/app/views/nonprofits/email/_footer.html.erb +++ b/app/views/nonprofits/email/_footer.html.erb @@ -31,7 +31,7 @@
- <%= image_tag @nonprofit.logo_by_size(:normal), style:'border: 1px solid rgba(0,0,0,0.05);'%> + <%= image_tag rails_storage_proxy_url(@nonprofit.logo_by_size(:normal)), style:'border: 1px solid rgba(0,0,0,0.05);'%>
- + <% supporter = (@profile.supporters && @profile.supporters.length != 0) ? supporter : false %>