mirror of
https://github.com/docusealco/docuseal
synced 2026-11-06 23:12:33 -05:00
add builder drawer
This commit is contained in:
1 parent
79f72c92b3
commit
d29be7c2cf
12 files changed
+299
-57
No files matched your search
@@ -1,4 +1,4 @@
|
||||
<% content_for(:native_title, @template.name) if turbo_native_app? %>
|
||||
<% content_for(:native_title, params[:view] == 'revisions' ? t('revisions') : @template.name) if turbo_native_app? %>
|
||||
<% if !turbo_native_app? && (current_user.created_at > 2.weeks.ago || params[:tour] == 'true') %>
|
||||
<% user_config = current_user.user_configs.find_or_initialize_by(key: UserConfig::SHOW_APP_TOUR) %>
|
||||
<% @show_tour_start_form = user_config.new_record? && !params.key?(:tour) %>
|
||||
@@ -10,4 +10,4 @@
|
||||
<% account_configs = current_account.account_configs.where(key: [AccountConfig::TEMPLATE_CUSTOM_FIELDS_KEY, AccountConfig::TEMPLATE_DATE_FORMATS_KEY]).to_a %>
|
||||
<% custom_fields = account_configs.find { |e| e.key == AccountConfig::TEMPLATE_CUSTOM_FIELDS_KEY }&.value || [] %>
|
||||
<% date_formats = account_configs.find { |e| e.key == AccountConfig::TEMPLATE_DATE_FORMATS_KEY }&.value || [] %>
|
||||
<template-builder data-native-platform="<%= turbo_native_ios? ? 'ios' : (turbo_native_android? ? 'android' : '') %>" class="grid" data-template="<%= @template_data.to_json %>" data-custom-fields="<%= custom_fields.to_json %>" data-date-formats="<%= date_formats.to_json %>" data-with-sign-yourself-button="<%= !@template.archived_at? %>" data-with-fields-detection="true" data-with-send-button="<%= !@template.archived_at? && can?(:create, @template.submissions.new(account: current_account)) %>" data-with-revisions-menu="<%= @template.template_versions.exists? %>" data-locale="<%= I18n.locale %>" data-show-tour-start-form="<%= @show_tour_start_form %>"></template-builder>
|
||||
<template-builder data-view="<%= params[:view] %>" data-native-platform="<%= turbo_native_ios? ? 'ios' : (turbo_native_android? ? 'android' : '') %>" class="grid" data-template="<%= @template_data.to_json %>" data-custom-fields="<%= custom_fields.to_json %>" data-date-formats="<%= date_formats.to_json %>" data-with-sign-yourself-button="<%= !@template.archived_at? %>" data-with-fields-detection="true" data-with-send-button="<%= !@template.archived_at? && can?(:create, @template.submissions.new(account: current_account)) %>" data-with-revisions-menu="<%= @template.template_versions.exists? %>" data-locale="<%= I18n.locale %>" data-show-tour-start-form="<%= @show_tour_start_form %>"></template-builder>
|
||||
@@ -1,24 +0,0 @@
|
||||
<%= render 'shared/turbo_modal', title: t('revisions') do %>
|
||||
<ul class="space-y-1.5">
|
||||
<% @versions.each do |version| %>
|
||||
<li>
|
||||
<native-event class="group flex justify-between items-center gap-2 w-full rounded-lg p-3 border border-dashed border-base-200 cursor-pointer" data-name="template-builder:apply-revision" data-src="<%= template_version_path(@template, version) %>">
|
||||
<div class="flex flex-col min-w-0">
|
||||
<span><%= l(version.created_at.in_time_zone(current_account.timezone), format: :short, locale: current_account.locale) %></span>
|
||||
<span class="-ml-0.5 flex items-center space-x-1 text-xs text-base-content/60 mt-0.5">
|
||||
<%= svg_icon('user', class: 'w-3.5 h-3.5 flex-shrink-0') %>
|
||||
<span class="truncate"><%= version.author.full_name.presence || version.author.email %></span>
|
||||
</span>
|
||||
</div>
|
||||
<span class="btn btn-sm btn-neutral text-white pointer-events-none flex-shrink-0">
|
||||
<span class="group-data-[loading]:hidden"><%= t('view') %></span>
|
||||
<%= svg_icon('loader', class: 'w-4 h-4 animate-spin hidden group-data-[loading]:block') %>
|
||||
</span>
|
||||
</native-event>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if @versions.empty? %>
|
||||
<li class="py-4 text-center text-base-content/60"><%= t('no_revisions_yet') %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
Reference in new issue
Block a user