-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
255 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ | |
display: none; | ||
position: relative; | ||
overflow: auto; | ||
|
||
} | ||
|
||
.dropdown:hover .dropdown-options { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
.nav-menu { | ||
@apply flex flex-col items-center justify-between w-full; | ||
|
||
height: 26.875rem; | ||
|
||
.nav-item { | ||
@apply text-black-60 flex items-center justify-center; | ||
} | ||
} | ||
|
||
.item-secao { | ||
@apply justify-between items-center; | ||
@apply w-full border-black-10 bg-white-100; | ||
|
||
display: flex; | ||
flex-wrap: wrap; | ||
align-content: flex-start; | ||
} | ||
|
||
.item-fieldset { | ||
width: 17.25rem; | ||
height: 5.25rem; | ||
} |
61 changes: 61 additions & 0 deletions
61
lib/pescarte_web/live/pesquisa/cadastro_pesquisador_live.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
defmodule PlataformaDigital.Pesquisa.CadastroPesquisadorLive do | ||
use PescarteWeb, :auth_live_view | ||
|
||
@impl true | ||
def mount(_params, _session, socket) do | ||
# cadastro_params = %{"form" => form, "field_names" => field_names} | ||
|
||
{:ok, | ||
socket | ||
|> assign(:form_title, "Cadastrar Novo Pesquisador") | ||
|> assign(:form, to_form(%{}, as: :user)) | ||
# |> assign(:form_dados, get_dados_cadastro) | ||
|> assign(:field_names, get_cadastro_field_names(:cadastro))} | ||
end | ||
|
||
# para criar um user no login: | ||
# def create(conn, %{"user" => user_params}) do | ||
# %{"cpf" => cpf, "password" => password} = user_params | ||
|
||
# case UsuarioHandler.fetch_usuario_by_cpf_and_password(cpf, password) do | ||
# {:error, :not_found} -> render(conn, :show, error_message: @err_msg) | ||
# {:ok, user} -> Authentication.log_in_user(conn, user, user_params) | ||
# end | ||
# end | ||
|
||
# @impl true | ||
# def handle_params(params, _uri, socket) do | ||
# {:noreply, apply_action(socket, socket.assigns.live_action, params)} | ||
# end | ||
|
||
# defp apply_action(socket, :new, _params) do | ||
# socket | ||
# |> assign(:title, "Novo Pesquisador") | ||
# |> assign(:cadastro, %Pesquisador{}) | ||
# end | ||
|
||
defp get_cadastro_field_names(:cadastro) do | ||
[ | ||
{"Dados Pessoais", :dados}, | ||
{"Endereço", :endereco}, | ||
{"Vínculo Institucional", :vinculo}, | ||
{"Orientador", :orientador} | ||
] | ||
|
||
# %{dados: dados, endereco: endereco, vinculo: vinculo} | ||
end | ||
|
||
# defp get_dados_cadastro do | ||
# [ | ||
# {"primeiro_nome", :primeiro_nome}, | ||
# {"sobrenome", :sobrenome}, | ||
# {"data_nascimento", :data_nascimento} | ||
# ] | ||
# end | ||
|
||
# @impl true trecho para entender..... | ||
# {:ok, assign(socket, note_text: "", draft_notes: [], published_notes: [], error: "")} | ||
# def handle_event("create_pesquisador", %{"note_text" => note_text}, socket) do | ||
# {:noreply, assign(socket, draft_notes: [note_text | socket.assigns.draft_notes])} | ||
# end | ||
end |
130 changes: 130 additions & 0 deletions
130
lib/pescarte_web/live/pesquisa/cadastro_pesquisador_live.html.heex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
<div class="report-wrapper"> | ||
<.text size="h1" color="text-blue-100"><%= @form_title %></.text> | ||
<.simple_form for={@form} action={~p"/app/pesquisa/cadastro"} class="report-wrapper"> | ||
<.text size="h3" color="text-blue-100"><%= @field_names[:dados] %></.text> | ||
|
||
<.text size="h3" color="text-blue-100">Dados Pessoais</.text> | ||
<div class="nav-item"> | ||
<fieldset class="login-fieldset"> | ||
<.text_input field={@form[:primeiro_nome]} value="" type="text" label="Nome" required /> | ||
</fieldset> | ||
<fieldset class="login-fieldset"> | ||
<.text_input field={@form[:sobrenome]} value="" type="text" label="SobreNome" required /> | ||
</fieldset> | ||
<fieldset class="login-fieldset"> | ||
<.text_input | ||
field={@form[:data_nascimento]} | ||
value="" | ||
type="date" | ||
label="Data de Nascimento" | ||
required | ||
/> | ||
</fieldset> | ||
</div> | ||
|
||
<div class="nav-item"> | ||
<fieldset class="login-fieldset"> | ||
<.text_input | ||
field={@form[:cpf]} | ||
value="" | ||
type="text" | ||
label="CPF" | ||
required | ||
phx-hook="CpfNumberMask" | ||
/> | ||
</fieldset> | ||
<fieldset class="login-fieldset"> | ||
<.text_input field={@form[:telefone]} value="" type="text" label="Telefone" required /> | ||
</fieldset> | ||
<fieldset class="login-fieldset"> | ||
<.text_input | ||
field={@form[:contato_email]} | ||
value="" | ||
type="email" | ||
placeholder="[email protected]" | ||
label="Email" | ||
required | ||
/> | ||
</fieldset> | ||
</div> | ||
<div class="item-secao flex-cols"> | ||
<div class="form-group"> | ||
<label for="exampleSelect">Tipo de Usuário</label> | ||
<select id="exampleSelect" class="form-control"> | ||
<option name="tipo" value="">Administrador</option> | ||
<option name="tipo" value="">Pesquisador</option> | ||
<option name="tipo" value="">Pescador</option> | ||
</select> | ||
</div> | ||
</div> | ||
|
||
<.text size="h3" color="text-blue-100">Endereço</.text> | ||
<div class="nav-item"> | ||
<fieldset class="login-fieldset"> | ||
<.text_input field={@form[:rua]} value="" type="text" label="Endereço" required /> | ||
</fieldset> | ||
<fieldset class="login-fieldset"> | ||
<.text_input field={@form[:numero]} value="" type="text" label="Número" required /> | ||
</fieldset> | ||
<fieldset class="login-fieldset"> | ||
<.text_input field={@form[:cidade]} value="" type="text" label="Cidade" required /> | ||
</fieldset> | ||
<fieldset class="login-fieldset"> | ||
<.text_input | ||
field={@form[:cep]} | ||
value="" | ||
type="text" | ||
placeholder="00000-00" | ||
label="CEP" | ||
required | ||
/> | ||
</fieldset> | ||
</div> | ||
|
||
<div class="form-group flex-cols"> | ||
<label for="exampleSelect">UF</label> | ||
<select id="exampleSelect" class="form-control"> | ||
<option name="estado" value="">RJ</option> | ||
<option name="estado" value="">ES</option> | ||
<option name="estado" value="">SP</option> | ||
</select> | ||
</div> | ||
|
||
<.text size="h3" color="text-blue-100">Vínculo Institucional</.text> | ||
<div class="nav-item"> | ||
<fieldset class="login-fieldset"> | ||
<.text_input field={@form[:bolsa]} value="" type="checkbox" label="Pesquisador" required /> | ||
</fieldset> | ||
<fieldset class="login-fieldset"> | ||
<.text_input field={@form[:bolsa]} value="" type="checkbox" label="Professor" required /> | ||
</fieldset> | ||
<fieldset class="login-fieldset"> | ||
<.text_input field={@form[:bolsa]} value="" type="checkbox" label="Técnico" required /> | ||
</fieldset> | ||
<fieldset class="login-fieldset"> | ||
<.text_input field={@form[:bolsa]} value="" type="checkbox" label="Aluno" required /> | ||
</fieldset> | ||
</div> | ||
</.simple_form> | ||
<div class="buttons-wrapper flex-center"> | ||
<.button | ||
name="save" | ||
value="save-cadastro" | ||
style="primary" | ||
phx-disable-with="Salvando….." | ||
submit | ||
> | ||
<Lucideicons.save /> Salvar respostas | ||
</.button> | ||
|
||
<.button | ||
name="save" | ||
value="send-cadastro" | ||
style="primary" | ||
phx-disable-with="Enviando..." | ||
submit | ||
> | ||
<Lucideicons.send /> Enviar cadastro | ||
</.button> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters