fix devise templates

This commit is contained in:
Torsten 2022-12-21 18:04:09 +02:00
parent d6606f05bb
commit cdb1637bb0
9 changed files with 52 additions and 79 deletions

View File

@ -1,13 +1,10 @@
.flex.justify-center
.w-full.max-w-xs
%h1.font-hairline.mb-6.text-center Resend Confirmation Instructions
= form_for(resource, |
as: resource_name, |
url: main_app.confirmation_path(resource_name), |
html: { |
method: :post, |
class: "bg-white mb-4 px-8 pt-6 pb-8 rounded shadow-md" |
}) do |f| |
= form_for(resource, as: resource_name,
url: confirmation_path(resource_name),
html: { class: "bg-white mb-4 px-8 pt-6 pb-8 rounded shadow-md" ,
method: :post }) do |f|
= render "devise/shared/error_messages", resource: resource
.mb-4
= f.label :email, class: "block font-bold mb-2 text-gray-700 text-sm"

View File

@ -4,7 +4,7 @@
= form_for(resource,
as: resource_name,
html: { method: :put, class: "bg-white mb-4 px-8 pt-6 pb-8 rounded shadow-md" },
url: member_password_path(resource_name) ) do |f|
url: password_path(resource_name) ) do |f|
= render "devise/shared/error_messages", resource: resource
= f.hidden_field :reset_password_token
.mb-4

View File

@ -1,13 +1,10 @@
.flex.justify-center
.w-full.max-w-xs
%h1.font-hairline.mb-6.text-center Forgot your password?
= form_for(resource, |
as: resource_name, |
url: main_app.password_path(resource_name), |
html: { |
method: :post, |
class: "bg-white mb-4 px-8 pt-6 pb-8 rounded shadow-md" |
}) do |f| |
= form_for(resource, as: resource_name,
html: { method: :post,
class: "bg-white mb-4 px-8 pt-6 pb-8 rounded shadow-md" } ,
url: password_path(resource_name) ) do |f|
= render "devise/shared/error_messages", resource: resource
.mb-4
= f.label :email, class: "block font-bold mb-2 text-gray-700 text-sm"

View File

@ -2,14 +2,10 @@
.w-full.max-w-xs
%h1.font-hairline.mb-6.text-center
Edit #{resource_name.to_s.humanize}
= form_for(resource, |
as: resource_name, |
url: main_app.registration_path(resource_name), |
html: { |
method: :put, |
class: "bg-white mb-4 px-8 pt-6 pb-8 rounded shadow-md" |
} |
) do |f| |
= form_for(resource, as: resource_name,
html: { class: "bg-white mb-4 px-8 pt-6 pb-8 rounded shadow-md",
method: :put } ,
url: registration_path(resource_name) ) do |f|
= render "devise/shared/error_messages", resource: resource
.mb-4
= f.label :email, class: "block font-bold mb-2 text-gray-700 text-sm"
@ -40,5 +36,5 @@
= f.submit "Update", class: "button bg-blue-500 hover:bg-blue-700 font-bold text-white focus:outline-none py-2 px-4 rounded focus:shadow-outline w-full"
%p
Unhappy?
%span= button_to "Delete my account", main_app.registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete
%span= button_to "Delete my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete
= link_to "Back", :back

View File

@ -1,26 +1,22 @@
.flex.justify-center
.w-full.max-w-xs
%h1.font-hairline.mb-6.text-center Sign Up
= form_for(resource, |
as: resource_name, |
url: main_app.registration_path(resource_name), |
html: { |
class: "bg-white mb-4 px-8 pt-6 pb-8 rounded shadow-md" |
} |
) do |f| |
= form_for(resource, as: resource_name,
html: { class: "bg-white mb-4 px-8 pt-6 pb-8 rounded shadow-md" } ,
url: registration_path(resource_name) ) do |f|
= render "devise/shared/error_messages", resource: resource
.mb-4
= f.label :name, class: "block font-bold mb-2 text-gray-700 text-sm"
= f.text_field :name, |
autocomplete: "name", |
placeholder: "Pekka Juustonen", |
class: "appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none shadow focus:shadow-outline" |
= f.text_field :name,
autocomplete: "name",
placeholder: "Pekka Juustonen",
class: "appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none shadow focus:shadow-outline"
.mb-4
= f.label :email, class: "block font-bold mb-2 text-gray-700 text-sm"
= f.email_field :email, |
autocomplete: "email", |
placeholder: "user@example.com", |
class: "appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none shadow focus:shadow-outline" |
= f.email_field :email,
autocomplete: "email",
placeholder: "user@example.com",
class: "appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none shadow focus:shadow-outline"
.mb-4
= f.label :password, class: "block font-bold mb-2 text-gray-700 text-sm"
- if @minimum_password_length

View File

