Correções para funcionamento do login adm
This commit is contained in:
44
app/views/devise/passwords/edit.html.erb
Normal file
44
app/views/devise/passwords/edit.html.erb
Normal file
@@ -0,0 +1,44 @@
|
||||
<%# app/views/devise/passwords/edit.html.erb — Redefinir senha (link do e-mail) %>
|
||||
<% content_for :title, 'Nova senha' %>
|
||||
|
||||
<div class="min-h-screen flex items-center justify-center p-4">
|
||||
<div class="w-full max-w-sm">
|
||||
|
||||
<div class="text-center mb-8">
|
||||
<div class="w-16 h-16 bg-[#f97316] rounded-2xl flex items-center justify-center mx-auto mb-3">
|
||||
<span class="text-3xl">🔒</span>
|
||||
</div>
|
||||
<h1 class="text-white font-bold text-2xl">Definir nova senha</h1>
|
||||
</div>
|
||||
|
||||
<div class="bg-[#111111] border border-white/10 rounded-2xl p-8">
|
||||
<%= form_with(url: user_password_path, scope: :user, method: :put, data: { turbo: false }) do |f| %>
|
||||
<%= f.hidden_field :reset_password_token, value: params[:reset_password_token] %>
|
||||
<div class="space-y-5">
|
||||
<div>
|
||||
<%= f.label :password, 'Nova senha', class: 'block text-sm font-medium text-gray-300 mb-1.5' %>
|
||||
<%= f.password_field :password, autofocus: true, autocomplete: 'new-password',
|
||||
class: 'w-full px-4 py-3 bg-[#0a0a0a] border border-white/10 rounded-xl text-white
|
||||
focus:outline-none focus:border-[#f97316] focus:ring-1 focus:ring-[#f97316] text-base' %>
|
||||
<p class="text-gray-600 text-xs mt-1">Mínimo de 6 caracteres</p>
|
||||
</div>
|
||||
<div>
|
||||
<%= f.label :password_confirmation, 'Confirmar nova senha', class: 'block text-sm font-medium text-gray-300 mb-1.5' %>
|
||||
<%= f.password_field :password_confirmation, autocomplete: 'new-password',
|
||||
class: 'w-full px-4 py-3 bg-[#0a0a0a] border border-white/10 rounded-xl text-white
|
||||
focus:outline-none focus:border-[#f97316] focus:ring-1 focus:ring-[#f97316] text-base' %>
|
||||
</div>
|
||||
|
||||
<%= f.submit 'Salvar nova senha',
|
||||
class: 'w-full py-3.5 bg-[#f97316] hover:bg-orange-500 text-white font-semibold
|
||||
rounded-xl transition-colors cursor-pointer text-base min-h-[48px]' %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<p class="text-center mt-6">
|
||||
<%= link_to '← Voltar para o login', new_user_session_path,
|
||||
class: 'text-sm text-[#f97316] hover:text-orange-400 transition-colors' %>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
47
app/views/devise/passwords/new.html.erb
Normal file
47
app/views/devise/passwords/new.html.erb
Normal file
@@ -0,0 +1,47 @@
|
||||
<%# app/views/devise/passwords/new.html.erb — Esqueci a senha (estilizada) %>
|
||||
<% content_for :title, 'Recuperar senha' %>
|
||||
|
||||
<div class="min-h-screen flex items-center justify-center p-4">
|
||||
<div class="w-full max-w-sm">
|
||||
|
||||
<div class="text-center mb-8">
|
||||
<div class="w-16 h-16 bg-[#f97316] rounded-2xl flex items-center justify-center mx-auto mb-3">
|
||||
<span class="text-3xl">🔑</span>
|
||||
</div>
|
||||
<h1 class="text-white font-bold text-2xl">Recuperar senha</h1>
|
||||
<p class="text-gray-400 text-sm mt-1">Informe seu e-mail para receber as instruções</p>
|
||||
</div>
|
||||
|
||||
<div class="bg-[#111111] border border-white/10 rounded-2xl p-8">
|
||||
<%= form_with(url: user_password_path, scope: :user, method: :post, data: { turbo: false }) do |f| %>
|
||||
<div class="space-y-5">
|
||||
<div>
|
||||
<%= f.label :email, 'E-mail', class: 'block text-sm font-medium text-gray-300 mb-1.5' %>
|
||||
<%= f.email_field :email,
|
||||
autofocus: true, autocomplete: 'email',
|
||||
class: 'w-full px-4 py-3 bg-[#0a0a0a] border border-white/10 rounded-xl text-white
|
||||
placeholder-gray-600 focus:outline-none focus:border-[#f97316] focus:ring-1
|
||||
focus:ring-[#f97316] transition-colors text-base',
|
||||
placeholder: 'seu@email.com' %>
|
||||
</div>
|
||||
|
||||
<%= f.submit 'Enviar instruções',
|
||||
class: 'w-full py-3.5 bg-[#f97316] hover:bg-orange-500 text-white font-semibold
|
||||
rounded-xl transition-colors cursor-pointer text-base min-h-[48px]' %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<p class="text-center mt-6">
|
||||
<%= link_to '← Voltar para o login', new_user_session_path,
|
||||
class: 'text-sm text-[#f97316] hover:text-orange-400 transition-colors' %>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<p class="text-gray-600 text-xs text-center mt-6">
|
||||
⚠️ O envio de e-mail depende da configuração SMTP no servidor.<br>
|
||||
Sem SMTP, peça ao administrador para redefinir sua senha.
|
||||
</p>
|
||||
|
||||
<p class="text-gray-500 text-xs text-center mt-4">Reem Transporte © <%= Date.today.year %></p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -10,7 +10,7 @@
|
||||
d="M13 16V6a1 1 0 00-1-1H4a1 1 0 00-1 1v10a1 1 0 001 1h1m8-1a1 1 0 01-1 1H9m4-1V8a1 1 0 011-1h2.586a1 1 0 01.707.293l3.414 3.414a1 1 0 01.293.707V16a1 1 0 01-1 1h-1m-6-1a1 1 0 001 1h1M5 17a2 2 0 104 0m-4 0a2 2 0 114 0m6 0a2 2 0 104 0m-4 0a2 2 0 114 0"/>
|
||||
</svg>
|
||||
</div>
|
||||
<h1 class="text-3xl font-bold text-white">Gade Logística</h1>
|
||||
<h1 class="text-3xl font-bold text-white">Reem Logística</h1>
|
||||
<p class="text-gray-400 mt-1 text-sm">Sistema de Controle de Custos</p>
|
||||
</div>
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
<%# Login por e-mail %>
|
||||
<div id="form-email" class="p-8">
|
||||
<%= form_with(url: user_session_path, method: :post) do |f| %>
|
||||
<%= form_with(url: user_session_path, scope: :user, method: :post, data: { turbo: false }) do |f| %>
|
||||
<div class="space-y-5">
|
||||
<div>
|
||||
<%= f.label :email, 'E-mail', class: 'block text-sm font-medium text-gray-300 mb-1.5' %>
|
||||
@@ -82,7 +82,7 @@
|
||||
|
||||
<%# Login por PIN %>
|
||||
<div id="form-pin" class="p-8 hidden">
|
||||
<%= form_with(url: user_session_path, method: :post) do |f| %>
|
||||
<%= form_with(url: user_session_path, method: :post, data: { turbo: false }) do |f| %>
|
||||
<%= f.hidden_field :pin_login, value: '1' %>
|
||||
|
||||
<div class="space-y-6">
|
||||
@@ -148,7 +148,7 @@
|
||||
</div>
|
||||
|
||||
<p class="text-center text-gray-600 text-xs mt-6">
|
||||
Gade Hospitalar © <%= Date.today.year %>
|
||||
Reem Transporte © <%= Date.today.year %>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user