From 775e6146ab0e3d56815c2585514076ce7019ef32 Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Sat, 30 Nov 2024 10:44:19 +0100 Subject: [PATCH] Revert "Remove unnecessary views" This reverts commit 8b336164362bada541f1dbac48dd46419638d5f5. --- app/views/passwords/edit.html.erb | 11 +++++++++++ app/views/passwords/new.html.erb | 10 ++++++++++ app/views/sessions/new.html.erb | 13 +++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 app/views/passwords/edit.html.erb create mode 100644 app/views/passwords/new.html.erb create mode 100644 app/views/sessions/new.html.erb diff --git a/app/views/passwords/edit.html.erb b/app/views/passwords/edit.html.erb new file mode 100644 index 0000000..8b76bbf --- /dev/null +++ b/app/views/passwords/edit.html.erb @@ -0,0 +1,11 @@ +<%# Copyright (C) 2024 Manuel Bustillo %> + +

Update your password

+ +<%= tag.div(flash[:alert], style: "color:red") if flash[:alert] %> + +<%= form_with url: password_path(params[:token]), method: :put do |form| %> + <%= form.password_field :password, required: true, autocomplete: "new-password", placeholder: "Enter new password", maxlength: 72 %>
+ <%= form.password_field :password_confirmation, required: true, autocomplete: "new-password", placeholder: "Repeat new password", maxlength: 72 %>
+ <%= form.submit "Save" %> +<% end %> diff --git a/app/views/passwords/new.html.erb b/app/views/passwords/new.html.erb new file mode 100644 index 0000000..2572313 --- /dev/null +++ b/app/views/passwords/new.html.erb @@ -0,0 +1,10 @@ +<%# Copyright (C) 2024 Manuel Bustillo %> + +

Forgot your password?

+ +<%= tag.div(flash[:alert], style: "color:red") if flash[:alert] %> + +<%= form_with url: passwords_path do |form| %> + <%= form.email_field :email_address, required: true, autofocus: true, autocomplete: "username", placeholder: "Enter your email address", value: params[:email_address] %>
+ <%= form.submit "Email reset instructions" %> +<% end %> diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb new file mode 100644 index 0000000..e78774d --- /dev/null +++ b/app/views/sessions/new.html.erb @@ -0,0 +1,13 @@ +<%# Copyright (C) 2024 Manuel Bustillo %> + +<%= tag.div(flash[:alert], style: "color:red") if flash[:alert] %> +<%= tag.div(flash[:notice], style: "color:green") if flash[:notice] %> + +<%= form_with url: session_path do |form| %> + <%= form.email_field :email_address, required: true, autofocus: true, autocomplete: "username", placeholder: "Enter your email address", value: params[:email_address] %>
+ <%= form.password_field :password, required: true, autocomplete: "current-password", placeholder: "Enter your password", maxlength: 72 %>
+ <%= form.submit "Sign in" %> +<% end %> +
+ +<%= link_to "Forgot password?", new_password_path %>