@ -1,30 +1,26 @@
.flex.justify-center
.w-full.max-w-xs
%h1.font-hairline.mb-6.text-center Log In
= form_for(resource, |
as: resource_name, |
url: main_app.session_path(resource_name), |
html: { |
class: "bg-white mb-4 px-8 pt-6 pb-8 rounded shadow-md" |
} |
) do |f| |
= form_for(resource, url: session_path(resource_name),
html: { class: "bg-white mb-4 px-8 pt-6 pb-8 rounded shadow-md" },
as: resource_name ) do |f|
= render "devise/shared/error_messages", resource: resource
.mb-4
= f.label :email, class: "block text-gray-700 text-sm font-bold mb-2"
= f.email_field :email, autofocus: true, autocomplete: "email", |
class: "shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight foucs:outline-none focus:shadow-outline" |
= f.email_field :email, autofocus: true, autocomplete: "email",
class: "shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight foucs:outline-none focus:shadow-outline"
.mb-4
= f.label :password, class: "block text-gray-700 text-sm font-bold mb-2"
= f.password_field :password, |
autocomplete: "current-password", |
class: "shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" |
= f.password_field :password,
autocomplete: "current-password",
class: "shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"
- if devise_mapping.rememberable?
.mb-4
= f.check_box :remember_me, class: "mr-2 leading-tight"
= f.label :remember_me, |
class: "align-baseline inline-block text-gray-700 text-sm" |
= f.label :remember_me,
class: "align-baseline inline-block text-gray-700 text-sm"
.mb-4
= f.submit "Log in", |
class: "button bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline w-full" |
= f.submit "Log in",
class: "button bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline w-full"
= render "devise/shared/links"
= render "devise/shared/form_footer"

View File

@ -1,9 +1,9 @@
- if resource.errors.any?
#error_explanation
%h2.bg-red-100.border-l-4.border-red-500.mb-4.p-4.text-red-700.font-bold
= I18n.t("errors.messages.not_saved", |
count: resource.errors.count, |
resource: resource.class.model_name.human.downcase) |
= I18n.t("errors.messages.not_saved",
count: resource.errors.count,
resource: resource.class.model_name.human.downcase)
%ul
- resource.errors.full_messages.each do |message|
%li= message

View File

@ -1,25 +1,20 @@
- if controller_name != 'sessions'
= link_to "Log in", main_app.new_member_session_path(resource_name), |
class: "inline-block align-baseline font-bold text-sm text-blue-500 hover:text-blue-800" |
%br/
- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations'
= link_to "Forgot Password?", main_app.new_member_password_path(resource_name), |
= link_to "Log in", new_session_path(resource_name), |
class: "inline-block align-baseline font-bold text-sm text-blue-500 hover:text-blue-800" |
%br/
- if devise_mapping.registerable? && controller_name != 'registrations'
= link_to "Sign up", main_app.new_member_registration_path(resource_name), |
= link_to "Sign up", new_registration_path(resource_name), |
class: "inline-block align-baseline font-bold text-sm text-blue-500 hover:text-blue-800" |
%br/
- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations'
= link_to "Forgot Password?", new_password_path(resource_name), |
class: "inline-block align-baseline font-bold text-sm text-blue-500 hover:text-blue-800" |
%br/
- if devise_mapping.confirmable? && controller_name != 'confirmations'
= link_to "Didn't receive confirmation info?", main_app.new_member_confirmation_path(resource_name), |
= link_to "Didn't receive confirmation info?", new_confirmation_path(resource_name), |
class: "inline-block align-baseline font-bold text-sm text-blue-500 hover:text-blue-800" |
%br/
- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks'
= link_to "Didn't receive unlock info?", main_app.new_member_unlock_path(resource_name), |
= link_to "Didn't receive unlock info?", new_unlock_path(resource_name), |
class: "inline-block align-baseline font-bold text-sm text-blue-500 hover:text-blue-800" |
%br/
- if devise_mapping.omniauthable?
- resource_class.omniauth_providers.each do |provider|
= link_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", main_app.omniauth_authorize_path(resource_name, provider), |
class: "inline-block align-baseline font-bold text-sm text-blue-500 hover:text-blue-800" |
%br/

View File

@ -1,14 +1,10 @@
.flex.justify-center
.w-full.max-w-xs
%h1.font-hairline.mb-6.text-center Resend Unlock Info
= form_for(resource, |
as: resource_name, |
url: main_app.unlock_path(resource_name), |
html: { |
method: :post, |
class: "bg-white mb-4 px-8 pt-6 pb-8 rounded shadow-md" |
} |
) do |f| |
= form_for(resource, as: resource_name,
html: { class: "bg-white mb-4 px-8 pt-6 pb-8 rounded shadow-md" ,
method: :post }
url: unlock_path(resource_name) ) do |f|
= render "devise/shared/error_messages", resource: resource
.mb-4
= f.label :email, class: "block font-bold mb-2 text-gray-700 text-sm"