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/layout/_user_menu.html.heex | 10 ++++ lib/aggiedit_web/templates/layout/app.html.heex | 5 ++ lib/aggiedit_web/templates/layout/live.html.heex | 11 +++++ lib/aggiedit_web/templates/layout/root.html.heex | 31 +++++++++++++ lib/aggiedit_web/templates/page/index.html.heex | 41 +++++++++++++++++ .../templates/user_confirmation/edit.html.heex | 12 +++++ .../templates/user_confirmation/new.html.heex | 15 ++++++ .../templates/user_registration/new.html.heex | 30 ++++++++++++ .../templates/user_reset_password/edit.html.heex | 26 +++++++++++ .../templates/user_reset_password/new.html.heex | 15 ++++++ .../templates/user_session/new.html.heex | 27 +++++++++++ .../templates/user_settings/edit.html.heex | 53 ++++++++++++++++++++++ 12 files changed, 276 insertions(+) create mode 100644 lib/aggiedit_web/templates/layout/_user_menu.html.heex create mode 100644 lib/aggiedit_web/templates/layout/app.html.heex create mode 100644 lib/aggiedit_web/templates/layout/live.html.heex create mode 100644 lib/aggiedit_web/templates/layout/root.html.heex create mode 100644 lib/aggiedit_web/templates/page/index.html.heex create mode 100644 lib/aggiedit_web/templates/user_confirmation/edit.html.heex create mode 100644 lib/aggiedit_web/templates/user_confirmation/new.html.heex create mode 100644 lib/aggiedit_web/templates/user_registration/new.html.heex create mode 100644 lib/aggiedit_web/templates/user_reset_password/edit.html.heex create mode 100644 lib/aggiedit_web/templates/user_reset_password/new.html.heex create mode 100644 lib/aggiedit_web/templates/user_session/new.html.heex create mode 100644 lib/aggiedit_web/templates/user_settings/edit.html.heex (limited to 'lib/aggiedit_web/templates') diff --git a/lib/aggiedit_web/templates/layout/_user_menu.html.heex b/lib/aggiedit_web/templates/layout/_user_menu.html.heex new file mode 100644 index 0000000..f281cfc --- /dev/null +++ b/lib/aggiedit_web/templates/layout/_user_menu.html.heex @@ -0,0 +1,10 @@ + diff --git a/lib/aggiedit_web/templates/layout/app.html.heex b/lib/aggiedit_web/templates/layout/app.html.heex new file mode 100644 index 0000000..169aed9 --- /dev/null +++ b/lib/aggiedit_web/templates/layout/app.html.heex @@ -0,0 +1,5 @@ +
+ + + <%= @inner_content %> +
diff --git a/lib/aggiedit_web/templates/layout/live.html.heex b/lib/aggiedit_web/templates/layout/live.html.heex new file mode 100644 index 0000000..a29d604 --- /dev/null +++ b/lib/aggiedit_web/templates/layout/live.html.heex @@ -0,0 +1,11 @@ +
+ + + + + <%= @inner_content %> +
diff --git a/lib/aggiedit_web/templates/layout/root.html.heex b/lib/aggiedit_web/templates/layout/root.html.heex new file mode 100644 index 0000000..f653fd8 --- /dev/null +++ b/lib/aggiedit_web/templates/layout/root.html.heex @@ -0,0 +1,31 @@ + + + + + + + <%= csrf_meta_tag() %> + <%= live_title_tag assigns[:page_title] || "Aggiedit", suffix: " ยท Phoenix Framework" %> + + + + +
+
+ + +
+
+ <%= @inner_content %> + + diff --git a/lib/aggiedit_web/templates/page/index.html.heex b/lib/aggiedit_web/templates/page/index.html.heex new file mode 100644 index 0000000..f844bd8 --- /dev/null +++ b/lib/aggiedit_web/templates/page/index.html.heex @@ -0,0 +1,41 @@ +
+

<%= gettext "Welcome to %{name}!", name: "Phoenix" %>

+

Peace of mind from prototype to production

+
+ +
+ + +
diff --git a/lib/aggiedit_web/templates/user_confirmation/edit.html.heex b/lib/aggiedit_web/templates/user_confirmation/edit.html.heex new file mode 100644 index 0000000..e9bf443 --- /dev/null +++ b/lib/aggiedit_web/templates/user_confirmation/edit.html.heex @@ -0,0 +1,12 @@ +

Confirm account

+ +<.form let={_f} for={:user} action={Routes.user_confirmation_path(@conn, :update, @token)}> +
+ <%= submit "Confirm my account" %> +
+ + +

