From 960d36f6286148354b3cbd492647686ef43bb5ee Mon Sep 17 00:00:00 2001 From: Pete Matsyburka Date: Thu, 17 Sep 2026 16:46:13 +0300 Subject: [PATCH] add submission tabs --- app/views/submissions/show.html.erb | 33 ++++++++++++++++------------- config/routes.rb | 1 + 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/app/views/submissions/show.html.erb b/app/views/submissions/show.html.erb index 1f8ffae58..c977bf311 100644 --- a/app/views/submissions/show.html.erb +++ b/app/views/submissions/show.html.erb @@ -1,4 +1,5 @@ <% content_for(:native_title, @submission.name || @submission.template&.name) if turbo_native_app? %> +<% native_tab = (params[:tab] == 'recipients' ? 'recipients' : 'document') if turbo_native_app? %> <% if local_assigns[:is_preview] %> <%= render 'submissions/preview_tags' %> <% end %> @@ -11,6 +12,7 @@ <% with_signature_id_reason = configs.find { |e| e.key == AccountConfig::WITH_SIGNATURE_ID_REASON_KEY }&.value != false %> <% with_signature_id_completed_at = configs.find { |e| e.key == AccountConfig::WITH_SIGNATURE_ID_COMPLETED_AT_KEY }&.value == true %>
+ <% unless native_tab == 'recipients' %>
<% unless turbo_native_app? %> @@ -115,11 +117,14 @@ <% end %>
+ <% end %>
+ <% values = @submission.submitters.reduce({}) { |acc, sub| acc.merge(sub.values) } %> + <% service_url_time = ActiveStorage::Attachment.service_url_time %> + <% attachments_index = ActiveStorage::Attachment.where(record: @submission.submitters, name: :attachments).preload(:blob).index_by(&:uuid) %> + <% unless native_tab == 'recipients' %>
- + <% end %> - - <% if turbo_native_app? %> - - - - - - - <% else %> + <% if native_tab == 'document' %> + + + <% elsif !native_tab %> + - <% end %> - + + <% end %>
<% unless request.headers['HTTP_X_TURBO'] %> <%= render 'scripts/autosize_field' %> diff --git a/config/routes.rb b/config/routes.rb index 234be4db1..be19f76e9 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -74,6 +74,7 @@ Rails.application.routes.draw do resources :events, only: %i[index], controller: 'submission_events' resources :download, only: %i[index], controller: 'submissions_download' resources :resend_email, only: %i[create], controller: 'submissions_resend_email' + get ':tab', action: :show, on: :member, as: :tab, constraints: { tab: /recipients/ } end resources :submitters, only: %i[edit update] resources :console_redirect, only: %i[index]