From 1546258529d516e92b3f47078bcbf963387881ab Mon Sep 17 00:00:00 2001 From: Pete Matsyburka Date: Fri, 19 Jun 2026 16:33:55 +0300 Subject: [PATCH] add service url time --- app/controllers/preview_document_page_controller.rb | 7 +++++-- app/views/profile/index.html.erb | 4 ++-- app/views/submissions/_value.html.erb | 4 ++-- app/views/submissions/show.html.erb | 9 +++++---- app/views/submit_form/show.html.erb | 3 ++- config/initializers/active_storage.rb | 8 ++++++++ 6 files changed, 24 insertions(+), 11 deletions(-) diff --git a/app/controllers/preview_document_page_controller.rb b/app/controllers/preview_document_page_controller.rb index 2befe3bf..5f5a8554 100644 --- a/app/controllers/preview_document_page_controller.rb +++ b/app/controllers/preview_document_page_controller.rb @@ -25,7 +25,10 @@ class PreviewDocumentPageController < ActionController::API preview_image = attachment.preview_images.joins(:blob) .find_by(blob: { filename: ["#{params[:id]}.png", "#{params[:id]}.jpg"] }) - return redirect_to preview_image.url, allow_other_host: true if preview_image + if preview_image + return redirect_to preview_image.url(time: ActiveStorage::Attachment.service_url_time), + allow_other_host: true + end file_path = if attachment.service.name == :disk @@ -37,7 +40,7 @@ class PreviewDocumentPageController < ActionController::API preview_image = Templates::ProcessDocument.generate_pdf_preview_from_file(attachment, file_path, params[:id].to_i) - redirect_to preview_image.url, allow_other_host: true + redirect_to preview_image.url(time: ActiveStorage::Attachment.service_url_time), allow_other_host: true end def find_or_create_document_tempfile_path(attachment) diff --git a/app/views/profile/index.html.erb b/app/views/profile/index.html.erb index 016f29ef..cc5558d1 100644 --- a/app/views/profile/index.html.erb +++ b/app/views/profile/index.html.erb @@ -36,7 +36,7 @@ <% if signature %>
<%= button_to button_title(title: t('remove'), disabled_with: t('removing')), user_signature_path, method: :delete, class: 'right-0 top-0 absolute link' %> - +
<% end %> @@ -49,7 +49,7 @@ <% if initials %>
<%= button_to button_title(title: t('remove'), disabled_with: t('removing')), user_initials_path, method: :delete, class: 'right-0 top-0 absolute link' %> - +
<% end %>
diff --git a/app/views/submissions/_value.html.erb b/app/views/submissions/_value.html.erb index 18fd89d5..6c94e65d 100644 --- a/app/views/submissions/_value.html.erb +++ b/app/views/submissions/_value.html.erb @@ -10,7 +10,7 @@ <% is_narrow = area['h'].to_f.positive? && ((area['w'].to_f * local_assigns[:page_width]) / (area['h'].to_f * local_assigns[:page_height])) > 4.5 %>
- <%= field['name'].presence || field['title'].presence || field['type'] %> + <%= field['name'].presence || field['title'].presence || field['type'] %>
<% if (local_assigns[:with_signature_id] || field.dig('preferences', 'reason_field_uuid').present?) && attachment = attachments_index[value] %>
@@ -35,7 +35,7 @@ <% end %>
<% elsif field['type'].in?(['image', 'initials', 'stamp', 'kba']) && attachments_index[value].image? %> - <%= field['name'].presence || field['title'].presence || field['type'] %> + <%= field['name'].presence || field['title'].presence || field['type'] %> <% elsif field['type'].in?(['file', 'payment', 'image']) %>
diff --git a/app/views/submissions/show.html.erb b/app/views/submissions/show.html.erb index 709dc9a9..94a25199 100644 --- a/app/views/submissions/show.html.erb +++ b/app/views/submissions/show.html.erb @@ -83,11 +83,12 @@