From 059004ba782ed66be67eb9775a1a06950ccf873c Mon Sep 17 00:00:00 2001 From: shibao Date: Wed, 16 Feb 2022 22:15:47 -0500 Subject: [PATCH] mix format --- lib/lokal_web/templates/layout/app.html.heex | 6 +- lib/lokal_web/templates/layout/live.html.heex | 6 +- .../templates/user_confirmation/new.html.heex | 36 ++++---- .../templates/user_registration/new.html.heex | 48 +++++------ .../user_reset_password/edit.html.heex | 48 +++++------ .../user_reset_password/new.html.heex | 37 ++++---- .../templates/user_session/new.html.heex | 52 ++++++------ .../templates/user_settings/edit.html.heex | 85 +++++++++---------- 8 files changed, 157 insertions(+), 161 deletions(-) diff --git a/lib/lokal_web/templates/layout/app.html.heex b/lib/lokal_web/templates/layout/app.html.heex index 3c8a34e6..ec9a6b37 100644 --- a/lib/lokal_web/templates/layout/app.html.heex +++ b/lib/lokal_web/templates/layout/app.html.heex @@ -1,19 +1,17 @@
- <.topbar current_user={assigns[:current_user]}> - + <.topbar current_user={assigns[:current_user]}> + <%= if get_flash(@conn, :info) do %> <% end %> - <%= if get_flash(@conn, :error) do %> <% end %>
- <%= @inner_content %>
diff --git a/lib/lokal_web/templates/layout/live.html.heex b/lib/lokal_web/templates/layout/live.html.heex index f99debfa..77cb1b0c 100644 --- a/lib/lokal_web/templates/layout/live.html.heex +++ b/lib/lokal_web/templates/layout/live.html.heex @@ -1,19 +1,17 @@
- <.topbar current_user={assigns[:current_user]}> - + <.topbar current_user={assigns[:current_user]}> + <%= if @flash && @flash |> Map.has_key?(:info) do %> <% end %> - <%= if @flash && @flash |> Map.has_key?(:error) do %> <% end %>
- <%= @inner_content %>
diff --git a/lib/lokal_web/templates/user_confirmation/new.html.heex b/lib/lokal_web/templates/user_confirmation/new.html.heex index 4d71f6c1..2a579c6a 100644 --- a/lib/lokal_web/templates/user_confirmation/new.html.heex +++ b/lib/lokal_web/templates/user_confirmation/new.html.heex @@ -2,23 +2,25 @@

Resend confirmation instructions

- - <%= form_for :user, Routes.user_confirmation_path(@conn, :create), - [class: "flex flex-col justify-center items-center space-y-4"], fn f -> %> + <%= form_for :user, + Routes.user_confirmation_path(@conn, :create), + [class: "flex flex-col justify-center items-center space-y-4"], + fn f -> %>
- <%= label f, :email, class: "title text-lg text-primary-500" %> - <%= email_input f, :email, required: true, class: "input input-primary col-span-2" %> + <%= label(f, :email, class: "title text-lg text-primary-500") %> + <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
- - <%= submit "Resend confirmation instructions", class: "btn btn-primary" %> - + <%= submit("Resend confirmation instructions", class: "btn btn-primary") %>
- -
- <%= 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" %> -
- <% end %> - \ No newline at end of file +
+ <%= 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" + ) %> +
+ <% end %> + diff --git a/lib/lokal_web/templates/user_registration/new.html.heex b/lib/lokal_web/templates/user_registration/new.html.heex index efd16e08..71f4aaf9 100644 --- a/lib/lokal_web/templates/user_registration/new.html.heex +++ b/lib/lokal_web/templates/user_registration/new.html.heex @@ -2,36 +2,36 @@

Register

- - <%= 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 && not(@changeset.valid?) do %> + <%= 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 && not @changeset.valid? do %>

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

