update storage config template

pull/105/head
Alex Turchyn 2 years ago
parent 8b760281d2
commit 7234915818

@ -1,10 +1,8 @@
<div class="max-w-6xl mx-auto px-2 py-3">
<%= link_to 'Create Template', new_template_path, data: { turbo_frame: :modal } %> <%= link_to 'Create Template', new_template_path, data: { turbo_frame: :modal } %>
<% @templates.each do |template| %> <% @templates.each do |template| %>
<div> <div>
<%= template.name %> | <%= template.name %> |
<a href="<%= template_path(template) %>">edit</a> | <a href="<%= template_path(template) %>">edit</a> |
<a href="<%= template_submissions_path(template) %>">submissions</a> | <a href="<%= template_submissions_path(template) %>">submissions</a> |
</div> </div>
<% end %> <% end %>
</div>

@ -1,17 +1,19 @@
<div class="max-w-6xl mx-auto"> <div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0 md:space-x-16">
<div class="flex space-x-8"> <%= render 'shared/settings_nav' %>
<%= render 'shared/settings_nav' %> <div class="flex-grow max-w-xl">
<div class="mt-4"> <h1 class="text-4xl font-bold mb-4">eSign</h1>
<%= form_for '', url: settings_esign_index_path, method: :post do |f| %> <p>
<file-dropzone data-name="verify_attachments"> Upload your electronic signature
<label for="file"> </p>
<input id="attachment_uuid" name="attachment_uuid" class="hidden" data-target="file-dropzone.valueField" type="text" autocomplete="off"> <%= form_for '', url: settings_esign_index_path, method: :post do |f| %>
<input id="file" class="hidden" data-action="change:file-dropzone#onSelectFiles" data-target="file-dropzone.input" type="file"> <file-dropzone data-name="verify_attachments" class="">
LCick to upload <label for="file">
</label> <input id="attachment_uuid" name="attachment_uuid" class="hidden" data-target="file-dropzone.valueField" type="text" autocomplete="off">
</file-dropzone> <input id="file" class="hidden" data-action="change:file-dropzone#onSelectFiles" data-target="file-dropzone.input" type="file">
<%= f.button button_title %> Cick to upload
<% end %> </label>
</div> </file-dropzone>
<%= f.button button_title %>
<% end %>
</div> </div>
</div> </div>

@ -17,7 +17,7 @@
<% if flash.present? %> <% if flash.present? %>
<div id="flash" class="absolute top-0 w-full"> <div id="flash" class="absolute top-0 w-full">
<div class="max-w-xl mx-auto mt-1.5"> <div class="max-w-xl mx-auto mt-1.5">
<div class="alert shadow-lg py-3"> <div class="alert py-3">
<div class="flex w-full justify-between"> <div class="flex w-full justify-between">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="stroke-info flex-shrink-0 w-6 h-6"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg> <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="stroke-info flex-shrink-0 w-6 h-6"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
<span class="w-full"><%= flash[:notice] || flash[:alert] %></span> <span class="w-full"><%= flash[:notice] || flash[:alert] %></span>
@ -27,7 +27,7 @@
</div> </div>
</div> </div>
<% end %> <% end %>
<div class="max-w-6xl mx-auto px-4 md:px-0"> <div class="max-w-6xl mx-auto px-4 md:px-2">
<%= yield %> <%= yield %>
</div> </div>
</body> </body>

