gettext and heex user registration pages
This commit is contained in:
		| @@ -1,24 +0,0 @@ | ||||
| <div class="flex flex-col justify-center items-center space-y-4"> | ||||
|   <h1 class="title text-primary-500 text-xl"> | ||||
|     Resend confirmation instructions | ||||
|   </h1> | ||||
|  | ||||
|   <%= form_for :user, Routes.user_confirmation_path(@conn, :create), | ||||
|     [class: "flex flex-col justify-center items-center space-y-4"], fn f -> %> | ||||
|     <div class="grid grid-cols-3 justify-center items-center text-center space-x-4"> | ||||
|       <%= label f, :email, class: "title text-lg text-primary-500" %> | ||||
|       <%= email_input f, :email, required: true, class: "input input-primary col-span-2" %> | ||||
|     </div> | ||||
|  | ||||
|     <%= submit "Resend confirmation instructions", class: "btn btn-primary" %> | ||||
|      | ||||
|     <hr class="hr"> | ||||
|      | ||||
|     <div class="flex flex-row justify-center items-center space-x-4"> | ||||
|       <%= link "Register", to: Routes.user_registration_path(@conn, :new), | ||||
|         class: "btn btn-primary" %> | ||||
|       <%= link "Log in", to: Routes.user_session_path(@conn, :new), | ||||
|         class: "btn btn-primary" %> | ||||
|     </div> | ||||
|   <% end %> | ||||
| </div> | ||||
							
								
								
									
										30
									
								
								lib/cannery_web/templates/user_confirmation/new.html.heex
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								lib/cannery_web/templates/user_confirmation/new.html.heex
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,30 @@ | ||||
| <div class="flex flex-col justify-center items-center space-y-4"> | ||||
|   <h1 class="title text-primary-500 text-xl"> | ||||
|     <%= dgettext("actions", "Resend confirmation instructions") %> | ||||
|   </h1> | ||||
|  | ||||
|   <%= form_for :user, | ||||
|            Routes.user_confirmation_path(@conn, :create), | ||||
|            [class: "flex flex-col justify-center items-center space-y-4"], | ||||
|            fn f -> %> | ||||
|     <div class="grid grid-cols-3 justify-center items-center text-center space-x-4"> | ||||
|       <%= label(f, :email, class: "title text-lg text-primary-500") %> | ||||
|       <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %> | ||||
|     </div> | ||||
|  | ||||
|     <%= submit(dgettext("actions", "Resend confirmation instructions"), class: "btn btn-primary") %> | ||||
|  | ||||
|     <hr class="hr"> | ||||
|  | ||||
|     <div class="flex flex-row justify-center items-center space-x-4"> | ||||
|       <%= link(dgettext("actions", "Register"), | ||||
|         to: Routes.user_registration_path(@conn, :new), | ||||
|         class: "btn btn-primary" | ||||
|       ) %> | ||||
|       <%= link(dgettext("actions", "Log in"), | ||||
|         to: Routes.user_session_path(@conn, :new), | ||||
|         class: "btn btn-primary" | ||||
|       ) %> | ||||
|     </div> | ||||
|   <% end %> | ||||
| </div> | ||||
| @@ -1,41 +0,0 @@ | ||||
| <div class="flex flex-col justify-center items-center space-y-4"> | ||||
|   <h1 class="title text-primary-500 text-xl"> | ||||
|     Register | ||||
|   </h1> | ||||
|  | ||||
|   <%= form_for @changeset, Routes.user_registration_path(@conn, :create), | ||||
|     [class: "flex flex-col justify-center items-center space-y-4"], fn f -> %> | ||||
|     <%= if @changeset.action do %> | ||||
|       <div class="alert alert-danger"> | ||||
|         <p>Oops, something went wrong! Please check the errors below.</p> | ||||
|       </div> | ||||
|     <% end %> | ||||
|  | ||||
|     <%= if @invite do %> | ||||
|       <%= hidden_input f, :invite_token, value: @invite.token %> | ||||
|     <% end %> | ||||
|  | ||||
|     <div class="grid grid-cols-3 justify-center items-center text-center space-x-4"> | ||||
|       <%= label f, :email, class: "title text-lg text-primary-500" %> | ||||
|       <%= email_input f, :email, required: true, class: "input input-primary col-span-2" %> | ||||
|     </div> | ||||
|     <%= error_tag f, :email %> | ||||
|  | ||||
|     <div class="grid grid-cols-3 justify-center items-center text-center space-x-4"> | ||||
|       <%= label f, :password, class: "title text-lg text-primary-500" %> | ||||
|       <%= password_input f, :password, required: true, class: "input input-primary col-span-2" %> | ||||
|     </div> | ||||
|     <%= error_tag f, :password %> | ||||
|  | ||||
|     <%= submit "Register", class: "btn btn-primary" %> | ||||
|  | ||||
|     <hr class="hr"> | ||||
|  | ||||
|     <div class="flex flex-row justify-center items-center space-x-4"> | ||||
|       <%= link "Log in", to: Routes.user_session_path(@conn, :new), | ||||
|         class: "btn btn-primary" %> | ||||
|       <%= link "Forgot your password?", to: Routes.user_reset_password_path(@conn, :new), | ||||
|         class: "btn btn-primary" %> | ||||
|     </div> | ||||
|   <% end %> | ||||
| </div> | ||||
							
								
								
									
										49
									
								
								lib/cannery_web/templates/user_registration/new.html.heex
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										49
									
								
								lib/cannery_web/templates/user_registration/new.html.heex
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,49 @@ | ||||
| <div class="flex flex-col justify-center items-center space-y-4"> | ||||
|   <h1 class="title text-primary-500 text-xl"> | ||||
|     <%= dgettext("actions", "Register") %> | ||||
|   </h1> | ||||
|  | ||||
|   <%= form_for @changeset, | ||||
|            Routes.user_registration_path(@conn, :create), | ||||
|            [class: "flex flex-col justify-center items-center space-y-4"], | ||||
|            fn f -> %> | ||||
|     <%= if @changeset.action do %> | ||||
|       <div class="alert alert-danger"> | ||||
|         <p> | ||||
|           <%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %> | ||||
|         </p> | ||||
|       </div> | ||||
|     <% end %> | ||||
|  | ||||
|     <%= if @invite do %> | ||||
|       <%= hidden_input(f, :invite_token, value: @invite.token) %> | ||||
|     <% end %> | ||||
|  | ||||
|     <div class="grid grid-cols-3 justify-center items-center text-center space-x-4"> | ||||
|       <%= label(f, :email, class: "title text-lg text-primary-500") %> | ||||
|       <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %> | ||||
|     </div> | ||||
|     <%= error_tag(f, :email) %> | ||||
|  | ||||
|     <div class="grid grid-cols-3 justify-center items-center text-center space-x-4"> | ||||
|       <%= label(f, :password, class: "title text-lg text-primary-500") %> | ||||
|       <%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %> | ||||
|     </div> | ||||
|     <%= error_tag(f, :password) %> | ||||
|  | ||||
|     <%= submit(dgettext("actions", "Register"), class: "btn btn-primary") %> | ||||
|  | ||||
|     <hr class="hr"> | ||||
|  | ||||
|     <div class="flex flex-row justify-center items-center space-x-4"> | ||||
|       <%= link(dgettext("actions", "Log in"), | ||||
|         to: Routes.user_session_path(@conn, :new), | ||||
|         class: "btn btn-primary" | ||||
|       ) %> | ||||
|       <%= link(dgettext("actions", "Forgot your password?"), | ||||
|         to: Routes.user_reset_password_path(@conn, :new), | ||||
|         class: "btn btn-primary" | ||||
|       ) %> | ||||
|     </div> | ||||
|   <% end %> | ||||
| </div> | ||||
| @@ -1,37 +0,0 @@ | ||||
| <div class="flex flex-col justify-center items-center space-y-4"> | ||||
|   <h1 class="title text-primary-500 text-xl"> | ||||
|     Reset password | ||||
|   </h1> | ||||
|  | ||||
|   <%= form_for @changeset, Routes.user_reset_password_path(@conn, :update, @token), | ||||
|     [class: "flex flex-col justify-center items-center space-y-4"], fn f -> %> | ||||
|     <%= if @changeset.action do %> | ||||
|       <div class="alert alert-danger"> | ||||
|         <p>Oops, something went wrong! Please check the errors below.</p> | ||||
|       </div> | ||||
|     <% end %> | ||||
|  | ||||
|     <div class="grid grid-cols-3 justify-center items-center text-center space-x-4"> | ||||
|       <%= label f, :password, "New password", class: "title text-lg text-primary-500" %> | ||||
|       <%= password_input f, :password, required: true, class: "input input-primary col-span-2" %> | ||||
|     </div> | ||||
|     <%= error_tag f, :password %> | ||||
|  | ||||
|     <div class="grid grid-cols-3 justify-center items-center text-center space-x-4"> | ||||
|       <%= label f, :password_confirmation, "Confirm new password", class: "title text-lg text-primary-500" %> | ||||
|       <%= password_input f, :password_confirmation, required: true, class: "input input-primary col-span-2" %> | ||||
|     </div> | ||||
|     <%= error_tag f, :password_confirmation %> | ||||
|  | ||||
|     <%= submit "Reset password", class: "btn btn-primary" %> | ||||
|      | ||||
|     <hr class="hr"> | ||||
|      | ||||
|     <div class="flex flex-row justify-center items-center space-x-4"> | ||||
|       <%= link "Register", to: Routes.user_registration_path(@conn, :new), | ||||
|         class: "btn btn-primary" %> | ||||
|       <%= link "Log in", to: Routes.user_session_path(@conn, :new), | ||||
|         class: "btn btn-primary" %> | ||||
|     </div> | ||||
|   <% end %> | ||||
| </div> | ||||
							
								
								
									
										45
									
								
								lib/cannery_web/templates/user_reset_password/edit.html.heex
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								lib/cannery_web/templates/user_reset_password/edit.html.heex
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,45 @@ | ||||
| <div class="flex flex-col justify-center items-center space-y-4"> | ||||
|   <h1 class="title text-primary-500 text-xl"> | ||||
|     <%= dgettext("actions", "Reset password") %> | ||||
|   </h1> | ||||
|  | ||||
|   <%= form_for @changeset, | ||||
|            Routes.user_reset_password_path(@conn, :update, @token), | ||||
|            [class: "flex flex-col justify-center items-center space-y-4"], | ||||
|            fn f -> %> | ||||
|     <%= if @changeset.action do %> | ||||
|       <div class="alert alert-danger"> | ||||
|         <p> | ||||
|           <%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %> | ||||
|         </p> | ||||
|       </div> | ||||
|     <% end %> | ||||
|  | ||||
|     <div class="grid grid-cols-3 justify-center items-center text-center space-x-4"> | ||||
|       <%= label(f, :password, "New password", class: "title text-lg text-primary-500") %> | ||||
|       <%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %> | ||||
|     </div> | ||||
|     <%= error_tag(f, :password) %> | ||||
|  | ||||
|     <div class="grid grid-cols-3 justify-center items-center text-center space-x-4"> | ||||
|       <%= label(f, :password_confirmation, "Confirm new password", class: "title text-lg text-primary-500") %> | ||||
|       <%= password_input(f, :password_confirmation, required: true, class: "input input-primary col-span-2") %> | ||||
|     </div> | ||||
|     <%= error_tag(f, :password_confirmation) %> | ||||
|  | ||||
|     <%= submit(dgettext("actions", "Reset password"), class: "btn btn-primary") %> | ||||
|  | ||||
|     <hr class="hr"> | ||||
|  | ||||
|     <div class="flex flex-row justify-center items-center space-x-4"> | ||||
|       <%= link(dgettext("actions", "Register"), | ||||
|         to: Routes.user_registration_path(@conn, :new), | ||||
|         class: "btn btn-primary" | ||||
|       ) %> | ||||
|       <%= link(dgettext("actions", "Log in"), | ||||
|         to: Routes.user_session_path(@conn, :new), | ||||
|         class: "btn btn-primary" | ||||
|       ) %> | ||||
|     </div> | ||||
|   <% end %> | ||||
| </div> | ||||
| @@ -1,25 +0,0 @@ | ||||
| <div class="flex flex-col justify-center items-center space-y-4"> | ||||
|   <h1 class="title text-primary-500 text-xl"> | ||||
|     Forgot your password? | ||||
|   </h1> | ||||
|  | ||||
|   <%= form_for :user, Routes.user_reset_password_path(@conn, :create), | ||||
|     [class: "flex flex-col justify-center items-center space-y-4"], fn f -> %> | ||||
|      | ||||
|     <div class="grid grid-cols-3 justify-center items-center text-center space-x-4"> | ||||
|       <%= label f, :email, class: "title text-lg text-primary-500" %> | ||||
|       <%= email_input f, :email, required: true, class: "input input-primary col-span-2" %> | ||||
|     </div> | ||||
|  | ||||
|     <%= submit "Send instructions to reset password", class: "btn btn-primary" %> | ||||
|      | ||||
|     <hr class="hr"> | ||||
|      | ||||
|     <div class="flex flex-row justify-center items-center space-x-4"> | ||||
|       <%= link "Register", to: Routes.user_registration_path(@conn, :new), | ||||
|         class: "btn btn-primary" %> | ||||
|       <%= link "Log in", to: Routes.user_session_path(@conn, :new), | ||||
|         class: "btn btn-primary" %> | ||||
|     </div> | ||||
|   <% end %> | ||||
| </div> | ||||
							
								
								
									
										31
									
								
								lib/cannery_web/templates/user_reset_password/new.html.heex
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								lib/cannery_web/templates/user_reset_password/new.html.heex
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,31 @@ | ||||
| <div class="flex flex-col justify-center items-center space-y-4"> | ||||
|   <h1 class="title text-primary-500 text-xl"> | ||||
|     <%= dgettext("actions", "Forgot your password?") %> | ||||
|   </h1> | ||||
|  | ||||
|   <%= form_for :user, | ||||
|            Routes.user_reset_password_path(@conn, :create), | ||||
|            [class: "flex flex-col justify-center items-center space-y-4"], | ||||
|            fn f -> %> | ||||
|  | ||||
|     <div class="grid grid-cols-3 justify-center items-center text-center space-x-4"> | ||||
|       <%= label(f, :email, class: "title text-lg text-primary-500") %> | ||||
|       <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %> | ||||
|     </div> | ||||
|  | ||||
|     <%= submit(dgettext("actions", "Send instructions to reset password"), class: "btn btn-primary") %> | ||||
|  | ||||
|     <hr class="hr"> | ||||
|  | ||||
|     <div class="flex flex-row justify-center items-center space-x-4"> | ||||
|       <%= link(dgettext("actions", "Register"), | ||||
|         to: Routes.user_registration_path(@conn, :new), | ||||
|         class: "btn btn-primary" | ||||
|       ) %> | ||||
|       <%= link(dgettext("actions", "Log in"), | ||||
|         to: Routes.user_session_path(@conn, :new), | ||||
|         class: "btn btn-primary" | ||||
|       ) %> | ||||
|     </div> | ||||
|   <% end %> | ||||
| </div> | ||||
| @@ -1,41 +0,0 @@ | ||||
| <div class="flex flex-col justify-center items-center space-y-4"> | ||||
|   <h1 class="title text-primary-500 text-xl"> | ||||
|     Log in | ||||
|   </h1> | ||||
|  | ||||
|   <%= form_for @conn, Routes.user_session_path(@conn, :create), [as: :user, | ||||
|     class: "flex flex-col justify-center items-center space-y-4"], fn f -> %> | ||||
|     <%= if @error_message do %> | ||||
|       <div class="alert alert-danger"> | ||||
|         <p><%= @error_message %></p> | ||||
|       </div> | ||||
|     <% end %> | ||||
|  | ||||
|     <div class="grid grid-cols-3 justify-center items-center text-center space-x-4"> | ||||
|       <%= label f, :email, class: "title text-lg text-primary-500" %> | ||||
|       <%= email_input f, :email, required: true, class: "input input-primary col-span-2" %> | ||||
|     </div> | ||||
|  | ||||
|     <div class="grid grid-cols-3 justify-center items-center text-center space-x-4"> | ||||
|       <%= label f, :password, class: "title text-lg text-primary-500" %> | ||||
|       <%= password_input f, :password, required: true, class: "input input-primary col-span-2" %> | ||||
|     </div> | ||||
|  | ||||
|     <div class="flex flex-row justify-center items-center text-center space-x-4"> | ||||
|       <%= label f, :remember_me, "Keep me logged in for 60 days", | ||||
|         class: "title text-lg text-primary-500" %> | ||||
|       <%= checkbox f, :remember_me, class: "checkbox" %> | ||||
|     </div> | ||||
|  | ||||
|     <%= submit "Log in", class: "btn btn-primary" %> | ||||
|      | ||||
|     <hr class="hr"> | ||||
|      | ||||
|     <div class="flex flex-row justify-center items-center space-x-4"> | ||||
|       <%= link "Register", to: Routes.user_registration_path(@conn, :new), | ||||
|         class: "btn btn-primary" %> | ||||
|       <%= link "Forgot your password?", to: Routes.user_reset_password_path(@conn, :new), | ||||
|         class: "btn btn-primary" %> | ||||
|     </div> | ||||
|   <% end %> | ||||
| </div> | ||||
							
								
								
									
										50
									
								
								lib/cannery_web/templates/user_session/new.html.heex
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										50
									
								
								lib/cannery_web/templates/user_session/new.html.heex
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,50 @@ | ||||
| <div class="flex flex-col justify-center items-center space-y-4"> | ||||
|   <h1 class="title text-primary-500 text-xl"> | ||||
|     <%= dgettext("actions", "Log in") %> | ||||
|   </h1> | ||||
|  | ||||
|   <%= form_for @conn, | ||||
|            Routes.user_session_path(@conn, :create), | ||||
|            [as: :user, class: "flex flex-col justify-center items-center space-y-4"], | ||||
|            fn f -> %> | ||||
|     <%= if @error_message do %> | ||||
|       <div class="alert alert-danger"> | ||||
|         <p> | ||||
|           <%= @error_message %> | ||||
|         </p> | ||||
|       </div> | ||||
|     <% end %> | ||||
|  | ||||
|     <div class="grid grid-cols-3 justify-center items-center text-center space-x-4"> | ||||
|       <%= label(f, :email, class: "title text-lg text-primary-500") %> | ||||
|       <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %> | ||||
|     </div> | ||||
|  | ||||
|     <div class="grid grid-cols-3 justify-center items-center text-center space-x-4"> | ||||
|       <%= label(f, :password, class: "title text-lg text-primary-500") %> | ||||
|       <%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %> | ||||
|     </div> | ||||
|  | ||||
|     <div class="flex flex-row justify-center items-center text-center space-x-4"> | ||||
|       <%= label(f, :remember_me, gettext("Keep me logged in for 60 days"), | ||||
|         class: "title text-lg text-primary-500" | ||||
|       ) %> | ||||
|       <%= checkbox(f, :remember_me, class: "checkbox") %> | ||||
|     </div> | ||||
|  | ||||
|     <%= submit(dgettext("actions", "Log in"), class: "btn btn-primary") %> | ||||
|  | ||||
|     <hr class="hr"> | ||||
|  | ||||
|     <div class="flex flex-row justify-center items-center space-x-4"> | ||||
|       <%= link(dgettext("actions", "Register"), | ||||
|         to: Routes.user_registration_path(@conn, :new), | ||||
|         class: "btn btn-primary" | ||||
|       ) %> | ||||
|       <%= link(dgettext("actions", "Forgot your password?"), | ||||
|         to: Routes.user_reset_password_path(@conn, :new), | ||||
|         class: "btn btn-primary" | ||||
|       ) %> | ||||
|     </div> | ||||
|   <% end %> | ||||
| </div> | ||||
| @@ -1,89 +0,0 @@ | ||||
| <div class="mb-8 flex flex-col justify-center items-center space-y-8"> | ||||
|   <h1 class="title text-primary-500 text-xl"> | ||||
|     Settings | ||||
|   </h1> | ||||
|  | ||||
|   <h3 class="title text-primary-500 text-lg"> | ||||
|     Change email | ||||
|   </h3> | ||||
|  | ||||
|   <%= form_for @email_changeset, Routes.user_settings_path(@conn, :update), | ||||
|     [class: "flex flex-col justify-center items-center space-y-4"], fn f -> %> | ||||
|     <%= if @email_changeset.action do %> | ||||
|       <div class="alert alert-danger"> | ||||
|         <p>Oops, something went wrong! Please check the errors below.</p> | ||||
|       </div> | ||||
|     <% end %> | ||||
|  | ||||
|     <%= hidden_input f, :action, name: "action", value: "update_email" %> | ||||
|  | ||||
|     <div class="grid grid-cols-3 justify-center items-center text-center space-x-4"> | ||||
|       <%= label f, :email, class: "title text-lg text-primary-500" %> | ||||
|       <%= email_input f, :email, required: true, class: "input input-primary col-span-2" %> | ||||
|     </div> | ||||
|     <%= error_tag f, :email %> | ||||
|  | ||||
|     <div class="grid grid-cols-3 justify-center items-center text-center space-x-4"> | ||||
|       <%= label f, :current_password, for: "current_password_for_email", class: "title text-lg text-primary-500" %> | ||||
|       <%= password_input f, :current_password, | ||||
|         required: true, | ||||
|         name: "current_password", | ||||
|         id: "current_password_for_email", | ||||
|         class: "input input-primary col-span-2" %> | ||||
|     </div> | ||||
|     <%= error_tag f, :current_password %> | ||||
|  | ||||
|     <%= submit "Change email", class: "btn btn-primary" %> | ||||
|   <% end %> | ||||
|  | ||||
|   <h3 class="title text-primary-500 text-lg"> | ||||
|     Change password | ||||
|   </h3> | ||||
|  | ||||
|   <%= form_for @password_changeset, Routes.user_settings_path(@conn, :update), | ||||
|     [class: "flex flex-col justify-center items-center space-y-4"], fn f -> %> | ||||
|     <%= if @password_changeset.action do %> | ||||
|       <div class="alert alert-danger"> | ||||
|         <p>Oops, something went wrong! Please check the errors below.</p> | ||||
|       </div> | ||||
|     <% end %> | ||||
|  | ||||
|     <%= hidden_input f, :action, name: "action", value: "update_password" %> | ||||
|  | ||||
|     <div class="grid grid-cols-3 justify-center items-center text-center space-x-4"> | ||||
|       <%= label f, :password, "New password", | ||||
|         class: "title text-lg text-primary-500" %> | ||||
|       <%= password_input f, :password, | ||||
|         required: true, | ||||
|         class: "input input-primary col-span-2" %> | ||||
|     </div> | ||||
|     <%= error_tag f, :password %> | ||||
|  | ||||
|     <div class="grid grid-cols-3 justify-center items-center text-center space-x-4"> | ||||
|       <%= label f, :password_confirmation, "Confirm new password", | ||||
|         class: "title text-lg text-primary-500" %> | ||||
|       <%= password_input f, :password_confirmation, | ||||
|         required: true, | ||||
|         class: "input input-primary col-span-2" %> | ||||
|     </div> | ||||
|     <%= error_tag f, :password_confirmation %> | ||||
|  | ||||
|     <div class="grid grid-cols-3 justify-center items-center text-center space-x-4"> | ||||
|       <%= label f, :current_password, | ||||
|         for: "current_password_for_password", | ||||
|         class: "title text-lg text-primary-500" %> | ||||
|       <%= password_input f, :current_password, | ||||
|         required: true, | ||||
|         name: "current_password", | ||||
|         id: "current_password_for_password", | ||||
|         class: "input input-primary col-span-2" %> | ||||
|     </div> | ||||
|     <%= error_tag f, :current_password %> | ||||
|  | ||||
|     <%= submit "Change password", class: "btn btn-primary" %> | ||||
|   <% end %> | ||||
|  | ||||
|   <%= link "Delete User", to: Routes.user_settings_path(@conn, :delete, @current_user), | ||||
|     method: :delete, class: "btn btn-alert", | ||||
|     data: [confirm: "Are you sure you want to delete your account?"] %> | ||||
| </div> | ||||
							
								
								
									
										106
									
								
								lib/cannery_web/templates/user_settings/edit.html.heex
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										106
									
								
								lib/cannery_web/templates/user_settings/edit.html.heex
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,106 @@ | ||||
| <div class="mb-8 flex flex-col justify-center items-center space-y-8"> | ||||
|   <h1 class="title text-primary-500 text-xl"> | ||||
|     <%= gettext("Settings") %> | ||||
|   </h1> | ||||
|  | ||||
|   <h3 class="title text-primary-500 text-lg"> | ||||
|     <%= dgettext("actions", "Change email") %> | ||||
|   </h3> | ||||
|  | ||||
|   <%= form_for @email_changeset, | ||||
|            Routes.user_settings_path(@conn, :update), | ||||
|            [class: "flex flex-col justify-center items-center space-y-4"], | ||||
|            fn f -> %> | ||||
|     <%= if @email_changeset.action do %> | ||||
|       <div class="alert alert-danger"> | ||||
|         <p> | ||||
|           <%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %> | ||||
|         </p> | ||||
|       </div> | ||||
|     <% end %> | ||||
|  | ||||
|     <%= hidden_input(f, :action, name: "action", value: "update_email") %> | ||||
|  | ||||
|     <div class="grid grid-cols-3 justify-center items-center text-center space-x-4"> | ||||
|       <%= label(f, :email, class: "title text-lg text-primary-500") %> | ||||
|       <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %> | ||||
|     </div> | ||||
|     <%= error_tag(f, :email) %> | ||||
|  | ||||
|     <div class="grid grid-cols-3 justify-center items-center text-center space-x-4"> | ||||
|       <%= label(f, :current_password, | ||||
|         for: "current_password_for_email", | ||||
|         class: "title text-lg text-primary-500" | ||||
|       ) %> | ||||
|       <%= password_input(f, :current_password, | ||||
|         required: true, | ||||
|         name: "current_password", | ||||
|         id: "current_password_for_email", | ||||
|         class: "input input-primary col-span-2" | ||||
|       ) %> | ||||
|     </div> | ||||
|     <%= error_tag(f, :current_password) %> | ||||
|  | ||||
|     <%= submit(dgettext("actions", "Change email"), class: "btn btn-primary") %> | ||||
|   <% end %> | ||||
|  | ||||
|   <h3 class="title text-primary-500 text-lg"> | ||||
|     <%= dgettext("actions", "Change password") %> | ||||
|   </h3> | ||||
|  | ||||
|   <%= form_for @password_changeset, | ||||
|            Routes.user_settings_path(@conn, :update), | ||||
|            [class: "flex flex-col justify-center items-center space-y-4"], | ||||
|            fn f -> %> | ||||
|     <%= if @password_changeset.action do %> | ||||
|       <div class="alert alert-danger"> | ||||
|         <p> | ||||
|           <%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %> | ||||
|         </p> | ||||
|       </div> | ||||
|     <% end %> | ||||
|  | ||||
|     <%= hidden_input(f, :action, name: "action", value: "update_password") %> | ||||
|  | ||||
|     <div class="grid grid-cols-3 justify-center items-center text-center space-x-4"> | ||||
|       <%= label(f, :password, "New password", class: "title text-lg text-primary-500") %> | ||||
|       <%= password_input(f, :password, | ||||
|         required: true, | ||||
|         class: "input input-primary col-span-2" | ||||
|       ) %> | ||||
|     </div> | ||||
|     <%= error_tag(f, :password) %> | ||||
|  | ||||
|     <div class="grid grid-cols-3 justify-center items-center text-center space-x-4"> | ||||
|       <%= label(f, :password_confirmation, "Confirm new password", class: "title text-lg text-primary-500") %> | ||||
|       <%= password_input(f, :password_confirmation, | ||||
|         required: true, | ||||
|         class: "input input-primary col-span-2" | ||||
|       ) %> | ||||
|     </div> | ||||
|     <%= error_tag(f, :password_confirmation) %> | ||||
|  | ||||
|     <div class="grid grid-cols-3 justify-center items-center text-center space-x-4"> | ||||
|       <%= label(f, :current_password, | ||||
|         for: "current_password_for_password", | ||||
|         class: "title text-lg text-primary-500" | ||||
|       ) %> | ||||
|       <%= password_input(f, :current_password, | ||||
|         required: true, | ||||
|         name: "current_password", | ||||
|         id: "current_password_for_password", | ||||
|         class: "input input-primary col-span-2" | ||||
|       ) %> | ||||
|     </div> | ||||
|     <%= error_tag(f, :current_password) %> | ||||
|  | ||||
|     <%= submit(dgettext("actions", "Change password"), class: "btn btn-primary") %> | ||||
|   <% end %> | ||||
|  | ||||
|   <%= link(dgettext("actions", "Delete User"), | ||||
|     to: Routes.user_settings_path(@conn, :delete, @current_user), | ||||
|     method: :delete, | ||||
|     class: "btn btn-alert", | ||||
|     data: [confirm: dgettext("prompts", "Are you sure you want to delete your account?")] | ||||
|   ) %> | ||||
| </div> | ||||
		Reference in New Issue
	
	Block a user