adjust native

This commit is contained in:
Pete Matsyburka committed 2026-09-23 11:00:17 +03:00
1 parent 6f31bd7af8
commit 66758d45bc
21 files changed
+379 -64

No files matched your search

+1
View File
@@ -4,4 +4,5 @@
<%= render 'shared/meta' %>
<% if turbo_native_app? %>
<meta name="turbo-cache-control" content="no-preview">
<style>native-action { display: none !important; }</style>
<% end %>
@@ -0,0 +1,93 @@
{
"settings": {
"strings": {
"search": <%== t('search').to_json %>,
"create": <%== t('create').to_json %>,
"documents": <%== t('documents').to_json %>,
"fields": <%== t('fields').to_json %>,
"more": <%== t('more').to_json %>,
"close": <%== t('close').to_json %>,
"cancel": <%== t('cancel').to_json %>,
"ok": <%== t('ok').to_json %>,
"failed_to_download_files": <%== t('failed_to_download_files').to_json %>,
"failed_to_upload_files": <%== t('failed_to_upload_files').to_json %>,
"failed_to_save_the_scan": <%== t('failed_to_save_the_scan').to_json %>,
"failed_to_scan_the_document": <%== t('failed_to_scan_the_document').to_json %>,
"document_scanning_is_not_available_on_this_device": <%== t('document_scanning_is_not_available_on_this_device').to_json %>
}
},
"rules": [
{
"patterns": [".*"],
"properties": {
"query_string_presentation": "replace"
}
},
{
"patterns": ["^/search($|\\?)"],
"properties": {
"pull_to_refresh_enabled": false
}
},
{
"patterns": ["^/settings", "^/reports"],
"properties": {
"large_title": true
}
},
{
"patterns": ["^/settings$", "^/settings/personalization$"],
"properties": {
"large_title": false
}
},
{
"patterns": ["^/templates($|\\?)"],
"properties": {
"native_tab_bar": true,
"tab_title": <%== t('templates').to_json %>
}
},
{
"patterns": ["^/submissions($|\\?)"],
"properties": {
"native_tab_bar": true,
"tab_title": <%== t('submissions').to_json %>
}
},
{
"patterns": ["^/folders/\\d+"],
"properties": {
"native_actions": ["menu"],
"native_tab_bar": true
}
},
{
"patterns": ["^/templates/archived($|\\?)", "^/templates/shared($|\\?)", "^/submissions/archived($|\\?)"],
"properties": {
"native_tab_bar": true
}
},
{
"patterns": ["^/templates/\\d+(/archived)?($|\\?)"],
"properties": {
"native_actions": ["menu"],
"large_title": true,
"native_tab_bar": true
}
},
{
"patterns": ["^/templates/\\d+/edit"],
"properties": {
"native_actions": ["check", "menu"]
}
},
{
"patterns": ["^/submissions/\\d+($|\\?)"],
"properties": {
"native_actions": ["menu"],
"native_tabs": <%== [t('document'), t('recipients')].to_json %>
}
}
]
}
+3 -1
View File
@@ -28,7 +28,9 @@
<open-modal src="<%= url_for(**url_params, params: modal_uri.query_values) %>"></open-modal>
<% end %>
<% end %>
<turbo-frame id="modal"></turbo-frame>
<% unless content_for?(:native_modal) %>
<turbo-frame id="modal"></turbo-frame>
<% end %>
<turbo-frame id="drawer"></turbo-frame>
<%= render turbo_native_app? ? 'shared/native_navbar' : 'shared/navbar' %>
<% if flash.present? %><%= render 'shared/flash' %><% end %>
+14 -12
View File
@@ -1,14 +1,16 @@
<%= render 'shared/turbo_modal', title: t('reveal_api_key') do %>
<%= form_tag settings_reveal_access_token_path, enctype: 'multipart/form-data', data: { turbo_frame: :_top } do %>
<div class="form-control">
<%= label_tag :password, t('enter_your_password_to_reveal_the_api_key'), class: 'label' %>
<%= password_field_tag :password, nil, class: 'base-input', autocomplete: 'current-password', required: true, autofocus: true, placeholder: t('password') %>
<% if local_assigns[:error_message].present? %>
<span class="label-text-alt text-red-400 mt-1"><%= local_assigns[:error_message] %></span>
<% end %>
</div>
<div class="form-control mt-4">
<%= submit_tag t('submit'), class: 'base-button' %>
</div>
<% end %>
<native-event data-on="submit" data-name="native:turbo-stream" class="block">
<%= form_tag settings_reveal_access_token_path, enctype: 'multipart/form-data', data: { turbo_frame: :_top } do %>
<div class="form-control">
<%= label_tag :password, t('enter_your_password_to_reveal_the_api_key'), class: 'label' %>
<%= password_field_tag :password, nil, class: 'base-input', autocomplete: 'current-password', required: true, autofocus: true, placeholder: t('password') %>
<% if local_assigns[:error_message].present? %>
<span class="label-text-alt text-red-400 mt-1"><%= local_assigns[:error_message] %></span>
<% end %>
</div>
<div class="form-control mt-4">
<%= submit_tag t('submit'), class: 'base-button' %>
</div>
<% end %>
</native-event>
<% end %>
+5 -3
View File
@@ -1,3 +1,5 @@
<infinite-scroll id="infinite_scroll" class="<%= pagy.next ? 'col-span-full flex justify-center py-2' : 'hidden' %>" data-limit="<%= pagy.page * pagy.limit %>" data-src="<%= url_for(params: request.query_parameters.merge(local_assigns[:query_params].to_h).merge('page' => pagy.next)) if pagy.next %>">
<%= svg_icon('loader', class: 'w-6 h-6 animate-spin') if pagy.next %>
</infinite-scroll>
<% if pagy.next || pagy.page > 1 %>
<infinite-scroll id="infinite_scroll" class="col-span-full flex justify-center py-2" data-limit="<%= pagy.page * pagy.limit if pagy.page > 1 %>" data-src="<%= url_for(params: request.query_parameters.merge(local_assigns[:query_params].to_h).merge('page' => pagy.next)) if pagy.next %>">
<%= svg_icon('loader', class: 'w-6 h-6 animate-spin') %>
</infinite-scroll>
<% end %>
+1
View File
@@ -1,3 +1,4 @@
<script type="application/json" id="native_path_configuration"><%= render partial: 'layouts/native_path_configuration', formats: :json %></script>
<% if signed_in? %>
<native-action data-placement="profile" data-icon="user">
<%= link_to t('profile'), settings_profile_index_path %>
+2 -1
View File
@@ -1,4 +1,5 @@
<% if turbo_native_app? && !turbo_frame_request? %>
<% if turbo_native_ios? || (turbo_native_app? && !turbo_frame_request?) %>
<% content_for(:native_modal, 'true') %>
<% content_for(:html_title, local_assigns[:title]) if local_assigns[:title] %>
<turbo-frame id="modal">
<native-modal class="block max-w-lg mx-auto pb-6" data-close-after-submit="<%= local_assigns.key?(:close_after_submit) ? local_assigns[:close_after_submit] : true %>">
+1 -1
View File
@@ -387,6 +387,6 @@
</toggle-visible>
<% end %>
</main>
<% unless request.headers['HTTP_X_TURBO'] %>
<% unless request.headers['HTTP_X_TURBO_REQUEST_ID'] %>
<%= render 'scripts/autosize_field' %>
<% end %>
+1 -1
View File
@@ -93,7 +93,7 @@
</div>
<% else %>
<div class="flex-1 min-w-0 md:flex-none">
<%= render 'shared/clipboard_copy', text: submit_form_url(slug: submitter.slug, host: form_link_host), class: 'btn btn-sm max-sm:normal-case btn-neutral text-white md:w-36 flex z-[1]', icon_class: 'w-6 h-6 max-sm:w-5 max-sm:h-5 text-white', copy_title: t('copy_link').length < 10 ? t('copy_link') : t('copy'), copy_title_md: t('link'), copied_title_md: t('copied') %>
<%= render 'shared/clipboard_copy', text: submit_form_url(slug: submitter.slug, host: form_link_host), class: 'btn btn-sm max-sm:normal-case btn-neutral text-white md:w-36 flex z-[1]', icon_class: 'w-6 h-6 max-sm:w-[18px] max-sm:h-[18px] text-white', copy_title: t('copy_link').length < 10 ? t('copy_link') : t('copy'), copy_title_md: t('link'), copied_title_md: t('copied') %>
</div>
<% end %>
<% end %>
@@ -52,9 +52,11 @@
</ol>
<% unless webhook_event.status == 'pending' %>
<div class="absolute right-4 top-3">
<toggle-classes data-classes="btn-disabled">
<%= button_to button_title(title: t('resend'), disabled_with: t('awaiting'), icon: svg_icon('rotate', class: 'w-4 h-4'), icon_disabled: svg_icon('loader', class: 'w-4 h-4 animate-spin')), resend_settings_webhook_event_path(webhook_url.id, webhook_event.uuid), form: { id: button_uuid = SecureRandom.uuid }, params: { button_id: button_uuid }, class: 'btn btn-neutral btn-sm text-white', method: :post %>
</toggle-classes>
<native-event data-on="submit" data-name="native:turbo-stream" data-dismiss="false">
<toggle-classes data-classes="btn-disabled">
<%= button_to button_title(title: t('resend'), disabled_with: t('awaiting'), icon: svg_icon('rotate', class: 'w-4 h-4'), icon_disabled: svg_icon('loader', class: 'w-4 h-4 animate-spin')), resend_settings_webhook_event_path(webhook_url.id, webhook_event.uuid), form: { id: button_uuid = SecureRandom.uuid }, params: { button_id: button_uuid }, class: 'btn btn-neutral btn-sm text-white', method: :post %>
</toggle-classes>
</native-event>
</div>
<% end %>
</div>