@ -1,4 +1,4 @@
<div class="max-w-6xl mb-4 mx-auto px-2 py-3 flex items-center justify-between"> <div class="max-w-6xl mb-4 mx-auto px-4 md:px-2 py-3 flex items-center justify-between">
<a href="<%= root_path %>" class="text-2xl font-bold items-center flex space-x-2"> <a href="<%= root_path %>" class="text-2xl font-bold items-center flex space-x-2">
<%= render 'shared/logo' %> <%= render 'shared/logo' %>
<span>DocuSeal</span> <span>DocuSeal</span>
@ -12,7 +12,7 @@
</label> </label>
<ul tabindex="0" class="dropdown-content p-2 mt-2 shadow-2xl menu bg-white rounded-box whitespace-nowrap"> <ul tabindex="0" class="dropdown-content p-2 mt-2 shadow-2xl menu bg-white rounded-box whitespace-nowrap">
<li class> <li class>
<%= link_to 'Profile', '', class: 'text-right' %> <%= link_to 'Profile', settings_profile_index_path, class: 'text-right' %>
</li> </li>
<li class> <li class>
<%= link_to 'Sign out', destroy_user_session_path, data: { turbo_method: :delete } %> <%= link_to 'Sign out', destroy_user_session_path, data: { turbo_method: :delete } %>

@ -1,32 +1,22 @@
<menu-active class="block w-full md:w-52"> <menu-active class="block w-full md:w-52">
<div class="-ml-3.5"> <div class="-ml-3.5">
<ul class="menu menu-compact px-2"> <ul class="menu menu-compact px-2 space-y-1">
<li class="menu-title"><span>Settings</span></li> <li class="menu-title"><span>Settings</span></li>
<li></li> <li></li>
<li> <li>
<a href="<%= settings_profile_index_path %>" class="hover:bg-base-300 text-base"> <%= link_to 'Profile', settings_profile_index_path, class: "text-base hover:bg-base-300" %>
Profile
</a>
</li> </li>
<li> <li>
<a href="<%= settings_email_index_path %>" class="hover:bg-base-300 text-base"> <%= link_to 'Email', settings_email_index_path, class: "text-base hover:bg-base-300" %>
Email
</a>
</li> </li>
<li> <li>
<a href="<%= settings_storage_index_path %>" class="hover:bg-base-300 text-base"> <%= link_to 'Storage', settings_storage_index_path, class: "text-base hover:bg-base-300" %>
Storage
</a>
</li> </li>
<li> <li>
<a href="<%= settings_esign_index_path %>" class="hover:bg-base-300 text-base"> <%= link_to 'eSign', settings_esign_index_path, class: "text-base hover:bg-base-300" %>
eSign
</a>
</li> </li>
<li> <li>
<a href="<%= settings_users_path %>" class="hover:bg-base-300 text-base"> <%= link_to 'Team', settings_users_path, class: "text-base hover:bg-base-300" %>
Team
</a>
</li> </li>
</ul> </ul>
</div> </div>

@ -1,28 +1,32 @@
<%= f.fields_for :value do |ff| %> <%= f.fields_for :value do |ff| %>
<%= ff.hidden_field :service, value: 'aws_s3' %> <%= ff.hidden_field :service, value: 'aws_s3' %>
<%= ff.fields_for :configs, configs do |fff| %> <%= ff.fields_for :configs, configs do |fff| %>
<div> <div class="grid md:grid-cols-2 gap-4">
<%= fff.label :access_key_id, 'Access key ID' %> <div class="form-control">
<%= fff.text_field :access_key_id, value: configs['access_key_id'], required: true %> <%= fff.label :access_key_id, 'Access key ID', class: 'label' %>
<%= fff.text_field :access_key_id, value: configs['access_key_id'], required: true, class: 'base-input' %>
</div>
<div class="form-control">
<%= fff.label :secret_access_key, class: 'label' %>
<%= fff.password_field :secret_access_key, value: configs['secret_access_key'], required: true, class: 'base-input' %>
</div>
</div>
<div class="grid md:grid-cols-2 gap-4">
<div class="form-control">
<%= fff.label :region, class: 'label' %>
<%= fff.text_field :region, value: configs['region'], required: true, class: 'base-input' %>
</div>
<div class="form-control">
<%= fff.label :bucket, class: 'label' %>
<%= fff.text_field :bucket, value: value['service'] == 'aws_s3' ? configs['bucket'] : '', required: true, class: 'base-input' %>
</div>
</div> </div>
<div> <div class="form-control">
<%= fff.label :secret_access_key %> <%= fff.label :endpoint, class: 'label' %>
<%= fff.password_field :secret_access_key, value: configs['secret_access_key'], required: true %> <%= fff.text_field :endpoint, value: configs['endpoint'], type: :url, class: 'base-input' %>
</div> <label class="label">
<div> <span class="label-text-alt">For AWS S3 compantiable APIs like Minio.</span>
<%= fff.label :region %> </label>
<%= fff.text_field :region, value: configs['region'], required: true %>
</div>
<div>
<%= fff.label :bucket %>
<%= fff.text_field :bucket, value: value['service'] == 'aws_s3' ? configs['bucket'] : '', required: true %>
</div>
<div>
<%= fff.label :endpoint %>
<%= fff.text_field :endpoint, value: configs['endpoint'], type: :url %>
<small>
For AWS S3 compantiable APIs like Minio.
</small>
</div> </div>
<% end %> <% end %>
<% end %> <% end %>

