From 387e4582b602d028fc5f2c34642cfe849193fb3d Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Tue, 1 Oct 2024 18:20:05 -0400 Subject: [PATCH] Make copies of the auth templates for Rails 8 beta1 We can revert this once beta2 is out. --- .../templates/views/passwords/edit.html.erb | 21 +++++++++++++ .../templates/views/passwords/new.html.erb | 17 ++++++++++ .../templates/views/sessions/new.html.erb | 31 +++++++++++++++++++ 3 files changed, 69 insertions(+) create mode 100644 lib/generators/tailwindcss/authentication/templates/views/passwords/edit.html.erb create mode 100644 lib/generators/tailwindcss/authentication/templates/views/passwords/new.html.erb create mode 100644 lib/generators/tailwindcss/authentication/templates/views/sessions/new.html.erb diff --git a/lib/generators/tailwindcss/authentication/templates/views/passwords/edit.html.erb b/lib/generators/tailwindcss/authentication/templates/views/passwords/edit.html.erb new file mode 100644 index 0000000..939b0b8 --- /dev/null +++ b/lib/generators/tailwindcss/authentication/templates/views/passwords/edit.html.erb @@ -0,0 +1,21 @@ +
+ <%% if alert = flash[:alert] %> +

<%%= alert %>

+ <%% end %> + +

Update your password

+ + <%%= form_with url: password_path(params[:token]), method: :put, class: "contents" do |form| %> +
+ <%%= form.password_field :password, required: true, autocomplete: "new-password", placeholder: "Enter new password", maxlength: 72, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %> +
+ +
+ <%%= form.password_field :password_confirmation, required: true, autocomplete: "new-password", placeholder: "Repeat new password", maxlength: 72, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %> +
+ +
+ <%%= form.submit "Save", class: "rounded-lg py-3 px-5 bg-blue-600 text-white inline-block font-medium cursor-pointer" %> +
+ <%% end %> +
diff --git a/lib/generators/tailwindcss/authentication/templates/views/passwords/new.html.erb b/lib/generators/tailwindcss/authentication/templates/views/passwords/new.html.erb new file mode 100644 index 0000000..e5d8819 --- /dev/null +++ b/lib/generators/tailwindcss/authentication/templates/views/passwords/new.html.erb @@ -0,0 +1,17 @@ +
+ <%% if alert = flash[:alert] %> +

<%%= alert %>

+ <%% end %> + +

Forgot your password?

+ + <%%= form_with url: passwords_path, class: "contents" do |form| %> +
+ <%%= form.email_field :email_address, required: true, autofocus: true, autocomplete: "username", placeholder: "Enter your email address", value: params[:email_address], class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %> +
+ +
+ <%%= form.submit "Email reset instructions", class: "rounded-lg py-3 px-5 bg-blue-600 text-white inline-block font-medium cursor-pointer" %> +
+ <%% end %> +
diff --git a/lib/generators/tailwindcss/authentication/templates/views/sessions/new.html.erb b/lib/generators/tailwindcss/authentication/templates/views/sessions/new.html.erb new file mode 100644 index 0000000..a475154 --- /dev/null +++ b/lib/generators/tailwindcss/authentication/templates/views/sessions/new.html.erb @@ -0,0 +1,31 @@ +
+ <%% if alert = flash[:alert] %> +

<%%= alert %>

+ <%% end %> + + <%% if notice = flash[:notice] %> +

<%%= notice %>

+ <%% end %> + +

Sign in

+ + <%%= form_with url: session_url, class: "contents" do |form| %> +
+ <%%= form.email_field :email_address, required: true, autofocus: true, autocomplete: "username", placeholder: "Enter your email address", value: params[:email_address], class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %> +
+ +
+ <%%= form.password_field :password, required: true, autocomplete: "current-password", placeholder: "Enter your password", maxlength: 72, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %> +
+ +
+
+ <%%= form.submit "Sign in", class: "rounded-lg py-3 px-5 bg-blue-600 text-white inline-block font-medium cursor-pointer" %> +
+ +
+ <%%= link_to "Forgot password?", new_password_path, class: "text-gray-700 underline" %> +
+
+ <%% end %> +