make app responsive

This commit is contained in:
2022-02-15 23:52:44 -05:00
parent 669afd5dcb
commit d6e4090650
35 changed files with 470 additions and 422 deletions

View File

@ -16,5 +16,7 @@
</div>
</header>
<%= @inner_content %>
<div class="mx-4 sm:mx-8 md:mx-16">
<%= @inner_content %>
</div>
</main>

View File

@ -17,5 +17,7 @@
</div>
</header>
<%= @inner_content %>
<div class="mx-4 sm:mx-8 md:mx-16">
<%= @inner_content %>
</div>
</main>

View File

@ -1,32 +1,33 @@
<div class="flex flex-col justify-center items-center space-y-4">
<div class="mb-8 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"],
[class: "flex flex-col sm:grid sm:grid-cols-3
justify-center items-center text-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>
<%= label(f, :email, class: "title text-lg text-primary-500") %>
<%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
<%= submit(dgettext("actions", "Resend confirmation instructions"), class: "btn btn-primary") %>
<%= submit(dgettext("actions", "Resend confirmation instructions"),
class: "mx-auto my-4 btn btn-primary col-span-3"
) %>
<% end %>
<hr class="hr">
<hr class="hr">
<div class="flex flex-row justify-center items-center space-x-4">
<%= if Accounts.allow_registration?() do %>
<%= link(dgettext("actions", "Register"),
to: Routes.user_registration_path(@conn, :new),
class: "btn btn-primary"
) %>
<% end %>
<%= link(dgettext("actions", "Log in"),
to: Routes.user_session_path(@conn, :new),
<div class="flex flex-row justify-center items-center space-x-4">
<%= if Accounts.allow_registration?() do %>
<%= link(dgettext("actions", "Register"),
to: Routes.user_registration_path(@conn, :new),
class: "btn btn-primary"
) %>
</div>
<% end %>
<% end %>
<%= link(dgettext("actions", "Log in"),
to: Routes.user_session_path(@conn, :new),
class: "btn btn-primary"
) %>
</div>
</div>

View File

@ -1,14 +1,15 @@
<div class="flex flex-col justify-center items-center space-y-4">
<div class="mb-8 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"],
[class: "flex flex-col sm:grid sm:grid-cols-3
justify-center items-center text-center space-y-4"],
fn f -> %>
<%= if @changeset.action && not @changeset.valid? do %>
<div class="alert alert-danger">
<div class="alert alert-danger col-span-3">
<p>
<%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
</p>
@ -19,31 +20,27 @@
<%= 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) %>
<%= 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, "col-span-3") %>
<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) %>
<%= 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, "col-span-3") %>
<%= 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>
<%= submit(dgettext("actions", "Register"), class: "mx-auto my-4 btn btn-primary col-span-3") %>
<% end %>
<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>
</div>

View File