@ -1,10 +1,17 @@
<%= f.fields_for :value do |ff| %> <%= f.fields_for :value do |ff| %>
<%= ff.hidden_field :service, value: 'disk' %> <%= ff.hidden_field :service, value: 'disk' %>
<% end %> <% end %>
<div class="text-center max-w-xl mx-auto my-8 text-xl font-medium leading-9"> <div class="alert my-4">
Store all files on disk <div>
<br> <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="stroke-current flex-shrink-0 w-6 h-6"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
No configs are needed but make sure your disk is persistent <div>
<br> <h3 class="font-bold"> Store all files on disk</h3>
(not suitable for Heroku and other PaaS) <p class="text-gray-700">
No configs are needed but make sure your disk is persistent
<br>
<i>(not suitable for Heroku and other PaaS)</i>
</p>
</div>
</div>
</div> </div>

@ -1,17 +1,19 @@
<%= f.fields_for :value do |ff| %> <%= f.fields_for :value do |ff| %>
<%= ff.hidden_field :service, value: 'google' %> <%= ff.hidden_field :service, value: 'google' %>
<%= ff.fields_for :configs, configs do |fff| %> <%= ff.fields_for :configs, configs do |fff| %>
<div> <div class="grid md:grid-cols-2 gap-4">
<%= fff.label :project, 'Project' %> <div class="form-control">
<%= fff.text_field :project, value: configs['project'], required: true %> <%= fff.label :project, 'Project', class: 'label' %>
<%= fff.text_field :project, value: configs['project'], required: true, class: 'base-input' %>
</div>
<div class="form-control">
<%= fff.label :bucket, class: 'label' %>
<%= fff.text_field :bucket, value: value['service'] == 'google' ? configs['bucket'] : '', required: true , class: 'base-input' %>
</div>
</div> </div>
<div> <div class="form-control">
<%= fff.label :bucket %> <%= fff.label :credentials, 'Credentials (JSON key content)', class: 'label' %>
<%= fff.text_field :bucket, value: value['service'] == 'google' ? configs['bucket'] : '', required: true %> <%= fff.text_area :credentials, value: configs['credentials'], required: true, class: 'base-input' %>
</div>
<div>
<%= fff.label :credentials, 'Credentials (JSON key content)' %>
<%= fff.text_area :credentials, value: configs['credentials'], required: true %>
</div> </div>
<% end %> <% end %>
<% end %> <% end %>

