mobile fixes

This commit is contained in:
Pete Matsyburka committed 2026-10-29 21:24:07 +02:00
1 parent 0a3f182e70
commit f9c12b9d78
23 files changed
+64 -45

No files matched your search

@@ -25,5 +25,7 @@ class SubmissionsExportController < ApplicationController
end end
end end
def new; end def new
render layout: turbo_native_android? ? 'plain' : true
end
end end
@@ -41,7 +41,9 @@ class TemplateFoldersController < ApplicationController
render_infinite_scroll(@pagy, @templates, @template_folders) if turbo_infinite_scroll? render_infinite_scroll(@pagy, @templates, @template_folders) if turbo_infinite_scroll?
end end
def edit; end def edit
render layout: turbo_native_android? ? 'plain' : true
end
def update def update
if @template_folder != current_account.default_template_folder && if @template_folder != current_account.default_template_folder &&
@@ -7,6 +7,8 @@ class TemplatesCloneController < ApplicationController
authorize!(:create, Template) authorize!(:create, Template)
@template = Template.new(name: "#{@base_template.name} (#{I18n.t('clone')})") @template = Template.new(name: "#{@base_template.name} (#{I18n.t('clone')})")
render layout: turbo_native_android? ? 'plain' : true
end end
def create def create
@@ -3,7 +3,9 @@
class TemplatesFoldersController < ApplicationController class TemplatesFoldersController < ApplicationController
load_and_authorize_resource :template load_and_authorize_resource :template
def edit; end def edit
render layout: turbo_native_android? ? 'plain' : true
end
def update def update
authorize!(:update, @template) authorize!(:update, @template)
+3 -1
View File
@@ -4,7 +4,9 @@ class UserInitialsController < ApplicationController
before_action :load_user_config before_action :load_user_config
authorize_resource :user_config authorize_resource :user_config
def edit; end def edit
render layout: turbo_native_android? ? 'plain' : true
end
def update def update
file = params[:file] file = params[:file]
@@ -4,7 +4,9 @@ class UserSignaturesController < ApplicationController
before_action :load_user_config before_action :load_user_config
authorize_resource :user_config authorize_resource :user_config
def edit; end def edit
render layout: turbo_native_android? ? 'plain' : true
end
def update def update
file = params[:file] file = params[:file]
+6 -2
View File
@@ -31,9 +31,13 @@ class UsersController < ApplicationController
end end
end end
def new; end def new
render layout: turbo_native_android? ? 'plain' : true
end
def edit; end def edit
render layout: turbo_native_android? ? 'plain' : true
end
def create def create
existing_user = User.accessible_by(current_ability).find_by(email: @user.email) existing_user = User.accessible_by(current_ability).find_by(email: @user.email)
+1 -1
View File
@@ -55,7 +55,7 @@ export default targetable(class extends HTMLElement {
this.input.files = dataTransfer.files this.input.files = dataTransfer.files
if (this.input.webkitEntries.length) { if (this.input.webkitEntries?.length) {
this.input.dataset.file = `${dataTransfer.files[0].name}` this.input.dataset.file = `${dataTransfer.files[0].name}`
} }
@@ -7,7 +7,7 @@
class="absolute top-0 bottom-0 right-0 left-0" class="absolute top-0 bottom-0 right-0 left-0"
@click.prevent="$emit('close')" @click.prevent="$emit('close')"
/> />
<div :class="inline ? 'px-4 pt-3 pb-6' : 'modal-box pt-4 pb-6 px-6 mt-20 w-full max-w-xl'"> <div :class="inline ? (nativePlatform === 'android' ? 'px-4 pt-1.5 pb-6' : 'px-4 pt-3 pb-6') : 'modal-box pt-4 pb-6 px-6 mt-20 w-full max-w-xl'">
<div <div
v-if="!inline" v-if="!inline"
class="flex justify-between items-center border-b pb-2 mb-2 font-medium" class="flex justify-between items-center border-b pb-2 mb-2 font-medium"
@@ -33,7 +33,7 @@
>{{ t('available_in_pro') }}</a> >{{ t('available_in_pro') }}</a>
</div> </div>
<form @submit.prevent="validateSaveAndClose"> <form @submit.prevent="validateSaveAndClose">
<div class="my-4"> <div :class="inline && nativePlatform === 'android' ? 'mt-1 mb-4' : 'my-4'">
<div <div
v-for="(condition, cindex) in conditions" v-for="(condition, cindex) in conditions"
:key="cindex" :key="cindex"
@@ -168,7 +168,7 @@
<script> <script>
export default { export default {
name: 'ConditionModal', name: 'ConditionModal',
inject: ['t', 'template', 'withConditions'], inject: ['t', 'template', 'withConditions', 'nativePlatform'],
props: { props: {
item: { item: {
type: Object, type: Object,
@@ -7,7 +7,7 @@
class="absolute top-0 bottom-0 right-0 left-0" class="absolute top-0 bottom-0 right-0 left-0"
@click.prevent="$emit('close')" @click.prevent="$emit('close')"
/> />
<div :class="inline ? 'px-4 pt-3 pb-6' : 'modal-box pt-4 pb-6 px-6 mt-20 max-h-none w-full max-w-xl'"> <div :class="inline ? (nativePlatform === 'android' ? 'px-4 pt-1.5 pb-6' : 'px-4 pt-3 pb-6') : 'modal-box pt-4 pb-6 px-6 mt-20 max-h-none w-full max-w-xl'">
<div <div
v-if="!inline" v-if="!inline"
class="flex justify-between items-center border-b pb-2 mb-2 font-medium" class="flex justify-between items-center border-b pb-2 mb-2 font-medium"
@@ -27,7 +27,7 @@
<div> <div>
<label <label
dir="auto" dir="auto"
class="label text-sm" :class="['label text-sm', { 'pt-0 mt-1': inline && nativePlatform === 'android' }]"
for="description_field" for="description_field"
> >
{{ t('description') }} {{ t('description') }}
@@ -71,7 +71,7 @@
<script> <script>
export default { export default {
name: 'DescriptionModal', name: 'DescriptionModal',
inject: ['t', 'template'], inject: ['t', 'template', 'nativePlatform'],
props: { props: {
field: { field: {
type: Object, type: Object,
@@ -7,7 +7,7 @@
class="absolute top-0 bottom-0 right-0 left-0" class="absolute top-0 bottom-0 right-0 left-0"
@click.prevent="$emit('close')" @click.prevent="$emit('close')"
/> />
<div :class="inline ? 'px-4 pt-3 pb-6' : 'modal-box pt-4 pb-6 px-6 mt-20 max-h-none w-full max-w-xl'"> <div :class="inline ? (nativePlatform === 'android' ? 'px-4 pt-1.5 pb-6' : 'px-4 pt-3 pb-6') : 'modal-box pt-4 pb-6 px-6 mt-20 max-h-none w-full max-w-xl'">
<div <div
v-if="!inline" v-if="!inline"
class="flex justify-between items-center border-b pb-2 mb-2 font-medium" class="flex justify-between items-center border-b pb-2 mb-2 font-medium"
@@ -21,7 +21,7 @@
@click.prevent="$emit('close')" @click.prevent="$emit('close')"
>&times;</a> >&times;</a>
</div> </div>
<div class="mt-4"> <div :class="inline && nativePlatform === 'android' ? 'mt-1' : 'mt-4'">
<div> <div>
<div class="flex flex-wrap items-center gap-1.5"> <div class="flex flex-wrap items-center gap-1.5">
<span> <span>
@@ -200,7 +200,7 @@ export default {
components: { components: {
IconChevronDown IconChevronDown
}, },
inject: ['t', 'template'], inject: ['t', 'template', 'nativePlatform'],
props: { props: {
field: { field: {
type: Object, type: Object,
@@ -7,7 +7,7 @@
class="absolute top-0 bottom-0 right-0 left-0" class="absolute top-0 bottom-0 right-0 left-0"
@click.prevent="$emit('close')" @click.prevent="$emit('close')"
/> />
<div :class="inline ? 'px-4 pt-3 pb-6' : 'modal-box pt-4 pb-6 px-6 mt-20 max-h-none w-full max-w-xl'"> <div :class="inline ? (nativePlatform === 'android' ? 'px-4 pt-1.5 pb-6' : 'px-4 pt-3 pb-6') : 'modal-box pt-4 pb-6 px-6 mt-20 max-h-none w-full max-w-xl'">
<div <div
v-if="!inline" v-if="!inline"
class="flex justify-between items-center border-b pb-2 mb-2 font-medium" class="flex justify-between items-center border-b pb-2 mb-2 font-medium"
@@ -32,7 +32,7 @@
class="link" class="link"
>{{ t('available_in_pro') }}</a> >{{ t('available_in_pro') }}</a>
</div> </div>
<div class="flex flex-wrap mb-2 gap-y-1 pt-1"> <div :class="['flex flex-wrap mb-2 gap-y-1', inline && nativePlatform === 'android' ? 'mt-1' : 'pt-1']">
<button <button
v-for="f in fields" v-for="f in fields"
:key="f.uuid" :key="f.uuid"
@@ -152,7 +152,7 @@ export default {
IconCodePlus, IconCodePlus,
IconMathFunction IconMathFunction
}, },
inject: ['t', 'template', 'withFormula'], inject: ['t', 'template', 'withFormula', 'nativePlatform'],
props: { props: {
field: { field: {
type: Object, type: Object,
@@ -5,7 +5,7 @@
class="absolute top-0 bottom-0 right-0 left-0" class="absolute top-0 bottom-0 right-0 left-0"
@click.prevent="$emit('close')" @click.prevent="$emit('close')"
/> />
<div :class="inline ? 'px-4 pt-3 pb-6' : 'modal-box pt-4 pb-6 mt-20 w-full'"> <div :class="inline ? (nativePlatform === 'android' ? 'px-4 pt-1.5 pb-6' : 'px-4 pt-3 pb-6') : 'modal-box pt-4 pb-6 mt-20 w-full'">
<div <div
v-if="!inline" v-if="!inline"
class="flex justify-between items-center border-b pb-2 mb-3 font-medium" class="flex justify-between items-center border-b pb-2 mb-3 font-medium"
@@ -63,7 +63,7 @@ import { IconUser, IconInnerShadowTop } from '@tabler/icons-vue'
export default { export default {
name: 'RevisionsModal', name: 'RevisionsModal',
components: { IconUser, IconInnerShadowTop }, components: { IconUser, IconInnerShadowTop },
inject: ['t', 'baseFetch'], inject: ['t', 'baseFetch', 'nativePlatform'],
props: { props: {
template: { template: {
type: Object, type: Object,
@@ -1,7 +1,9 @@
<form action="<%= url_for %>" method="get" class="dropdown dropdown-top hidden md:inline"> <form action="<%= url_for %>" method="get" class="dropdown dropdown-top hidden md:inline">
<label tabindex="0" class="btn btn-sm h-10"> <% unless turbo_native_app? %>
<%= svg_icon('arrow_sort', class: 'w-5 h-5') %> <label tabindex="0" class="btn btn-sm h-10">
</label> <%= svg_icon('arrow_sort', class: 'w-5 h-5') %>
</label>
<% end %>
<ul tabindex="0" class="dropdown-content z-[10] menu p-2 shadow bg-base-100 rounded-box mb-1 min-w-48"> <ul tabindex="0" class="dropdown-content z-[10] menu p-2 shadow bg-base-100 rounded-box mb-1 min-w-48">
<native-action class="contents" data-menu="<%= t('sort_by') %>" data-menu-icon="arrow_sort" data-icon="sort_descending_numbers" data-selected="<%= selected_order == 'created_at' %>"> <native-action class="contents" data-menu="<%= t('sort_by') %>" data-menu-icon="arrow_sort" data-icon="sort_descending_numbers" data-selected="<%= selected_order == 'created_at' %>">
<toggle-cookies data-value="created_at" data-key="dashboard_templates_order"> <toggle-cookies data-value="created_at" data-key="dashboard_templates_order">
+1 -1
View File
@@ -1,6 +1,6 @@
<% filter_params = params.permit(:q, :archived, *Submissions::Filter::ALLOWED_PARAMS) %> <% filter_params = params.permit(:q, :archived, *Submissions::Filter::ALLOWED_PARAMS) %>
<%= render 'shared/turbo_modal', title: t('export'), close_after_submit: false do %> <%= render 'shared/turbo_modal', title: t('export'), close_after_submit: false do %>
<div class="space-y-2 <%= 'mt-1.5' if turbo_native_android? %>"> <div class="space-y-2 <%= 'mt-1.5 px-4' if turbo_native_android? %>">
<%= button_to template_submissions_export_index_path(@template), params: { format: :xlsx, **filter_params }, method: :get, data: { turbo_frame: :_top } do %> <%= button_to template_submissions_export_index_path(@template), params: { format: :xlsx, **filter_params }, method: :get, data: { turbo_frame: :_top } do %>
<div class="flex items-center p-4 text-left rounded-2xl border border-neutral-300 hover:cursor-pointer hover:bg-neutral hover:text-gray-300"> <div class="flex items-center p-4 text-left rounded-2xl border border-neutral-300 hover:cursor-pointer hover:bg-neutral hover:text-gray-300">
<div class="enabled"> <div class="enabled">
@@ -3,11 +3,11 @@
<div class="flex flex-col md:flex-row gap-2"> <div class="flex flex-col md:flex-row gap-2">
<div class="form-control w-full"> <div class="form-control w-full">
<%= label_tag 'completed_at_from', t('from'), for: 'date_from', class: 'label text-sm' %> <%= label_tag 'completed_at_from', t('from'), for: 'date_from', class: 'label text-sm' %>
<%= date_field_tag 'completed_at_from', params[:completed_at_from], id: 'date_from', class: 'base-input !h-10 w-full', autocomplete: 'off' %> <%= date_field_tag 'completed_at_from', params[:completed_at_from], id: 'date_from', class: "base-input !h-10 #{'w-full' if turbo_native_android?}", autocomplete: 'off' %>
</div> </div>
<div class="form-control w-full"> <div class="form-control w-full">
<%= label_tag 'completed_at_to', t('to'), for: 'date_to', class: 'label text-sm' %> <%= label_tag 'completed_at_to', t('to'), for: 'date_to', class: 'label text-sm' %>
<%= date_field_tag 'completed_at_to', params[:completed_at_to], id: 'date_to', class: 'base-input !h-10 w-full', autocomplete: 'off' %> <%= date_field_tag 'completed_at_to', params[:completed_at_to], id: 'date_to', class: "base-input !h-10 #{'w-full' if turbo_native_android?}", autocomplete: 'off' %>
</div> </div>
</div> </div>
<%= render 'date_buttons' %> <%= render 'date_buttons' %>
@@ -3,11 +3,11 @@
<div class="flex flex-col md:flex-row gap-2"> <div class="flex flex-col md:flex-row gap-2">
<div class="form-control w-full"> <div class="form-control w-full">
<%= label_tag 'created_at_from', t('from'), for: 'date_from', class: 'label text-sm' %> <%= label_tag 'created_at_from', t('from'), for: 'date_from', class: 'label text-sm' %>
<%= date_field_tag 'created_at_from', params[:created_at_from], id: 'date_from', class: 'base-input !h-10 w-full', autocomplete: 'off' %> <%= date_field_tag 'created_at_from', params[:created_at_from], id: 'date_from', class: "base-input !h-10 #{'w-full' if turbo_native_android?}", autocomplete: 'off' %>
</div> </div>
<div class="form-control w-full"> <div class="form-control w-full">
<%= label_tag 'created_at_to', t('to'), for: 'date_to', class: 'label text-sm' %> <%= label_tag 'created_at_to', t('to'), for: 'date_to', class: 'label text-sm' %>
<%= date_field_tag 'created_at_to', params[:created_at_to], id: 'date_to', class: 'base-input !h-10 w-full', autocomplete: 'off' %> <%= date_field_tag 'created_at_to', params[:created_at_to], id: 'date_to', class: "base-input !h-10 #{'w-full' if turbo_native_android?}", autocomplete: 'off' %>
</div> </div>
</div> </div>
<%= render 'date_buttons' %> <%= render 'date_buttons' %>
+2 -2
View File
@@ -1,6 +1,6 @@
<%= render 'shared/turbo_modal', title: t('rename_folder') do %> <%= render 'shared/turbo_modal', title: t('rename_folder') do %>
<%= form_for @template_folder, url: folder_path(@template_folder), data: { turbo_frame: :_top }, html: { autocomplete: :off } do |f| %> <%= form_for @template_folder, url: folder_path(@template_folder), data: { turbo_frame: :_top }, html: { autocomplete: :off, class: ('px-4' if turbo_native_android?) } do |f| %>
<div class="form-control my-6"> <div class="form-control <%= turbo_native_android? ? 'mt-1.5 mb-6' : 'my-6' %>">
<%= f.text_field :name, required: true, placeholder: "#{t('folder_name')}...", class: 'base-input w-full', autofocus: true, dir: 'auto' %> <%= f.text_field :name, required: true, placeholder: "#{t('folder_name')}...", class: 'base-input w-full', autofocus: true, dir: 'auto' %>
</div> </div>
<div class="form-control"> <div class="form-control">
+5 -4
View File
@@ -1,11 +1,12 @@
<%= form_for @template, url: template_clone_index_path(@base_template), data: { turbo_frame: :_top }, html: { autocomplete: :off } do |f| %> <%= form_for @template, url: template_clone_index_path(@base_template), data: { turbo_frame: :_top }, html: { autocomplete: :off, class: ('px-4' if turbo_native_android?) } do |f| %>
<% accounts = Account.accessible_by(true_ability).where.not(id: true_user.account.testing_accounts).where(User.where(User.arel_table[:account_id].eq(Account.arel_table[:id])).arel.exists).active %> <% accounts = Account.accessible_by(true_ability).where.not(id: true_user.account.testing_accounts).where(User.where(User.arel_table[:account_id].eq(Account.arel_table[:id])).arel.exists).active %>
<% if (can?(:manage, :tenants) || true_user != current_user) && accounts.where.not(id: current_account.id).exists? %> <% with_accounts = (can?(:manage, :tenants) || true_user != current_user) && accounts.where.not(id: current_account.id).exists? %>
<div class="form-control -mb-2 mt-2"> <% if with_accounts %>
<div class="form-control -mb-2 <%= turbo_native_android? ? 'mt-1.5' : 'mt-2' %>">
<%= select_tag :account_id, options_for_select([current_account, *accounts.order(:name)].uniq.map { |e| [e.name, e.id] }, current_account.id), required: true, class: 'base-select' %> <%= select_tag :account_id, options_for_select([current_account, *accounts.order(:name)].uniq.map { |e| [e.name, e.id] }, current_account.id), required: true, class: 'base-select' %>
</div> </div>
<% end %> <% end %>
<div class="form-control mt-4"> <div class="form-control <%= turbo_native_android? && !with_accounts ? 'mt-1.5' : 'mt-4' %>">
<%= f.text_field :name, required: true, placeholder: t('document_name'), class: 'base-input', dir: 'auto' %> <%= f.text_field :name, required: true, placeholder: t('document_name'), class: 'base-input', dir: 'auto' %>
</div> </div>
<div class="mt-3 mb-4 flex items-center justify-between"> <div class="mt-3 mb-4 flex items-center justify-between">
+2 -2
View File
@@ -1,7 +1,7 @@
<% with_subfolder = @template.folder.name != TemplateFolder::DEFAULT_NAME && params[:subfolder] != 'false' %> <% with_subfolder = @template.folder.name != TemplateFolder::DEFAULT_NAME && params[:subfolder] != 'false' %>
<%= render 'shared/turbo_modal', title: t('move_into_folder') do %> <%= render 'shared/turbo_modal', title: t('move_into_folder') do %>
<% if with_subfolder %> <% if with_subfolder %>
<%= form_for '', url: template_folder_path(@template), method: :put, data: { turbo_frame: :_top }, html: { id: 'subfolder_form', autocomplete: :off } do |f| %> <%= form_for '', url: template_folder_path(@template), method: :put, data: { turbo_frame: :_top }, html: { id: 'subfolder_form', autocomplete: :off, class: ('px-4' if turbo_native_android?) } do |f| %>
<%= f.hidden_field :parent_name, value: @template.folder.parent_folder&.name || @template.folder.name %> <%= f.hidden_field :parent_name, value: @template.folder.parent_folder&.name || @template.folder.name %>
<toggle-visible data-element-ids="<%= %w[folder_form subfolder_form].to_json %>" class="block relative" data-focus-id="name"> <toggle-visible data-element-ids="<%= %w[folder_form subfolder_form].to_json %>" class="block relative" data-focus-id="name">
<div class="flex items-center justify-between mb-2.5"> <div class="flex items-center justify-between mb-2.5">
@@ -25,7 +25,7 @@
</div> </div>
<% end %> <% end %>
<% end %> <% end %>
<%= form_for '', url: template_folder_path(@template), method: :put, data: { turbo_frame: :_top }, html: { id: 'folder_form', autocomplete: :off, class: "mt-6 #{'hidden' if with_subfolder}" } do |f| %> <%= form_for '', url: template_folder_path(@template), method: :put, data: { turbo_frame: :_top }, html: { id: 'folder_form', autocomplete: :off, class: "#{turbo_native_android? ? 'mt-1.5 px-4' : 'mt-6'} #{'hidden' if with_subfolder}" } do |f| %>
<div class="form-control mb-6"> <div class="form-control mb-6">
<folder-autocomplete class="block" data-submit-on-select="true" data-enabled="<%= params[:autocomplete] != 'false' %>"> <folder-autocomplete class="block" data-submit-on-select="true" data-enabled="<%= params[:autocomplete] != 'false' %>">
<%= f.text_field :name, required: true, placeholder: "#{t('new_folder_name')}...", class: 'base-input w-full', autofocus: true %> <%= f.text_field :name, required: true, placeholder: "#{t('new_folder_name')}...", class: 'base-input w-full', autofocus: true %>
+3 -3
View File
@@ -1,6 +1,6 @@
<%= render 'shared/turbo_modal', title: t('update_initials') do %> <%= render 'shared/turbo_modal', title: t('update_initials') do %>
<% options = [[t('draw'), 'draw'], [t('upload'), 'upload']] %> <% options = [[t('draw'), 'draw'], [t('upload'), 'upload']] %>
<toggle-visible data-element-ids="<%= options.map(&:last).to_json %>" class="relative text-center block <%= 'mt-4' unless turbo_native_app? %>"> <toggle-visible data-element-ids="<%= options.map(&:last).to_json %>" class="relative text-center block <%= turbo_native_app? ? ('mt-1.5' if turbo_native_android?) : 'mt-4' %>">
<div class="join"> <div class="join">
<% options.each_with_index do |(label, value), index| %> <% options.each_with_index do |(label, value), index| %>
<span> <span>
@@ -12,7 +12,7 @@
<% end %> <% end %>
</div> </div>
</toggle-visible> </toggle-visible>
<div id="draw" class="mt-3"> <div id="draw" class="mt-3 <%= 'px-4' if turbo_native_android? %>">
<%= form_for @user_config, url: user_initials_path, method: :put, data: { turbo_frame: :_top }, html: { autocomplete: :off, enctype: 'multipart/form-data' } do |f| %> <%= form_for @user_config, url: user_initials_path, method: :put, data: { turbo_frame: :_top }, html: { autocomplete: :off, enctype: 'multipart/form-data' } do |f| %>
<signature-form class="relative block"> <signature-form class="relative block">
<a class="absolute top-1 right-1 link text-sm" data-target="signature-form.clear" href="#"><%= t('clear') %></a> <a class="absolute top-1 right-1 link text-sm" data-target="signature-form.clear" href="#"><%= t('clear') %></a>
@@ -24,7 +24,7 @@
</signature-form> </signature-form>
<% end %> <% end %>
</div> </div>
<div id="upload" class="hidden mt-3"> <div id="upload" class="hidden mt-3 <%= 'px-4' if turbo_native_android? %>">
<%= form_for @user_config, url: user_initials_path, method: :put, data: { turbo_frame: :_top }, html: { autocomplete: :off, enctype: 'multipart/form-data' } do |f| %> <%= form_for @user_config, url: user_initials_path, method: :put, data: { turbo_frame: :_top }, html: { autocomplete: :off, enctype: 'multipart/form-data' } do |f| %>
<file-dropzone data-submit-on-upload="true" class="w-full"> <file-dropzone data-submit-on-upload="true" class="w-full">
<label for="file" class="w-full block h-32 relative bg-base-200 hover:bg-base-200/70 rounded-md border border-base-content border-dashed"> <label for="file" class="w-full block h-32 relative bg-base-200 hover:bg-base-200/70 rounded-md border border-base-content border-dashed">
+3 -3
View File
@@ -1,6 +1,6 @@
<%= render 'shared/turbo_modal', title: t('update_signature') do %> <%= render 'shared/turbo_modal', title: t('update_signature') do %>
<% options = [[t('draw'), 'draw'], [t('upload'), 'upload']] %> <% options = [[t('draw'), 'draw'], [t('upload'), 'upload']] %>
<toggle-visible data-element-ids="<%= options.map(&:last).to_json %>" class="relative text-center block <%= 'mt-4' unless turbo_native_app? %>"> <toggle-visible data-element-ids="<%= options.map(&:last).to_json %>" class="relative text-center block <%= turbo_native_app? ? ('mt-1.5' if turbo_native_android?) : 'mt-4' %>">
<div class="join"> <div class="join">
<% options.each_with_index do |(label, value), index| %> <% options.each_with_index do |(label, value), index| %>
<span> <span>
@@ -12,7 +12,7 @@
<% end %> <% end %>
</div> </div>
</toggle-visible> </toggle-visible>
<div id="draw" class="mt-3"> <div id="draw" class="mt-3 <%= 'px-4' if turbo_native_android? %>">
<%= form_for @user_config, url: user_signature_path, method: :put, data: { turbo_frame: :_top }, html: { autocomplete: :off, enctype: 'multipart/form-data' } do |f| %> <%= form_for @user_config, url: user_signature_path, method: :put, data: { turbo_frame: :_top }, html: { autocomplete: :off, enctype: 'multipart/form-data' } do |f| %>
<signature-form class="relative block"> <signature-form class="relative block">
<a class="absolute top-1 right-1 link text-sm" data-target="signature-form.clear" href="#"><%= t('clear') %></a> <a class="absolute top-1 right-1 link text-sm" data-target="signature-form.clear" href="#"><%= t('clear') %></a>
@@ -24,7 +24,7 @@
</signature-form> </signature-form>
<% end %> <% end %>
</div> </div>
<div id="upload" class="hidden mt-3"> <div id="upload" class="hidden mt-3 <%= 'px-4' if turbo_native_android? %>">
<%= form_for @user_config, url: user_signature_path, method: :put, data: { turbo_frame: :_top }, html: { autocomplete: :off, enctype: 'multipart/form-data' } do |f| %> <%= form_for @user_config, url: user_signature_path, method: :put, data: { turbo_frame: :_top }, html: { autocomplete: :off, enctype: 'multipart/form-data' } do |f| %>
<file-dropzone data-submit-on-upload="true" class="w-full"> <file-dropzone data-submit-on-upload="true" class="w-full">
<label for="file" class="w-full block h-32 relative bg-base-200 hover:bg-base-200/70 rounded-md border border-base-content border-dashed"> <label for="file" class="w-full block h-32 relative bg-base-200 hover:bg-base-200/70 rounded-md border border-base-content border-dashed">
+1 -1
View File
@@ -1,4 +1,4 @@
<%= form_for user, html: { class: 'space-y-4' }, data: { turbo_frame: :_top } do |f| %> <%= form_for user, html: { class: "space-y-4 #{'px-4' if turbo_native_android?}" }, data: { turbo_frame: :_top } do |f| %>
<div class="space-y-2"> <div class="space-y-2">
<div class="flex space-x-4"> <div class="flex space-x-4">
<div class="w-full"> <div class="w-full">