style storage settings

pull/105/head
Alex Turchyn 2 years ago
parent e45bad97f5
commit faf6f69e3e

@ -50,3 +50,7 @@ button[disabled] .enabled {
.base-checkbox { .base-checkbox {
@apply checkbox rounded bg-white checkbox-sm no-animation; @apply checkbox rounded bg-white checkbox-sm no-animation;
} }
.base-radio {
@apply radio bg-white radio-sm;
}

@ -1,9 +1,12 @@
<div class="max-w-6xl mx-auto"> <div class="max-w-6xl mx-auto">
<div class="flex space-x-8"> <div class="flex">
<%= render 'shared/settings_nav' %> <%= render 'shared/settings_nav' %>
<div class="mt-4 w-full"> <div class="mt-4 w-full">
<div class="max-w-xl mx-auto"> <div class="max-w-xl mx-auto">
<h1 class="text-3xl font-bold text-left mb-4">Email Settings</h1> <h1 class="text-4xl font-bold mb-4">Email SMTP</h1>
<p>
Configure your to send emails (TODO)
</p>
<% value = @encrypted_config.value || {} %> <% value = @encrypted_config.value || {} %>
<%= form_for @encrypted_config, url: settings_email_index_path, method: :post, html: { autocomplete: 'off', class: 'space-y-4' } do |f| %> <%= form_for @encrypted_config, url: settings_email_index_path, method: :post, html: { autocomplete: 'off', class: 'space-y-4' } do |f| %>
<%= f.fields_for :value do |ff| %> <%= f.fields_for :value do |ff| %>
@ -32,14 +35,14 @@
<%= ff.email_field :from_email, value: value['from_email'], required: true, class: 'base-input' %> <%= ff.email_field :from_email, value: value['from_email'], required: true, class: 'base-input' %>
</div> </div>
<% end %> <% end %>
<div class="flex justify-end"> <div>
<div class="form-control"> <div class="form-control mt-8">
<%= f.button button_title, class: 'base-button' %> <%= f.button button_title, class: 'base-button' %>
</div> </div>
</div> </div>
<% end %> <% end %>
</div> </div>
</div> </div>
<div class="px-2 w-52"></div> <div class="px-2 w-52 flex-none"></div>
</div> </div>
</div> </div>

@ -5,7 +5,7 @@
<%= form_for '', url: settings_esign_index_path, method: :post do |f| %> <%= form_for '', url: settings_esign_index_path, method: :post do |f| %>
<file-dropzone data-name="verify_attachments"> <file-dropzone data-name="verify_attachments">
<label for="file"> <label for="file">
<input id="attachment_uuid" name="attachment_uuid" class="hidden" data-target="file-dropzone.valueField" type="text"> <input id="attachment_uuid" name="attachment_uuid" class="hidden" data-target="file-dropzone.valueField" type="text" autocomplete="off">
<input id="file" class="hidden" data-action="change:file-dropzone#onSelectFiles" data-target="file-dropzone.input" type="file"> <input id="file" class="hidden" data-action="change:file-dropzone#onSelectFiles" data-target="file-dropzone.input" type="file">
LCick to upload LCick to upload
</label> </label>

@ -15,8 +15,9 @@
<turbo-frame id="modal"></turbo-frame> <turbo-frame id="modal"></turbo-frame>
<%= render 'shared/navbar' %> <%= render 'shared/navbar' %>
<% if flash.present? %> <% if flash.present? %>
<div id="flash" class="max-w-xl mx-auto px-2"> <div id="flash" class="absolute top-0 w-full">
<div class="alert shadow-lg"> <div class="max-w-xl mx-auto mt-1.5">
<div class="alert shadow-lg 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>
@ -24,6 +25,7 @@
</div> </div>
</div> </div>
</div> </div>
</div>
<% end %> <% end %>
<%= yield %> <%= yield %>
</body> </body>

@ -1,4 +1,4 @@
<div class="max-w-6xl mx-auto px-2 py-2 flex items-center justify-between"> <div class="max-w-6xl mx-auto px-2 py-3 flex items-center justify-between">
<a href="<%= root_path %>" class="text-2xl font-bold"> <a href="<%= root_path %>" class="text-2xl font-bold">
<span>DocuSeal</span> <span>DocuSeal</span>
</a> </a>
@ -7,7 +7,7 @@
<%= link_to 'Settings', settings_storage_index_path, class: 'font-medium text-lg' %> <%= link_to 'Settings', settings_storage_index_path, class: 'font-medium text-lg' %>
<div class="dropdown dropdown-end"> <div class="dropdown dropdown-end">
<label tabindex="0" class="cursor-pointer bg-neutral-focus text-neutral-content rounded-full w-8 p-2"> <label tabindex="0" class="cursor-pointer bg-neutral-focus text-neutral-content rounded-full w-8 p-2">
<span class="text-sm"><%= current_user.initials %></span> <span class="text-sm align-text-top"><%= current_user.initials %></span>
</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>

@ -1,6 +1,6 @@
<menu-active class="block"> <menu-active class="block w-52 flex-none">
<div class="mt-4 -ml-3.5"> <div class="mt-4 -ml-3.5">
<ul class="menu menu-compact px-2 w-52"> <ul class="menu menu-compact px-2">
<li class="menu-title"><span>Settings</span></li> <li class="menu-title"><span>Settings</span></li>
<li></li> <li></li>
<li> <li>

@ -1,24 +1,36 @@
<div class="max-w-6xl mx-auto"> <div class="max-w-6xl mx-auto">
<div class="flex space-x-8"> <div class="flex">
<%= render 'shared/settings_nav' %> <%= render 'shared/settings_nav' %>
<div class="mt-4"> <div class="mt-4 w-full">
Storage settings <div class="max-w-xl mx-auto">
<h1 class="text-4xl font-bold mb-4">Storage</h1>
<p class="mb-4">
Select files torage option (TODO)
</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' } 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 %>"> <toggle-visible data-element-ids="<%= options.map(&:last).to_json %>" class="block 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.radio_button :selected, val, checked: value['service'] == val, data: { action: 'change:toggle-visible#trigger' } %> <%= 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, label, value: val %> <%= f.radio_button :selected, val, checked: value['service'] == val, data: { action: 'change:toggle-visible#trigger' }, class: 'base-radio' %>
<span><%= label %></span>
<% end %> <% end %>
<% end %>
</div>
</toggle-visible> </toggle-visible>
<disable-hidden id="disk" class="<%= 'hidden' if value['service'] != 'disk' %>"> <disable-hidden id="disk" class="<%= 'hidden' if value['service'] != 'disk' %>">
<%= 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> <div class="text-center max-w-xl mx-auto my-8 text-xl font-medium leading-9">
Disk storage - no configs needed but make sure you have a persistant disk (heroku doesnt not have one) Store all files on disk
<br>
No configs are needed but make sure your disk is persistent
<br>
(not suitable for Heroku and other PaaS)
</div> </div>
</disable-hidden> </disable-hidden>
<disable-hidden id="aws_s3" class="<%= 'hidden' if value['service'] != 'aws_s3' %>"> <disable-hidden id="aws_s3" class="<%= 'hidden' if value['service'] != 'aws_s3' %>">
@ -44,6 +56,9 @@
<div> <div>
<%= fff.label :endpoint %> <%= fff.label :endpoint %>
<%= fff.text_field :endpoint, value: configs['endpoint'], type: :url %> <%= fff.text_field :endpoint, value: configs['endpoint'], type: :url %>
<small>
For AWS S3 compantiable APIs like Minio.
</small>
</div> </div>
<% end %> <% end %>
<% end %> <% end %>
@ -67,8 +82,12 @@
<% end %> <% end %>
<% end %> <% end %>
</disable-hidden> </disable-hidden>
<%= f.button button_title %> <div class="form-control">
<%= f.button button_title('OK'), class: 'base-button' %>
</div>
<% end %> <% end %>
</div> </div>
</div> </div>
<div class="px-2 w-52 flex-none"></div>
</div>
</div> </div>

@ -1,9 +1,9 @@
<div class="max-w-6xl mx-auto"> <div class="max-w-6xl mx-auto">
<div class="flex space-x-8"> <div class="flex space-x-2">
<%= render 'shared/settings_nav' %> <%= render 'shared/settings_nav' %>
<div class="mt-4 w-full px-2"> <div class="mt-4 w-full px-2">
<div class="flex justify-between mb-4 items-center"> <div class="flex justify-between mb-4">
<h1 class="text-3xl font-bold text-left">Users</h1> <h1 class="text-4xl font-bold">Users</h1>
<%= link_to new_user_path, class: 'btn btn-primary btn-md gap-2', data: { turbo_frame: 'modal' } do %> <%= link_to new_user_path, class: 'btn btn-primary btn-md gap-2', data: { turbo_frame: 'modal' } do %>
<svg <svg
class="w-6 h-6" class="w-6 h-6"
@ -52,7 +52,6 @@
Last session Last session
</th> </th>
<th scope="col" class="text-right" width="1px"> <th scope="col" class="text-right" width="1px">
Action
</th> </th>
</tr> </tr>
</thead> </thead>

Loading…
Cancel
Save