+ <%= link "Register", to: Routes.user_registration_path(@conn, :new) %> | + <%= link "Log in", to: Routes.user_session_path(@conn, :new) %> +

diff --git a/lib/aggiedit_web/templates/user_confirmation/new.html.heex b/lib/aggiedit_web/templates/user_confirmation/new.html.heex new file mode 100644 index 0000000..4d9bee3 --- /dev/null +++ b/lib/aggiedit_web/templates/user_confirmation/new.html.heex @@ -0,0 +1,15 @@ +

Resend confirmation instructions

+ +<.form let={f} for={:user} action={Routes.user_confirmation_path(@conn, :create)}> + <%= label f, :email %> + <%= email_input f, :email, required: true %> + +
+ <%= submit "Resend confirmation instructions" %> +
+ + +

+ <%= link "Register", to: Routes.user_registration_path(@conn, :new) %> | + <%= link "Log in", to: Routes.user_session_path(@conn, :new) %> +

diff --git a/lib/aggiedit_web/templates/user_registration/new.html.heex b/lib/aggiedit_web/templates/user_registration/new.html.heex new file mode 100644 index 0000000..6ff00fc --- /dev/null +++ b/lib/aggiedit_web/templates/user_registration/new.html.heex @@ -0,0 +1,30 @@ +

Register

+ +<.form let={f} for={@changeset} action={Routes.user_registration_path(@conn, :create)}> + <%= if @changeset.action do %> +
+

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

+
+ <% end %> + + <%= label f, :email %> + <%= email_input f, :email, required: true %> + <%= error_tag f, :email %> + + <%= label f, :username %> + <%= text_input f, :username, required: true %> + <%= error_tag f, :username %> + + <%= label f, :password %> + <%= password_input f, :password, required: true %> + <%= error_tag f, :password %> + +
+ <%= submit "Register" %> +
+ + +

+ <%= link "Log in", to: Routes.user_session_path(@conn, :new) %> | + <%= link "Forgot your password?", to: Routes.user_reset_password_path(@conn, :new) %> +

diff --git a/lib/aggiedit_web/templates/user_reset_password/edit.html.heex b/lib/aggiedit_web/templates/user_reset_password/edit.html.heex new file mode 100644 index 0000000..d8efb4b --- /dev/null +++ b/lib/aggiedit_web/templates/user_reset_password/edit.html.heex @@ -0,0 +1,26 @@ +

Reset password

+ +<.form let={f} for={@changeset} action={Routes.user_reset_password_path(@conn, :update, @token)}> + <%= if @changeset.action do %> +
+

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

+
+ <% end %> + + <%= 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 %> + +
+ <%= submit "Reset password" %> +
+ + +

+ <%= link "Register", to: Routes.user_registration_path(@conn, :new) %> | + <%= link "Log in", to: Routes.user_session_path(@conn, :new) %> +

diff --git a/lib/aggiedit_web/templates/user_reset_password/new.html.heex b/lib/aggiedit_web/templates/user_reset_password/new.html.heex new file mode 100644 index 0000000..126cdba --- /dev/null +++ b/lib/aggiedit_web/templates/user_reset_password/new.html.heex @@ -0,0 +1,15 @@ +

Forgot your password?

+ +<.form let={f} for={:user} action={Routes.user_reset_password_path(@conn, :create)}> + <%= label f, :email %> + <%= email_input f, :email, required: true %> + +
+ <%= submit "Send instructions to reset password" %> +
+ + +

+ <%= link "Register", to: Routes.user_registration_path(@conn, :new) %> | + <%= link "Log in", to: Routes.user_session_path(@conn, :new) %> +

diff --git a/lib/aggiedit_web/templates/user_session/new.html.heex b/lib/aggiedit_web/templates/user_session/new.html.heex new file mode 100644 index 0000000..49a7d79 --- /dev/null +++ b/lib/aggiedit_web/templates/user_session/new.html.heex @@ -0,0 +1,27 @@ +

Log in

+ +<.form let={f} for={@conn} action={Routes.user_session_path(@conn, :create)} as={:user}> + <%= if @error_message do %> +
+

<%= @error_message %>

+
+ <% end %> + + <%= label f, :email %> + <%= email_input f, :email, required: true %> + + <%= label f, :password %> + <%= password_input f, :password, required: true %> + + <%= label f, :remember_me, "Keep me logged in for 60 days" %> + <%= checkbox f, :remember_me %> + +
+ <%= submit "Log in" %> +
+ + +

+ <%= link "Register", to: Routes.user_registration_path(@conn, :new) %> | + <%= link "Forgot your password?", to: Routes.user_reset_password_path(@conn, :new) %> +

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