From 2055742911201258e6f755b3eb4031a1b09407f1 Mon Sep 17 00:00:00 2001 From: Logan Hunt Date: Wed, 6 Apr 2022 12:13:54 -0600 Subject: Initial commit; generate auth code with phx.gen.auth; added room model and association; generate room model on domain of user emails; allow users to change their email --- .../templates/user_settings/edit.html.heex | 53 ++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 lib/aggiedit_web/templates/user_settings/edit.html.heex (limited to 'lib/aggiedit_web/templates/user_settings/edit.html.heex') diff --git a/lib/aggiedit_web/templates/user_settings/edit.html.heex b/lib/aggiedit_web/templates/user_settings/edit.html.heex new file mode 100644 index 0000000..9863bc5 --- /dev/null +++ b/lib/aggiedit_web/templates/user_settings/edit.html.heex @@ -0,0 +1,53 @@ +

Settings

+ +

Change email

+ +<.form let={f} for={@email_changeset} action={Routes.user_settings_path(@conn, :update)} id="update_email"> + <%= if @email_changeset.action do %> +
+

Oops, something went wrong! Please check the errors below.

+
+ <% end %> + + <%= hidden_input f, :action, name: "action", value: "update_email" %> + + <%= label f, :email %> + <%= email_input f, :email, required: true %> + <%= error_tag f, :email %> + + <%= label f, :current_password, for: "current_password_for_email" %> + <%= password_input f, :current_password, required: true, name: "current_password", id: "current_password_for_email" %> + <%= error_tag f, :current_password %> + +
+ <%= submit "Change email" %> +
+ + +

Change password

+ +<.form let={f} for={@password_changeset} action={Routes.user_settings_path(@conn, :update)} id="update_password"> + <%= if @password_changeset.action do %> +
+

Oops, something went wrong! Please check the errors below.

+
+ <% end %> + + <%= hidden_input f, :action, name: "action", value: "update_password" %> + + <%= label f, :password, "New password" %> + <%= password_input f, :password, required: true %> + <%= error_tag f, :password %> + + <%= label f, :password_confirmation, "Confirm new password" %> + <%= password_input f, :password_confirmation, required: true %> + <%= error_tag f, :password_confirmation %> + + <%= label f, :current_password, for: "current_password_for_password" %> + <%= password_input f, :current_password, required: true, name: "current_password", id: "current_password_for_password" %> + <%= error_tag f, :current_password %> + +
+ <%= submit "Change password" %> +
+ -- cgit v1.2.3-70-g09d2