frontender v.2
This commit is contained in:
parent
e61985d50e
commit
10b1f8c855
@ -17,6 +17,10 @@ body{
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.root_header{
|
||||
background-color: #297177;
|
||||
}
|
||||
|
||||
.login-a{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@ -46,6 +50,18 @@ body{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.reg_form{
|
||||
background-color: #297177;
|
||||
border-radius: 5px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 15px;
|
||||
height: max-content;
|
||||
width: 250px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.auth_form img{
|
||||
margin-top: 10px;
|
||||
margin-bottom: 20px;
|
||||
@ -72,7 +88,7 @@ body{
|
||||
border-radius: 5px;
|
||||
font-weight: bold;
|
||||
font-size: 18px;
|
||||
margin-top: 5px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.info_panel{
|
||||
@ -175,6 +191,12 @@ body{
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.register_screen{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
@media (min-width: 1250px) {
|
||||
.log_in_container{
|
||||
width: 50%;
|
||||
|
2
lib/derivantes/accounts/user.ex
Normal file → Executable file
2
lib/derivantes/accounts/user.ex
Normal file → Executable file
@ -51,7 +51,7 @@ defmodule Derivantes.Accounts.User do
|
||||
defp validate_email(changeset, opts) do
|
||||
changeset
|
||||
|> validate_required([:email])
|
||||
|> validate_format(:email, ~r/^[^\s]+@[^\s]+$/, message: "must have the @ sign and no spaces")
|
||||
|> validate_format(:email, ~r/^[^\s]+@[^\s]+$/, message: "Ingrese un email válido")
|
||||
|> validate_length(:email, max: 160)
|
||||
|> maybe_validate_unique_email(opts)
|
||||
end
|
||||
|
@ -409,7 +409,7 @@ defmodule DerivantesWeb.CoreComponents do
|
||||
|
||||
def error(assigns) do
|
||||
~H"""
|
||||
<p class="mt-3 flex gap-3 text-sm leading-6 text-rose-600 phx-no-feedback:hidden">
|
||||
<p class="mt-3 flex gap-3 text-sm leading-6 text-center text-white phx-no-feedback:hidden">
|
||||
<.icon name="hero-exclamation-circle-mini" class="mt-0.5 h-5 w-5 flex-none" />
|
||||
<%= render_slot(@inner_block) %>
|
||||
</p>
|
||||
|
4
lib/derivantes_web/components/layouts/root.html.heex
Normal file → Executable file
4
lib/derivantes_web/components/layouts/root.html.heex
Normal file → Executable file
@ -12,8 +12,8 @@
|
||||
</script>
|
||||
<script src="https://kit.fontawesome.com/8afa33c96d.js" crossorigin="anonymous"></script>
|
||||
</head>
|
||||
<body class="bg-white antialiased">
|
||||
<ul class="relative z-10 flex items-center gap-4 px-4 sm:px-6 lg:px-8 justify-end">
|
||||
<body class="gray antialiased">
|
||||
<ul class="relative z-10 flex items-center gap-4 px-4 sm:px-6 lg:px-8 justify-end root_header">
|
||||
<%= if @current_user do %>
|
||||
<li class="text-[0.8125rem] leading-6 text-zinc-900">
|
||||
<%= @current_user.email %>
|
||||
|
@ -18,7 +18,7 @@ defmodule DerivantesWeb.DerivantesLive do
|
||||
</div>
|
||||
<%= if length(@studies) > 0 do %>
|
||||
<div class="estudio_patientname">
|
||||
<h1>Bienvenido</h1>
|
||||
<h1>Bienvenido, <%= @current_user.email %> </h1>
|
||||
<p>Para ver un estudio haga click en el icono de Informe o de Imágenes.</p>
|
||||
</div>
|
||||
<div class="estudio_container">
|
||||
|
20
lib/derivantes_web/live/user_registration_live.ex
Normal file → Executable file
20
lib/derivantes_web/live/user_registration_live.ex
Normal file → Executable file
@ -6,15 +6,15 @@ defmodule DerivantesWeb.UserRegistrationLive do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<div class="mx-auto max-w-sm">
|
||||
<.header class="text-center">
|
||||
<div class="register_screen">
|
||||
<.header class="text-center mb-5">
|
||||
Registre su nueva cuenta
|
||||
<:subtitle>
|
||||
Ya tiene una cuenta?
|
||||
¿Ya tiene una cuenta?
|
||||
<.link navigate={~p"/derivantes/log_in"} class="font-semibold text-[#297177] hover:underline">
|
||||
Entre
|
||||
Ingrese
|
||||
</.link>
|
||||
a su cuenta ahora.
|
||||
ahora.
|
||||
</:subtitle>
|
||||
</.header>
|
||||
|
||||
@ -26,18 +26,18 @@ defmodule DerivantesWeb.UserRegistrationLive do
|
||||
phx-trigger-action={@trigger_submit}
|
||||
action={~p"/derivantes/log_in?_action=registered"}
|
||||
method="post"
|
||||
class="auth_form"
|
||||
class="reg_form"
|
||||
>
|
||||
<.error :if={@check_errors}>
|
||||
Hubo un error.
|
||||
</.error>
|
||||
<img src={~p"/images/sana_americano_logo.png"} alt="Sanatorio Americano Logo"/>
|
||||
<.input class="imput_text w-40" field={@form[:matricula]} type="text" label="Matrícula" required />
|
||||
<.input class="imput_text w-40" field={@form[:email]} type="email" label="Email" required />
|
||||
<.input class="imput_text w-40" field={@form[:password]} type="password" label="Contraseña" required />
|
||||
<.input class="imput_text w-40" field={@form[:matricula]} type="text" placeholder="Matrícula" required />
|
||||
<.input class="imput_text w-40" field={@form[:email]} type="email" placeholder="Email" required />
|
||||
<.input class="imput_text w-40" field={@form[:password]} type="password" placeholder="Contraseña" required />
|
||||
|
||||
<:actions>
|
||||
<.button phx-disable-with="Creating account..." class="submit_button">Create an account</.button>
|
||||
<.button phx-disable-with="Creando cuenta..." class="submit_button mt-2">Crear cuenta</.button>
|
||||
</:actions>
|
||||
</.simple_form>
|
||||
</div>
|
||||
|
0
priv/gettext/en/LC_MESSAGES/errors.po
Normal file → Executable file
0
priv/gettext/en/LC_MESSAGES/errors.po
Normal file → Executable file
0
priv/gettext/errors.pot
Normal file → Executable file
0
priv/gettext/errors.pot
Normal file → Executable file
0
test/derivantes/accounts_test.exs
Normal file → Executable file
0
test/derivantes/accounts_test.exs
Normal file → Executable file
2
test/derivantes_web/live/user_registration_live_test.exs
Normal file → Executable file
2
test/derivantes_web/live/user_registration_live_test.exs
Normal file → Executable file
@ -32,7 +32,7 @@ defmodule DerivantesWeb.UserRegistrationLiveTest do
|
||||
|
||||
assert result =~ "Register"
|
||||
assert result =~ "must have the @ sign and no spaces"
|
||||
assert result =~ "should be at least 12 character"
|
||||
assert result =~ "La contraseña debe tener por lo menos 12 caracteres"
|
||||
end
|
||||
end
|
||||
|
||||
|
0
test/derivantes_web/live/user_reset_password_live_test.exs
Normal file → Executable file
0
test/derivantes_web/live/user_reset_password_live_test.exs
Normal file → Executable file
Loading…
x
Reference in New Issue
Block a user