@ -1,47 +1,44 @@
<div class="flex flex-col justify-center items-center space-y-4">
<div class="mb-8 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"],
[class: "flex flex-col sm:grid sm:grid-cols-3
justify-center items-center text-center space-y-4"],
fn f -> %>
<%= if @changeset.action && not @changeset.valid? do %>
<div class="alert alert-danger">
<div class="alert alert-danger col-span-3">
<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) %>
<%= 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, "col-span-3") %>
<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) %>
<%= 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, "col-span-3") %>
<%= submit(dgettext("actions", "Reset password"), class: "btn btn-primary") %>
<%= submit(dgettext("actions", "Reset password"), class: "mx-auto my-4 btn btn-primary col-span-3") %>
<% end %>
<hr class="hr">
<hr class="hr">
<div class="flex flex-row justify-center items-center space-x-4">
<%= if Accounts.allow_registration?() do %>
<%= link(dgettext("actions", "Register"),
to: Routes.user_registration_path(@conn, :new),
class: "btn btn-primary"
) %>
<% end %>
<%= link(dgettext("actions", "Log in"),
to: Routes.user_session_path(@conn, :new),
<div class="flex flex-row justify-center items-center space-x-4">
<%= if Accounts.allow_registration?() do %>
<%= link(dgettext("actions", "Register"),
to: Routes.user_registration_path(@conn, :new),
class: "btn btn-primary"
) %>
</div>
<% end %>
<% end %>
<%= link(dgettext("actions", "Log in"),
to: Routes.user_session_path(@conn, :new),
class: "btn btn-primary"
) %>
</div>
</div>

View File

@ -1,33 +1,34 @@
<div class="flex flex-col justify-center items-center space-y-4">
<div class="mb-8 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"],
[class: "flex flex-col sm:grid sm:grid-cols-3
justify-center items-center text-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>
<%= label(f, :email, class: "title text-lg text-primary-500") %>
<%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
<%= submit(dgettext("actions", "Send instructions to reset password"), class: "btn btn-primary") %>
<%= submit(dgettext("actions", "Send instructions to reset password"),
class: "mx-auto my-4 btn btn-primary col-span-3"
) %>
<% end %>
<hr class="hr">
<hr class="hr">
<div class="flex flex-row justify-center items-center space-x-4">
<%= if Accounts.allow_registration?() do %>
<%= link(dgettext("actions", "Register"),
to: Routes.user_registration_path(@conn, :new),
class: "btn btn-primary"
) %>
<% end %>
<%= link(dgettext("actions", "Log in"),
to: Routes.user_session_path(@conn, :new),
<div class="flex flex-row justify-center items-center space-x-4">
<%= if Accounts.allow_registration?() do %>
<%= link(dgettext("actions", "Register"),
to: Routes.user_registration_path(@conn, :new),
class: "btn btn-primary"
) %>
</div>
<% end %>
<% end %>
<%= link(dgettext("actions", "Log in"),
to: Routes.user_session_path(@conn, :new),
class: "btn btn-primary"
) %>
</div>
</div>

View File

@ -1,52 +1,47 @@
<div class="flex flex-col justify-center items-center space-y-4">
<div class="mb-8 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"],
[as: :user, class: "flex flex-col sm:grid sm:grid-cols-3
justify-center items-center text-center space-y-4"],
fn f -> %>
<%= if @error_message do %>
<div class="alert alert-danger">
<div class="alert alert-danger col-span-3">
<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>
<%= label(f, :email, class: "title text-lg text-primary-500") %>
<%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
<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>
<%= label(f, :password, class: "title text-lg text-primary-500") %>
<%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %>
<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>
<%= 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 col-span-2") %>
<%= submit(dgettext("actions", "Log in"), class: "btn btn-primary") %>
<%= submit(dgettext("actions", "Log in"), class: "mx-auto my-4 btn btn-primary col-span-3") %>
<% end %>
<hr class="hr">
<hr class="hr">
<div class="flex flex-row justify-center items-center space-x-4">
<%= if Accounts.allow_registration?() do %>
<%= link(dgettext("actions", "Register"),
to: Routes.user_registration_path(@conn, :new),
class: "btn btn-primary"
) %>
<% end %>
<%= link(dgettext("actions", "Forgot your password?"),
to: Routes.user_reset_password_path(@conn, :new),
<div class="flex flex-row justify-center items-center space-x-4">
<%= if Accounts.allow_registration?() do %>
<%= link(dgettext("actions", "Register"),
to: Routes.user_registration_path(@conn, :new),
class: "btn btn-primary"
) %>
</div>
<% end %>
<% end %>
<%= link(dgettext("actions", "Forgot your password?"),
to: Routes.user_reset_password_path(@conn, :new),
class: "btn btn-primary"
) %>
</div>
</div>

View File

@ -1,18 +1,21 @@
<div class="mb-8 flex flex-col justify-center items-center space-y-8">
<h1 class="title text-primary-500 text-xl">
<div class="mb-8 flex flex-col justify-center items-center space-y-4">
<h1 class="pb-4 title text-primary-500 text-xl">
<%= gettext("Settings") %>
</h1>
<h3 class="title text-primary-500 text-lg">
<%= dgettext("actions", "Change email") %>
</h3>
<hr class="hr">
<%= form_for @email_changeset,
Routes.user_settings_path(@conn, :update),
[class: "flex flex-col justify-center items-center space-y-4"],
[class: "pb-4 flex flex-col sm:grid sm:grid-cols-3
justify-center items-center text-center space-y-4"],
fn f -> %>
<%= if @email_changeset.action do %>
<div class="alert alert-danger">
<h3 class="title text-primary-500 text-lg col-span-3">
<%= dgettext("actions", "Change email") %>
</h3>
<%= if @email_changeset.action && not @email_changeset.valid? do %>
<div class="alert alert-danger col-span-3">
<p>
<%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
</p>
@ -21,39 +24,40 @@
<%= 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) %>
<%= label(f, :email, class: "title text-lg text-primary-500") %>
<%= email_input(f, :email, required: true, class: "mx-2 my-1 input input-primary col-span-2") %>
<%= error_tag(f, :email, "col-span-3") %>
<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) %>
<%= label(f, :current_password, gettext("Current password"),
for: "current_password_for_email",
class: "mx-2 my-1 title text-lg text-primary-500"
) %>
<%= password_input(f, :current_password,
required: true,
name: "current_password",
id: "current_password_for_email",
class: "mx-2 my-1 input input-primary col-span-2"
) %>
<%= error_tag(f, :current_password, "col-span-3") %>
<%= submit(dgettext("actions", "Change email"), class: "btn btn-primary") %>
<%= submit(dgettext("actions", "Change email"), class: "mx-auto my-4 btn btn-primary col-span-3") %>
<% end %>
<h3 class="title text-primary-500 text-lg">
<%= dgettext("actions", "Change password") %>
</h3>
<hr class="hr">
<%= form_for @password_changeset,
Routes.user_settings_path(@conn, :update),
[class: "flex flex-col justify-center items-center space-y-4"],
[
class:
"pb-4 flex flex-col sm:grid sm:grid-cols-3 justify-center items-center text-center space-y-4"
],
fn f -> %>
<%= if @password_changeset.action do %>
<div class="alert alert-danger">
<h3 class="title text-primary-500 text-lg col-span-3">
<%= dgettext("actions", "Change password") %>
</h3>
<%= if @password_changeset.action && not @password_changeset.valid? do %>
<div class="alert alert-danger col-span-3">
<p>
<%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
</p>
@ -62,41 +66,39 @@
<%= 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) %>
<%= label(f, :password, gettext("New password"), class: "title text-lg text-primary-500") %>
<%= password_input(f, :password,
required: true,
class: "mx-2 my-1 input input-primary col-span-2"
) %>
<%= error_tag(f, :password, "col-span-3") %>
<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) %>
<%= label(f, :password_confirmation, gettext("Confirm new password"),
class: "title text-lg text-primary-500"
) %>
<%= password_input(f, :password_confirmation,
required: true,
class: "mx-2 my-1 input input-primary col-span-2"
) %>
<%= error_tag(f, :password_confirmation, "col-span-3") %>
<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) %>
<%= label(f, :current_password, gettext("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: "mx-2 my-1 input input-primary col-span-2"
) %>
<%= error_tag(f, :current_password, "col-span-3") %>
<%= submit(dgettext("actions", "Change password"), class: "btn btn-primary") %>
<%= submit(dgettext("actions", "Change password"), class: "mx-auto my-4 btn btn-primary col-span-3") %>
<% end %>
<hr class="hr">
<%= link(dgettext("actions", "Delete User"),
to: Routes.user_settings_path(@conn, :delete, @current_user),
method: :delete,