<% end %> -
- <%= label f, :email, class: "title text-lg text-primary-500" %> - <%= email_input f, :email, required: true, class: "input input-primary col-span-2" %> + <%= label(f, :email, class: "title text-lg text-primary-500") %> + <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
- <%= error_tag f, :email %> - + <%= error_tag(f, :email) %>
- <%= label f, :password, class: "title text-lg text-primary-500" %> - <%= password_input f, :password, required: true, class: "input input-primary col-span-2" %> + <%= label(f, :password, class: "title text-lg text-primary-500") %> + <%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %>
- <%= error_tag f, :password %> - - <%= submit "Register", class: "btn btn-primary" %> - + <%= error_tag(f, :password) %> + <%= submit("Register", class: "btn btn-primary") %>
- -
- <%= 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" %> -
- <% end %> - +
+ <%= 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" + ) %> +
+ <% end %> + diff --git a/lib/lokal_web/templates/user_reset_password/edit.html.heex b/lib/lokal_web/templates/user_reset_password/edit.html.heex index 7d1c5702..cbe8d913 100644 --- a/lib/lokal_web/templates/user_reset_password/edit.html.heex +++ b/lib/lokal_web/templates/user_reset_password/edit.html.heex @@ -2,36 +2,36 @@

Reset password

- - <%= 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 && not(@changeset.valid?) do %> + <%= 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 && not @changeset.valid? do %>

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

<% end %> -
- <%= 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" %> + <%= 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") %>
- <%= error_tag f, :password %> - + <%= error_tag(f, :password) %>
- <%= 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" %> + <%= 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") %>
- <%= error_tag f, :password_confirmation %> - - <%= submit "Reset password", class: "btn btn-primary" %> - + <%= error_tag(f, :password_confirmation) %> + <%= submit("Reset password", class: "btn btn-primary") %>
- -
- <%= 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" %> -
- <% end %> - +
+ <%= 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" + ) %> +
+ <% end %> + diff --git a/lib/lokal_web/templates/user_reset_password/new.html.heex b/lib/lokal_web/templates/user_reset_password/new.html.heex index 731ba7d2..a82c7d51 100644 --- a/lib/lokal_web/templates/user_reset_password/new.html.heex +++ b/lib/lokal_web/templates/user_reset_password/new.html.heex @@ -2,24 +2,25 @@

Forgot your password?

- - <%= form_for :user, Routes.user_reset_password_path(@conn, :create), - [class: "flex flex-col justify-center items-center space-y-4"], fn f -> %> - + <%= form_for :user, + Routes.user_reset_password_path(@conn, :create), + [class: "flex flex-col justify-center items-center space-y-4"], + fn f -> %>
- <%= label f, :email, class: "title text-lg text-primary-500" %> - <%= email_input f, :email, required: true, class: "input input-primary col-span-2" %> + <%= label(f, :email, class: "title text-lg text-primary-500") %> + <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
- - <%= submit "Send instructions to reset password", class: "btn btn-primary" %> - + <%= submit("Send instructions to reset password", class: "btn btn-primary") %>
- -
- <%= 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" %> -
- <% end %> - \ No newline at end of file +
+ <%= 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" + ) %> +
+ <% end %> + diff --git a/lib/lokal_web/templates/user_session/new.html.heex b/lib/lokal_web/templates/user_session/new.html.heex index 33b5ba0b..6edc948b 100644 --- a/lib/lokal_web/templates/user_session/new.html.heex +++ b/lib/lokal_web/templates/user_session/new.html.heex @@ -2,40 +2,40 @@

Log in

- - <%= form_for @conn, Routes.user_session_path(@conn, :create), [as: :user, - class: "flex flex-col justify-center items-center space-y-4"], fn f -> %> + <%= 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 %>
-

<%= @error_message %>

+

+ <%= @error_message %> +

