mirror of
https://github.com/docusealco/docuseal
synced 2026-11-10 15:42:32 -05:00
make template form preview native
This commit is contained in:
1 parent
be621339c3
commit
49afb2e87c
5 files changed
+48
-31
No files matched your search
@@ -1,26 +1,38 @@
|
||||
<% banner_html = capture do %>
|
||||
<div class="sticky top-0 z-50 bg-base-100 py-2 px-2 flex items-center" style="margin: 0px -8px -16px -8px">
|
||||
<div class="text-xl md:text-3xl font-semibold focus:text-clip" style="width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
|
||||
<%= @template.name %>
|
||||
</div>
|
||||
<div class="flex items-center" style="margin-left: 20px; flex-shrink: 0">
|
||||
<% if @template.submitters.size > 1 %>
|
||||
<form action="<%= template_form_path(@template) %>" method="get" class="mr-3">
|
||||
<submit-form data-on="change">
|
||||
<select name="uuid" class="select base-input text-center font-normal" style="width: 180px; flex-shrink: 0;">
|
||||
<% @template.submitters.each do |submitter| %>
|
||||
<%= tag.option(value: submitter['uuid'], selected: submitter['uuid'] == @submitter.uuid) do %>
|
||||
<%= submitter['name'] %>
|
||||
<% if turbo_native_app? %>
|
||||
<% content_for(:native_title, @template.name) %>
|
||||
<% if @template.submitters.size > 1 %>
|
||||
<% @template.submitters.each do |submitter| %>
|
||||
<native-action data-section="submitter" data-label="<%= submitter['name'] %>" data-selected="<%= submitter['uuid'] == @submitter.uuid %>">
|
||||
<a href="<%= template_form_path(@template, uuid: submitter['uuid']) %>"></a>
|
||||
</native-action>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% banner_html = '' %>
|
||||
<% else %>
|
||||
<% banner_html = capture do %>
|
||||
<div class="sticky top-0 z-50 bg-base-100 py-2 px-2 flex items-center" style="margin: 0px -8px -16px -8px">
|
||||
<div class="text-xl md:text-3xl font-semibold focus:text-clip" style="width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
|
||||
<%= @template.name %>
|
||||
</div>
|
||||
<div class="flex items-center" style="margin-left: 20px; flex-shrink: 0">
|
||||
<% if @template.submitters.size > 1 %>
|
||||
<form action="<%= template_form_path(@template) %>" method="get" class="mr-3">
|
||||
<submit-form data-on="change">
|
||||
<select name="uuid" class="select base-input text-center font-normal" style="width: 180px; flex-shrink: 0;">
|
||||
<% @template.submitters.each do |submitter| %>
|
||||
<%= tag.option(value: submitter['uuid'], selected: submitter['uuid'] == @submitter.uuid) do %>
|
||||
<%= submitter['name'] %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</select>
|
||||
</submit-form>
|
||||
</form>
|
||||
<% end %>
|
||||
<a href="<%= edit_template_path(@template) %>" class="base-button" data-turbo="false" style="flex-shrink: 0; padding: 0px 24px;">
|
||||
<%= t('exit_preview') %>
|
||||
</a>
|
||||
</select>
|
||||
</submit-form>
|
||||
</form>
|
||||
<% end %>
|
||||
<a href="<%= edit_template_path(@template) %>" class="base-button" data-turbo="false" style="flex-shrink: 0; padding: 0px 24px;">
|
||||
<%= t('exit_preview') %>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%= render template: 'submit_form/show', locals: { dry_run: true, expand: false, banner_html:, scroll_padding: '-120px' } %>
|
||||
<%= render template: 'submit_form/show', locals: { dry_run: true, expand: false, banner_html:, scroll_padding: turbo_native_app? ? '-80px' : '-120px' } %>
|
||||
Reference in new issue
Block a user