From f0753de99e22fd94a1ffe1e844bd686fbded84c3 Mon Sep 17 00:00:00 2001 From: Alex Turchyn Date: Fri, 11 Sep 2026 22:20:17 +0300 Subject: [PATCH] hide pro badge in the native app --- app/javascript/elements/emails_textarea.js | 2 +- app/views/accounts/show.html.erb | 4 +-- .../notifications_settings/index.html.erb | 2 +- .../personalization_settings/show.html.erb | 10 ++++--- app/views/shared/_native_navbar.html.erb | 2 +- app/views/shared/_settings_nav.html.erb | 6 ++-- .../submissions/_send_sms_button.html.erb | 10 ++++--- app/views/submissions/new.html.erb | 2 +- .../_placeholder.html.erb | 30 ++++++++++--------- app/views/users/_role_select.html.erb | 12 ++++---- config/locales/i18n.yml | 7 +++++ 11 files changed, 51 insertions(+), 36 deletions(-) diff --git a/app/javascript/elements/emails_textarea.js b/app/javascript/elements/emails_textarea.js index dde8109f7..9c0aa7f46 100644 --- a/app/javascript/elements/emails_textarea.js +++ b/app/javascript/elements/emails_textarea.js @@ -35,7 +35,7 @@ export default class extends HTMLElement { counter.innerText = `${count} / ${this.dataset.limit}` } - if (this.dataset.bulkEnabled !== 'true') { + if (this.dataset.bulkEnabled !== 'true' && !/Hotwire Native/.test(navigator.userAgent)) { if (!bulkMessage) { bulkMessage = document.createElement('span') diff --git a/app/views/accounts/show.html.erb b/app/views/accounts/show.html.erb index aa77491d3..a6241cb1b 100644 --- a/app/views/accounts/show.html.erb +++ b/app/views/accounts/show.html.erb @@ -133,7 +133,7 @@ <% end %> <% end %> <% account_config = AccountConfig.find_or_initialize_by(account: current_account, key: AccountConfig::ALLOW_TO_DECLINE_KEY) %> - <% if can?(:manage, account_config) %> + <% if can?(:manage, account_config) && (!turbo_native_app? || !Docuseal.multitenant? || can?(:manage, :disable_decline)) %> <%= form_for account_config, url: account_configs_path, method: :post do |f| %> <%= f.hidden_field :key %>
@@ -156,7 +156,7 @@ <% end %> <% end %> <% account_config = AccountConfig.find_or_initialize_by(account: current_account, key: AccountConfig::ALLOW_TO_DELEGATE_KEY) %> - <% if can?(:manage, account_config) %> + <% if can?(:manage, account_config) && (!turbo_native_app? || !Docuseal.multitenant? || can?(:manage, :delegate_form)) %> <%= form_for account_config, url: account_configs_path, method: :post do |f| %> <%= f.hidden_field :key %>
diff --git a/app/views/notifications_settings/index.html.erb b/app/views/notifications_settings/index.html.erb index a911c9494..3a65a20f3 100644 --- a/app/views/notifications_settings/index.html.erb +++ b/app/views/notifications_settings/index.html.erb @@ -22,7 +22,7 @@ <% end %>
<%= render 'bcc_form', config: @bcc_config %> - <% unless can?(:manage, :personalization_restricted) %> + <% unless can?(:manage, :personalization_restricted) || (turbo_native_app? && !can?(:manage, :email_reminders)) %>

<%= t('sign_request_email_reminders') %> diff --git a/app/views/personalization_settings/show.html.erb b/app/views/personalization_settings/show.html.erb index 82651ce01..a78b06e6e 100644 --- a/app/views/personalization_settings/show.html.erb +++ b/app/views/personalization_settings/show.html.erb @@ -10,10 +10,12 @@ <%= render 'documents_copy_email_form' %> <%= render 'submitter_completed_email_form' %>

-

- <%= t('company_logo') %> -

- <%= render 'logo_form' %> + <% if !turbo_native_app? || can?(:manage, :custom_logo) %> +

+ <%= t('company_logo') %> +

+ <%= render 'logo_form' %> + <% end %>

<%= t('submission_form') %>

diff --git a/app/views/shared/_native_navbar.html.erb b/app/views/shared/_native_navbar.html.erb index 661b9f894..cdeb8a791 100644 --- a/app/views/shared/_native_navbar.html.erb +++ b/app/views/shared/_native_navbar.html.erb @@ -14,7 +14,7 @@ <% if can?(:create, ::Template) && controller_name.in?(%w[templates_dashboard submissions_dashboard template_folders]) %> <% folder_name = @template_folder&.full_name %> "> - + <% if Docuseal.multitenant? %> <%= link_to 'Google Drive', new_template_path(modal_tab: 'google_drive', folder_name: folder_name), data: { turbo_frame: :modal } %> diff --git a/app/views/shared/_settings_nav.html.erb b/app/views/shared/_settings_nav.html.erb index 6fbc5d789..2e43b1300 100644 --- a/app/views/shared/_settings_nav.html.erb +++ b/app/views/shared/_settings_nav.html.erb @@ -42,7 +42,7 @@ <%= link_to t('storage'), settings_storage_index_path, class: 'text-base hover:bg-base-300' %> <% end %> - <% if can?(:read, EncryptedConfig.new(key: 'submitter_invitation_sms', account: current_account)) && true_user == current_user %> + <% if can?(:read, EncryptedConfig.new(key: 'submitter_invitation_sms', account: current_account)) && true_user == current_user && (!turbo_native_app? || can?(:manage, :sms_verification)) %>
  • <%= link_to 'SMS', settings_sms_path, class: 'text-base hover:bg-base-300' %>
  • @@ -83,7 +83,7 @@ <% end %> <% end %> - <% if !Docuseal.demo? && can?(:manage, EncryptedConfig) && (current_user != true_user || !current_account.linked_account_account) %> + <% if !Docuseal.demo? && !turbo_native_app? && can?(:manage, EncryptedConfig) && (current_user != true_user || !current_account.linked_account_account) %>
  • <%= content_for(:pro_link) || link_to(Docuseal.multitenant? ? console_redirect_index_path(redir: "#{Docuseal::CONSOLE_URL}/plans") : "#{Docuseal::CLOUD_URL}/sign_up?#{{ redir: "#{Docuseal::CONSOLE_URL}/on_premises" }.to_query}", class: 'text-base hover:bg-base-300', data: { turbo: false }) do %> <%= t('plans') %> @@ -104,7 +104,7 @@ <% end %>
  • <% end %> - <% if (!Docuseal.multitenant? || can?(:manage, :saml_sso)) && can?(:read, EncryptedConfig.new(key: 'saml_configs', account: current_account)) && true_user == current_user %> + <% if (!Docuseal.multitenant? || can?(:manage, :saml_sso)) && can?(:read, EncryptedConfig.new(key: 'saml_configs', account: current_account)) && true_user == current_user && (!turbo_native_app? || can?(:manage, :saml_sso)) %>
  • <%= link_to 'SSO', settings_sso_index_path, class: 'text-base hover:bg-base-300' %>
  • diff --git a/app/views/submissions/_send_sms_button.html.erb b/app/views/submissions/_send_sms_button.html.erb index 33862cf2f..7e18fed02 100644 --- a/app/views/submissions/_send_sms_button.html.erb +++ b/app/views/submissions/_send_sms_button.html.erb @@ -1,5 +1,7 @@ -
    -
    - <%= link_to submitter.sent_at? ? t('re_send_sms') : t('send_sms'), Docuseal.multitenant? ? console_redirect_index_path(redir: "#{Docuseal::CONSOLE_URL}/plans") : "#{Docuseal::CLOUD_URL}/sign_up?#{{ redir: "#{Docuseal::CONSOLE_URL}/on_premises" }.to_query}", class: 'btn btn-sm btn-primary text-gray-400 w-full' %> +<% unless turbo_native_app? %> +
    +
    + <%= link_to submitter.sent_at? ? t('re_send_sms') : t('send_sms'), Docuseal.multitenant? ? console_redirect_index_path(redir: "#{Docuseal::CONSOLE_URL}/plans") : "#{Docuseal::CLOUD_URL}/sign_up?#{{ redir: "#{Docuseal::CONSOLE_URL}/on_premises" }.to_query}", class: 'btn btn-sm btn-primary text-gray-400 w-full' %> +
    -
    +<% end %> diff --git a/app/views/submissions/new.html.erb b/app/views/submissions/new.html.erb index 14adde752..e8052898b 100644 --- a/app/views/submissions/new.html.erb +++ b/app/views/submissions/new.html.erb @@ -6,7 +6,7 @@ <% recipient_form_fields = Accounts.load_recipient_form_fields(current_account) if prefillable_fields.blank? %> <% can_send_emails = Accounts.can_send_emails?(current_account) %> <% only_detailed = require_phone_2fa || require_email_2fa || prefillable_fields.present? || recipient_form_fields.present? %> -<% with_list = @template.variables_schema.blank? %> +<% with_list = @template.variables_schema.blank? && (!turbo_native_app? || can?(:manage, :bulk_send)) %> <% variables_form = render 'variables_form', schema: @template.variables_schema if @template.variables_schema.present? && @template.variables_schema.any? { |_, v| !v['disabled'] } %> <%= render 'shared/turbo_modal_large', title: params[:selfsign] ? t('add_recipients') : t('add_new_recipients') do %> <% options = [only_detailed ? nil : [t('via_email'), 'email'], only_detailed ? nil : [t('via_phone'), 'phone'], [t('detailed'), 'detailed'], with_list ? [t('upload_list'), 'list'] : nil].compact %> diff --git a/app/views/templates_code_modal/_placeholder.html.erb b/app/views/templates_code_modal/_placeholder.html.erb index 7557aa78e..9e24d2a93 100644 --- a/app/views/templates_code_modal/_placeholder.html.erb +++ b/app/views/templates_code_modal/_placeholder.html.erb @@ -1,15 +1,17 @@ -
    - <%= svg_icon('info_circle', class: 'w-6 h-6') %> -
    -

    - <%= t('api_and_embedding') %> -

    -

    - <%= t('unlock_with_docuseal_pro') %> -
    - " data-turbo="false"> - <%= t('learn_more') %> - -

    +<% unless turbo_native_app? %> +
    + <%= svg_icon('info_circle', class: 'w-6 h-6') %> +
    +

    + <%= t('api_and_embedding') %> +

    +

    + <%= t('unlock_with_docuseal_pro') %> +
    + " data-turbo="false"> + <%= t('learn_more') %> + +

    +
    -
    +<% end %> diff --git a/app/views/users/_role_select.html.erb b/app/views/users/_role_select.html.erb index d14b2778d..d3fa10290 100644 --- a/app/views/users/_role_select.html.erb +++ b/app/views/users/_role_select.html.erb @@ -12,9 +12,11 @@ <% end %> - "> - <%= svg_icon('info_circle', class: 'w-4 h-4 inline align-text-bottom') %> - <%= t('unlock_more_user_roles_with_docuseal_pro') %> - <%= t('learn_more') %> - + <% unless turbo_native_app? %> + "> + <%= svg_icon('info_circle', class: 'w-4 h-4 inline align-text-bottom') %> + <%= t('unlock_more_user_roles_with_docuseal_pro') %> + <%= t('learn_more') %> + + <% end %>
    diff --git a/config/locales/i18n.yml b/config/locales/i18n.yml index a6d89dff9..ab7a9a5a0 100644 --- a/config/locales/i18n.yml +++ b/config/locales/i18n.yml @@ -412,6 +412,7 @@ en: &en powered_by: Powered by qr_code: QR Code print: Print + scan: Scan scan_the_qr_code_above_with_your_phone_camera_to_open_and_sign_this_document: Scan the QR code above with your phone camera to open and sign this document. count_documents_signed_with_html: '%{count} documents signed with' storage: Storage @@ -1550,6 +1551,7 @@ es: &es powered_by: Desarrollado por qr_code: Código QR print: Imprimir + scan: Escanear scan_the_qr_code_above_with_your_phone_camera_to_open_and_sign_this_document: Escanea el código QR de arriba con la cámara de tu teléfono para abrir y firmar este documento. count_documents_signed_with_html: '%{count} documentos firmados con' storage: Almacenamiento @@ -2692,6 +2694,7 @@ it: &it powered_by: Fornito da qr_code: Codice QR print: Stampa + scan: Scansiona scan_the_qr_code_above_with_your_phone_camera_to_open_and_sign_this_document: Scansiona il codice QR qui sopra con la fotocamera del tuo telefono per aprire e firmare questo documento. count_documents_signed_with_html: '%{count} documenti firmati con' storage: Archiviazione @@ -3820,6 +3823,7 @@ fr: &fr powered_by: Propulsé par qr_code: Code QR print: Imprimer + scan: Scanner scan_the_qr_code_above_with_your_phone_camera_to_open_and_sign_this_document: Scannez le code QR ci-dessus avec l'appareil photo de votre téléphone pour ouvrir et signer ce document. count_documents_signed_with_html: "%{count} documents signés avec" storage: Stockage @@ -4958,6 +4962,7 @@ pt: &pt powered_by: Desenvolvido por qr_code: Código QR print: Imprimir + scan: Digitalizar scan_the_qr_code_above_with_your_phone_camera_to_open_and_sign_this_document: Escaneie o código QR acima com a câmera do seu telefone para abrir e assinar este documento. count_documents_signed_with_html: '%{count} documentos assinados com' storage: Armazenamento @@ -6099,6 +6104,7 @@ de: &de powered_by: Bereitgestellt von qr_code: QR-Code print: Drucken + scan: Scannen scan_the_qr_code_above_with_your_phone_camera_to_open_and_sign_this_document: Scannen Sie den QR-Code oben mit Ihrer Handykamera, um dieses Dokument zu öffnen und zu unterzeichnen. count_documents_signed_with_html: '%{count} Dokumente signiert mit' storage: Speicher @@ -7768,6 +7774,7 @@ nl: &nl powered_by: Aangedreven door qr_code: QR-code print: Afdrukken + scan: Scannen scan_the_qr_code_above_with_your_phone_camera_to_open_and_sign_this_document: Scan de bovenstaande QR-code met je telefooncamera om dit document te openen en te ondertekenen. count_documents_signed_with_html: "%{count} documenten ondertekend met" storage: Opslag