@ -1,36 +1,36 @@
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0 md:space-x-16"> <div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0 md:space-x-16">
<%= render 'shared/settings_nav' %> <%= render 'shared/settings_nav' %>
<div class="flex-grow max-w-xl"> <div class="flex-grow max-w-xl">
<h1 class="text-4xl font-bold mb-4">Storage</h1> <h1 class="text-4xl font-bold mb-4">Storage</h1>
<p class="mb-4"> <p class="mb-4">
Select files torage option (TODO) Select files storage option (TODO)
</p> </p>
<% value = @encrypted_config.value || { 'service' => 'disk' } %> <% value = @encrypted_config.value || { 'service' => 'disk' } %>
<% configs = value['configs'] || {} %> <% configs = value['configs'] || {} %>
<%= form_for @encrypted_config, url: settings_storage_index_path, method: :post, html: { autocomplete: 'off', class: 'w-full' } do |f| %> <%= form_for @encrypted_config, url: settings_storage_index_path, method: :post, html: { autocomplete: 'off', class: 'w-full' } do |f| %>
<% options = [['Disk', 'disk'], ['AWS S3', 'aws_s3'], ['Google Cloud', 'google']] %> <% options = [['Disk', 'disk'], ['AWS S3', 'aws_s3'], ['Google Cloud', 'google']] %>
<toggle-visible data-element-ids="<%= options.map(&:last).to_json %>" class="block relative"> <toggle-visible data-element-ids="<%= options.map(&:last).to_json %>" class="block relative">
<div class="flex space-x-2 relative"> <div class="flex space-x-2 relative">
<% [['Disk', 'disk'], ['AWS S3', 'aws_s3'], ['Google Cloud', 'google']].each do |(label, val)| %> <% [['Disk', 'disk'], ['AWS S3', 'aws_s3'], ['Google Cloud', 'google']].each do |(label, val)| %>
<%= f.label :selected, value: val, class: 'w-full flex flex-1 items-center space-x-2 btn btn-outline rounded-xl' do %> <%= f.label :selected, value: val, class: 'w-full flex flex-1 items-center space-x-2 btn btn-outline rounded-xl' do %>
<%= f.radio_button :selected, val, checked: value['service'] == val, data: { action: 'change:toggle-visible#trigger' }, class: 'base-radio' %> <%= f.radio_button :selected, val, checked: value['service'] == val, data: { action: 'change:toggle-visible#trigger' }, class: 'base-radio' %>
<span><%= label %></span> <span><%= label %></span>
<% end %> <% end %>
<% end %> <% end %>
</div> </div>
</toggle-visible> </toggle-visible>
<disable-hidden id="disk" class="<%= 'hidden' if value['service'] != 'disk' %>"> <disable-hidden id="disk" class="<%= 'block my-4 hidden' if value['service'] != 'disk' %>">
<%= render "disk_form", f: f %> <%= render "disk_form", f: f %>
</disable-hidden> </disable-hidden>
<disable-hidden id="aws_s3" class="<%= 'hidden' if value['service'] != 'aws_s3' %>"> <disable-hidden id="aws_s3" class="<%= 'block my-4 hidden' if value['service'] != 'aws_s3' %>">
<%= render "aws_form", f: f, configs: configs, value: value %> <%= render "aws_form", f: f, configs: configs, value: value %>
</disable-hidden> </disable-hidden>
<disable-hidden id="google" class="<%= 'hidden' if value['service'] != 'google' %>"> <disable-hidden id="google" class="<%= 'block my-4 hidden' if value['service'] != 'google' %>">
<%= render "google_cloud", f: f, configs: configs, value: value %> <%= render "google_cloud", f: f, configs: configs, value: value %>
</disable-hidden> </disable-hidden>
<div class="form-control"> <div class="form-control">
<%= f.button button_title('OK'), class: 'base-button' %> <%= f.button button_title('OK'), class: 'base-button' %>
</div>
<% end %>
</div> </div>
<% end %>
</div>
</div> </div>

@ -1,4 +1,4 @@
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0 md:space-x-16"> <div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0 md:space-x-2">
<%= render 'shared/settings_nav' %> <%= render 'shared/settings_nav' %>
<div class="w-full"> <div class="w-full">
<div class="flex justify-between mb-4"> <div class="flex justify-between mb-4">

Loading…
Cancel
Save