<% end %> -
- <%= label f, :email, class: "title text-lg text-primary-500" %> - <%= email_input f, :email, required: true, class: "input input-primary col-span-2" %> + <%= label(f, :email, class: "title text-lg text-primary-500") %> + <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
-
- <%= label f, :password, class: "title text-lg text-primary-500" %> - <%= password_input f, :password, required: true, class: "input input-primary col-span-2" %> + <%= label(f, :password, class: "title text-lg text-primary-500") %> + <%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %>
-
- <%= label f, :remember_me, "Keep me logged in for 60 days", - class: "title text-lg text-primary-500" %> - <%= checkbox f, :remember_me, class: "checkbox" %> + <%= label(f, :remember_me, "Keep me logged in for 60 days", class: "title text-lg text-primary-500") %> + <%= checkbox(f, :remember_me, class: "checkbox") %>
- - <%= submit "Log in", class: "btn btn-primary" %> - + <%= submit("Log in", class: "btn btn-primary") %>
- -
- <%= 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" %> -
- <% end %> - \ No newline at end of file +
+ <%= 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" + ) %> +
+ <% end %> + diff --git a/lib/lokal_web/templates/user_settings/edit.html.heex b/lib/lokal_web/templates/user_settings/edit.html.heex index c01db3a9..6bd12cb6 100644 --- a/lib/lokal_web/templates/user_settings/edit.html.heex +++ b/lib/lokal_web/templates/user_settings/edit.html.heex @@ -2,84 +2,81 @@

Settings

-

Change email

- - <%= form_for @email_changeset, Routes.user_settings_path(@conn, :update), - [class: "flex flex-col justify-center items-center space-y-4"], fn f -> %> + <%= 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 %>

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

<% end %> - - <%= hidden_input f, :action, name: "action", value: "update_email" %> - + <%= hidden_input(f, :action, name: "action", value: "update_email") %>
- <%= label f, :email, class: "title text-lg text-primary-500" %> - <%= email_input f, :email, required: true, class: "input input-primary col-span-2" %> + <%= label(f, :email, class: "title text-lg text-primary-500") %> + <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
- <%= error_tag f, :email %> - + <%= error_tag(f, :email) %>
- <%= label f, :current_password, for: "current_password_for_email", class: "title text-lg text-primary-500" %> - <%= password_input f, :current_password, + <%= 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" %> + class: "input input-primary col-span-2" + ) %>
- <%= error_tag f, :current_password %> - - <%= submit "Change email", class: "btn btn-primary" %> + <%= error_tag(f, :current_password) %> + <%= submit("Change email", class: "btn btn-primary") %> <% end %> -

Change password

- - <%= form_for @password_changeset, Routes.user_settings_path(@conn, :update), - [class: "flex flex-col justify-center items-center space-y-4"], fn f -> %> + <%= 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 %>

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

<% end %> - - <%= hidden_input f, :action, name: "action", value: "update_password" %> - + <%= hidden_input(f, :action, name: "action", value: "update_password") %>
- <%= label f, :password, "New password", - class: "title text-lg text-primary-500" %> - <%= password_input f, :password, + <%= 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" %> + class: "input input-primary col-span-2" + ) %>
- <%= error_tag f, :password %> - + <%= error_tag(f, :password) %>
- <%= label f, :password_confirmation, "Confirm new password", - class: "title text-lg text-primary-500" %> - <%= password_input f, :password_confirmation, + <%= 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" %> + class: "input input-primary col-span-2" + ) %>
- <%= error_tag f, :password_confirmation %> - + <%= error_tag(f, :password_confirmation) %>
- <%= label f, :current_password, + <%= label(f, :current_password, for: "current_password_for_password", - class: "title text-lg text-primary-500" %> - <%= password_input f, :current_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" %> + class: "input input-primary col-span-2" + ) %>
- <%= error_tag f, :current_password %> - - <%= submit "Change password", class: "btn btn-primary" %> + <%= error_tag(f, :current_password) %> + <%= submit("Change password", class: "btn btn-primary") %> <% end %> - \ No newline at end of file +