mirror of https://github.com/docusealco/docuseal
parent
45adee6ddf
commit
ccb8347575
@ -1,12 +1,16 @@
|
||||
<h2>Forgot your password?</h2>
|
||||
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
|
||||
<%= render 'devise/shared/error_messages', resource: %>
|
||||
<div class="field">
|
||||
<%= f.label :email %><br>
|
||||
<%= f.email_field :email, autofocus: true, autocomplete: 'email' %>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<%= f.submit 'Send me reset password instructions' %>
|
||||
</div>
|
||||
<% end %>
|
||||
<%= render 'devise/shared/links' %>
|
||||
<div class="max-w-xl mx-auto px-2">
|
||||
<h1 class="text-4xl font-bold text-center my-8">Forgot your password?</h1>
|
||||
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post, class: 'space-y-6' }) do |f| %>
|
||||
<div class="space-y-2">
|
||||
<%= render 'devise/shared/error_messages', resource: %>
|
||||
<div class="form-control">
|
||||
<%= f.label :email, class: 'label' %>
|
||||
<%= f.email_field :email, autofocus: true, autocomplete: 'email', class: 'base-input' %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-control">
|
||||
<%= f.submit 'Reset password', class: 'base-button' %>
|
||||
</div>
|
||||
<% end %>
|
||||
<%= render 'devise/shared/links' %>
|
||||
</div>
|
||||
|
||||
@ -1,34 +1,38 @@
|
||||
<h2>Sign up</h2>
|
||||
<%= form_for('', as: resource_name, url: registration_path) do |f| %>
|
||||
<%= render 'devise/shared/error_messages', resource: %>
|
||||
<%= f.fields_for resource do |ff| %>
|
||||
<div>
|
||||
<%= ff.label :first_name %>
|
||||
<%= ff.text_field :first_name, required: true %>
|
||||
<div class="max-w-xl mx-auto px-2">
|
||||
<h1 class="text-4xl font-bold text-center my-8">Sign up</h1>
|
||||
<%= form_for('', as: resource_name, html: { class: 'space-y-6' }, url: registration_path) do |f| %>
|
||||
<div class="space-y-2">
|
||||
<%= render 'devise/shared/error_messages', resource: %>
|
||||
<%= f.fields_for resource do |ff| %>
|
||||
<div class="form-control">
|
||||
<%= ff.label :first_name, class: 'label' %>
|
||||
<%= ff.text_field :first_name, required: true, class: 'base-input' %>
|
||||
</div>
|
||||
<div class="form-control">
|
||||
<%= ff.label :last_name, class: 'label' %>
|
||||
<%= ff.text_field :last_name, required: true, class: 'base-input' %>
|
||||
</div>
|
||||
<% end %>
|
||||
<%= f.fields_for resource.account do |ff| %>
|
||||
<div class="form-control">
|
||||
<%= ff.label :name, 'Company name', class: 'label' %>
|
||||
<%= ff.text_field :name, required: true, class: 'base-input' %>
|
||||
</div>
|
||||
<% end %>
|
||||
<%= f.fields_for resource do |ff| %>
|
||||
<div class="form-control">
|
||||
<%= ff.label :email, class: 'label' %>
|
||||
<%= ff.email_field :email, required: true, class: 'base-input' %>
|
||||
</div>
|
||||
<div class="form-control">
|
||||
<%= ff.label :password, class: 'label' %>
|
||||
<%= ff.password_field :password, required: true, class: 'base-input' %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div>
|
||||
<%= ff.label :last_name %>
|
||||
<%= ff.text_field :last_name, required: true %>
|
||||
<div class="form-control">
|
||||
<%= f.submit 'Sign up', class: 'base-button' %>
|
||||
</div>
|
||||
<% end %>
|
||||
<%= f.fields_for resource.account do |ff| %>
|
||||
<div>
|
||||
<%= ff.label :name, 'Company name' %>
|
||||
<%= ff.text_field :name, required: true %>
|
||||
</div>
|
||||
<% end %>
|
||||
<%= f.fields_for resource do |ff| %>
|
||||
<div>
|
||||
<%= ff.label :email %>
|
||||
<%= ff.email_field :email, required: true %>
|
||||
</div>
|
||||
<div>
|
||||
<%= ff.label :password %>
|
||||
<%= ff.password_field :password, required: true %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="actions">
|
||||
<%= f.submit 'Sign up' %>
|
||||
</div>
|
||||
<% end %>
|
||||
<%= render 'devise/shared/links' %>
|
||||
<%= render 'devise/shared/links' %>
|
||||
</div>
|
||||
|
||||
@ -1,25 +1,22 @@
|
||||
<%- if controller_name != 'sessions' %>
|
||||
<%= link_to 'Log in', new_session_path(resource_name), class: 'link-hover' %><br>
|
||||
<% end %>
|
||||
|
||||
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
|
||||
<%= link_to 'Sign up', new_registration_path, class: 'link-hover' %><br>
|
||||
<% end %>
|
||||
|
||||
<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
|
||||
<%= link_to 'Forgot your password?', new_password_path(resource_name), class: 'link-hover' %><br>
|
||||
<% end %>
|
||||
|
||||
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
|
||||
<%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name), class: 'link-hover' %><br>
|
||||
<% end %>
|
||||
|
||||
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
|
||||
<%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name), class: 'link-hover' %><br>
|
||||
<% end %>
|
||||
|
||||
<%- if devise_mapping.omniauthable? %>
|
||||
<%- resource_class.omniauth_providers.each do |provider| %>
|
||||
<%= button_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), data: { turbo: false } %><br>
|
||||
<div class="flex justify-between mt-4">
|
||||
<%- if controller_name != 'sessions' %>
|
||||
<%= link_to 'Log in', new_session_path(resource_name), class: 'link link-hover' %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
|
||||
<%= link_to 'Sign up', new_registration_path, class: 'link link-hover' %>
|
||||
<% end %>
|
||||
<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
|
||||
<%= link_to 'Forgot your password?', new_password_path(resource_name), class: 'link link-hover' %>
|
||||
<% end %>
|
||||
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
|
||||
<%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name), class: 'link link-hover' %>
|
||||
<% end %>
|
||||
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
|
||||
<%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name), class: 'link link-hover' %>
|
||||
<% end %>
|
||||
<%- if devise_mapping.omniauthable? %>
|
||||
<%- resource_class.omniauth_providers.each do |provider| %>
|
||||
<%= button_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), class: 'link link-hover', data: { turbo: false } %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
@ -1,34 +1,45 @@
|
||||
<div class="max-w-6xl mx-auto">
|
||||
<div class="flex space-x-8">
|
||||
<%= render 'shared/settings_nav' %>
|
||||
<div class="mt-4">
|
||||
Email settings
|
||||
<% value = @encrypted_config.value || {} %>
|
||||
<%= form_for @encrypted_config, url: settings_email_index_path, method: :post, html: { autocomplete: 'off' } do |f| %>
|
||||
<%= f.fields_for :value do |ff| %>
|
||||
<div>
|
||||
<%= ff.label :host %>
|
||||
<%= ff.text_field :host, value: value['host'], required: true %>
|
||||
</div>
|
||||
<div>
|
||||
<%= ff.label :port %>
|
||||
<%= ff.text_field :port, value: value['port'], required: true %>
|
||||
</div>
|
||||
<div>
|
||||
<%= ff.label :username %>
|
||||
<%= ff.text_field :username, value: value['username'], required: true %>
|
||||
</div>
|
||||
<div>
|
||||
<%= ff.label :password %>
|
||||
<%= ff.password_field :password, value: value['password'], required: true %>
|
||||
</div>
|
||||
<div>
|
||||
<%= ff.label :from_email, 'Send from' %>
|
||||
<%= ff.email_field :from_email, value: value['from_email'], required: true %>
|
||||
<div class="mt-4 w-full">
|
||||
<div class="max-w-xl mx-auto">
|
||||
<h1 class="text-3xl font-bold text-left mb-4">Email Settings</h1>
|
||||
<% value = @encrypted_config.value || {} %>
|
||||
<%= 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| %>
|
||||
<div class="grid md:grid-cols-2 gap-4">
|
||||
<div class="form-control">
|
||||
<%= ff.label :host, class: 'label' %>
|
||||
<%= ff.text_field :host, value: value['host'], required: true, class: 'base-input' %>
|
||||
</div>
|
||||
<div class="form-control">
|
||||
<%= ff.label :port, class: 'label' %>
|
||||
<%= ff.text_field :port, value: value['port'], required: true, class: 'base-input' %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid md:grid-cols-2 gap-4">
|
||||
<div class="form-control">
|
||||
<%= ff.label :username, class: 'label' %>
|
||||
<%= ff.text_field :username, value: value['username'], required: true, class: 'base-input' %>
|
||||
</div>
|
||||
<div class="form-control">
|
||||
<%= ff.label :password, class: 'label' %>
|
||||
<%= ff.password_field :password, value: value['password'], required: true, class: 'base-input' %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-control">
|
||||
<%= ff.label :from_email, 'Send from', class: 'label' %>
|
||||
<%= ff.email_field :from_email, value: value['from_email'], required: true, class: 'base-input' %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="flex justify-end">
|
||||
<div class="form-control">
|
||||
<%= f.button button_title, class: 'base-button' %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<%= f.button button_title %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="px-2 w-52"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,19 +1,23 @@
|
||||
<%= form_for user, data: { turbo_frame: :_top } do |f| %>
|
||||
<div>
|
||||
<%= f.label :first_name %>
|
||||
<%= f.text_field :first_name, required: true %>
|
||||
<%= form_for user, html: { class: 'space-y-4' }, data: { turbo_frame: :_top } do |f| %>
|
||||
<div class="space-y-2">
|
||||
<div class="form-control">
|
||||
<%= f.label :first_name, class: 'label' %>
|
||||
<%= f.text_field :first_name, required: true, class: 'base-input' %>
|
||||
</div>
|
||||
<div class="form-control">
|
||||
<%= f.label :last_name, class: 'label' %>
|
||||
<%= f.text_field :last_name, required: true, class: 'base-input' %>
|
||||
</div>
|
||||
<div class="form-control">
|
||||
<%= f.label :email, class: 'label' %>
|
||||
<%= f.email_field :email, required: true, class: 'base-input' %>
|
||||
</div>
|
||||
<div class="form-control">
|
||||
<%= f.label :password, class: 'label' %>
|
||||
<%= f.password_field :password, required: user.new_record?, class: 'base-input' %>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<%= f.label :last_name %>
|
||||
<%= f.text_field :last_name, required: true %>
|
||||
<div class="form-control">
|
||||
<%= f.button button_title, class: 'base-button' %>
|
||||
</div>
|
||||
<div>
|
||||
<%= f.label :email %>
|
||||
<%= f.email_field :email, required: true %>
|
||||
</div>
|
||||
<div>
|
||||
<%= f.label :password %>
|
||||
<%= f.password_field :password, required: user.new_record? %>
|
||||
</div>
|
||||
<%= f.button button_title %>
|
||||
<% end %>
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
<%= render 'shared/turbo_modal' do %>
|
||||
<%= render 'shared/turbo_modal', title: 'Edit User' do %>
|
||||
<%= render 'form', user: @user %>
|
||||
<% end %>
|
||||
|
||||
@ -1,44 +1,91 @@
|
||||
<div class="max-w-6xl mx-auto">
|
||||
<div class="flex space-x-8">
|
||||
<%= render 'shared/settings_nav' %>
|
||||
<div class="mt-4">
|
||||
<div>
|
||||
Users
|
||||
<a href="<%= new_user_path %>" data-turbo-frame="modal">New User</a>
|
||||
</div>
|
||||
<table>
|
||||
<tr>
|
||||
<th>
|
||||
User
|
||||
</th>
|
||||
<th>
|
||||
Role
|
||||
</th>
|
||||
<th>
|
||||
Last session
|
||||
</th>
|
||||
<th>
|
||||
</th>
|
||||
</tr>
|
||||
<% @users.each do |user| %>
|
||||
<tr>
|
||||
<td>
|
||||
<%= user.full_name %><br>
|
||||
<%= user.email %>
|
||||
</td>
|
||||
<td>
|
||||
<%= user.role %>
|
||||
</td>
|
||||
<td>
|
||||
<%= user.last_sign_in_at ? l(user.last_sign_in_at) : '-' %>
|
||||
</td>
|
||||
<td>
|
||||
<%= link_to 'Edit', edit_user_path(user), data: { turbo_frame: 'modal' } %>
|
||||
<%= button_to 'Remove', user_path(user), method: :delete, data: { turbo_confirm: 'Are you sure?' } %>
|
||||
</td>
|
||||
</tr>
|
||||
<div class="mt-4 w-full px-2">
|
||||
<div class="flex justify-between mb-4 items-center">
|
||||
<h1 class="text-3xl font-bold text-left">Users</h1>
|
||||
<%= link_to new_user_path, class: 'btn btn-primary btn-md gap-2', data: { turbo_frame: 'modal' } do %>
|
||||
<svg
|
||||
class="w-6 h-6"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="44"
|
||||
height="44"
|
||||
viewBox="0 0 24 24"
|
||||
stroke-width="1.5"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round">
|
||||
<path
|
||||
stroke="none"
|
||||
d="M0 0h24v24H0z"
|
||||
fill="none" />
|
||||
<line
|
||||
x1="12"
|
||||
y1="5"
|
||||
x2="12"
|
||||
y2="19" />
|
||||
<line
|
||||
x1="5"
|
||||
y1="12"
|
||||
x2="19"
|
||||
y2="12" />
|
||||
</svg>
|
||||
<span>New User</span>
|
||||
<% end %>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="overflow-x-auto">
|
||||
<table class="table w-full">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">
|
||||
Name
|
||||
</th>
|
||||
<th scope="col">
|
||||
Email
|
||||
</th>
|
||||
<th scope="col">
|
||||
Role
|
||||
</th>
|
||||
<th scope="col">
|
||||
Last session
|
||||
</th>
|
||||
<th scope="col" class="text-right" width="1px">
|
||||
Action
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @users.each do |user| %>
|
||||
<tr scope="row">
|
||||
<td>
|
||||
<%= user.full_name %>
|
||||
</td>
|
||||
<td>
|
||||
<%= user.email %>
|
||||
</td>
|
||||
<td>
|
||||
<span class="badge badge-success badge-outline">
|
||||
<%= user.role %>
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<%= user.last_sign_in_at ? l(user.last_sign_in_at, format: :short) : '-' %>
|
||||
</td>
|
||||
<td class="flex items-center space-x-2 justify-end">
|
||||
<%= link_to edit_user_path(user), class: 'btn btn-outline btn-xs', title: 'Edit', data: { turbo_frame: 'modal' } do %>
|
||||
Edit
|
||||
<% end %>
|
||||
<%= link_to user_path(user), class: 'btn btn-outline btn-error btn-xs', title: 'Delete', data: { turbo_method: :delete, turbo_confirm: 'Are you sure?' } do %>
|
||||
Remove
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
<%= render 'shared/turbo_modal' do %>
|
||||
<%= render 'shared/turbo_modal', title: 'New User' do %>
|
||||
<%= render 'form', user: @user %>
|
||||
<% end %>
|
||||
|
||||
Loading…
Reference in new issue