Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
th-app-java
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Amparo Oliver
th-app-java
Commits
364b178e
Commit
364b178e
authored
Nov 02, 2021
by
Joel Florentin
Browse files
Options
Browse Files
Download
Plain Diff
merge con validacion front
parents
eb16b56a
109c920d
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
118 additions
and
39 deletions
+118
-39
curriculumsearch/src/main/java/com/roshka/modelo/Experiencia.java
+2
-2
curriculumsearch/src/main/java/com/roshka/modelo/Postulante.java
+1
-1
curriculumsearch/src/main/java/com/roshka/modelo/PostulanteTecnologia.java
+16
-16
curriculumsearch/src/main/resources/static/main.js
+45
-4
curriculumsearch/src/main/webapp/jsp/postulante-form.jsp
+54
-16
No files found.
curriculumsearch/src/main/java/com/roshka/modelo/Experiencia.java
View file @
364b178e
...
@@ -78,7 +78,7 @@ public class Experiencia {
...
@@ -78,7 +78,7 @@ public class Experiencia {
if
(
fechaDesde
==
null
||
fechaDesde
.
isEmpty
())
return
;
if
(
fechaDesde
==
null
||
fechaDesde
.
isEmpty
())
return
;
try
{
try
{
this
.
fechaDesde
=
new
SimpleDateFormat
(
"yyyy-
mm
-dd"
).
parse
(
fechaDesde
);
this
.
fechaDesde
=
new
SimpleDateFormat
(
"yyyy-
MM
-dd"
).
parse
(
fechaDesde
);
}
catch
(
ParseException
e
)
{
}
catch
(
ParseException
e
)
{
// TODO Auto-generated catch block
// TODO Auto-generated catch block
e
.
printStackTrace
();
e
.
printStackTrace
();
...
@@ -94,7 +94,7 @@ public class Experiencia {
...
@@ -94,7 +94,7 @@ public class Experiencia {
if
(
fechaHasta
==
null
||
fechaHasta
.
isEmpty
())
return
;
if
(
fechaHasta
==
null
||
fechaHasta
.
isEmpty
())
return
;
try
{
try
{
this
.
fechaHasta
=
new
SimpleDateFormat
(
"yyyy-
mm
-dd"
).
parse
(
fechaHasta
);
this
.
fechaHasta
=
new
SimpleDateFormat
(
"yyyy-
MM
-dd"
).
parse
(
fechaHasta
);
}
catch
(
ParseException
e
)
{
}
catch
(
ParseException
e
)
{
// TODO Auto-generated catch block
// TODO Auto-generated catch block
e
.
printStackTrace
();
e
.
printStackTrace
();
...
...
curriculumsearch/src/main/java/com/roshka/modelo/Postulante.java
View file @
364b178e
...
@@ -153,7 +153,7 @@ public class Postulante {
...
@@ -153,7 +153,7 @@ public class Postulante {
if
(
fechaNacimiento
==
null
||
fechaNacimiento
.
isEmpty
())
return
;
if
(
fechaNacimiento
==
null
||
fechaNacimiento
.
isEmpty
())
return
;
try
{
try
{
this
.
fechaNacimiento
=
new
SimpleDateFormat
(
"yyyy-mm
-dd"
).
parse
(
fechaNacimiento
);
this
.
fechaNacimiento
=
new
SimpleDateFormat
(
"yyyy-MM
-dd"
).
parse
(
fechaNacimiento
);
}
catch
(
ParseException
e
)
{
}
catch
(
ParseException
e
)
{
// TODO Auto-generated catch block
// TODO Auto-generated catch block
System
.
err
.
println
(
"Error al parsear"
);
System
.
err
.
println
(
"Error al parsear"
);
...
...
curriculumsearch/src/main/java/com/roshka/modelo/PostulanteTecnologia.java
View file @
364b178e
...
@@ -37,30 +37,30 @@ public class PostulanteTecnologia {
...
@@ -37,30 +37,30 @@ public class PostulanteTecnologia {
@JoinColumn
@JoinColumn
@JsonBackReference
@JsonBackReference
private
Postulante
postulante
;
private
Postulante
postulante
;
public
long
getId
()
{
public
long
getId
()
{
return
id
;
return
id
;
}
}
public
void
setId
(
long
id
)
{
public
void
setId
(
long
id
)
{
this
.
id
=
id
;
this
.
id
=
id
;
}
}
public
Long
getNivel
()
{
public
Long
getNivel
()
{
return
nivel
;
return
nivel
;
}
}
public
void
setNivel
(
Long
nivel
)
{
public
void
setNivel
(
Long
nivel
)
{
this
.
nivel
=
nivel
;
this
.
nivel
=
nivel
;
}
}
public
Tecnologia
getTecnologia
()
{
public
Tecnologia
getTecnologia
()
{
return
tecnologia
;
return
tecnologia
;
}
}
public
void
setTecnologia
(
Tecnologia
tecnologia
)
{
public
void
setTecnologia
(
Tecnologia
tecnologia
)
{
this
.
tecnologia
=
tecnologia
;
this
.
tecnologia
=
tecnologia
;
}
}
public
Postulante
getPostulante
()
{
public
Postulante
getPostulante
()
{
return
postulante
;
return
postulante
;
}
}
public
void
setPostulante
(
Postulante
postulante
)
{
public
void
setPostulante
(
Postulante
postulante
)
{
this
.
postulante
=
postulante
;
this
.
postulante
=
postulante
;
}
}
...
...
curriculumsearch/src/main/resources/static/main.js
View file @
364b178e
...
@@ -4,13 +4,51 @@ let cont_tecnologia = 0;
...
@@ -4,13 +4,51 @@ let cont_tecnologia = 0;
const
experiencias
=
[];
const
experiencias
=
[];
const
estudios
=
[];
const
estudios
=
[];
const
tecnologias
=
[];
const
tecnologias
=
[];
function
agregarFieldExpierncia
(){
const
formValidator
=
function
()
{
'use strict'
// Fetch all the forms we want to apply custom Bootstrap validation styles to
var
forms
=
document
.
querySelectorAll
(
'.needs-validation'
)
var
expForm
=
document
.
querySelector
(
'#agregar-exp'
)
// Loop over them and prevent submission
Array
.
prototype
.
slice
.
call
(
forms
)
.
forEach
(
function
(
form
)
{
form
.
addEventListener
(
'submit'
,
function
(
event
)
{
if
(
!
form
.
checkValidity
())
{
event
.
preventDefault
()
event
.
stopPropagation
()
}
form
.
classList
.
add
(
'was-validated'
)
},
false
)
})
}
function
agregarFieldExpierncia
(
event
){
//recoger del form
//recoger del form
const
pairs
=
{};
const
pairs
=
{};
const
formexp
=
document
.
querySelector
(
"[name=experiencia-form]"
);
const
formexp
=
document
.
querySelector
(
"[name=experiencia-form]"
);
const
formData
=
new
FormData
(
formexp
);
const
formData
=
new
FormData
(
formexp
);
const
reconocimientos
=
[{},{},{}];
const
reconocimientos
=
[{},{},{}];
let
pos_rec
;
let
pos_rec
;
let
returnFlag
=
false
;
formData
.
forEach
((
value
,
key
)
=>
{
if
((
key
===
"institucion"
||
key
===
"cargo"
||
key
===
"fechaDesde"
)
&&
value
===
""
&&
returnFlag
==
false
){
console
.
log
(
key
,
value
)
returnFlag
=
true
;
}
});
if
(
returnFlag
===
true
){
alert
(
"Rellene Institucion, Fechas y Cargo como minimo"
);
return
;
}
for
(
const
[
name
,
value
]
of
formData
){
for
(
const
[
name
,
value
]
of
formData
){
pos_rec
=
name
.
split
(
"-"
);
//rec-nombre-index
pos_rec
=
name
.
split
(
"-"
);
//rec-nombre-index
if
(
pos_rec
.
length
>
1
)
{
if
(
pos_rec
.
length
>
1
)
{
...
@@ -44,7 +82,6 @@ function agregarFieldExpierncia(){
...
@@ -44,7 +82,6 @@ function agregarFieldExpierncia(){
div
.
innerHTML
=
''
;
div
.
innerHTML
=
''
;
div
.
appendChild
(
div1
);
div
.
appendChild
(
div1
);
cont_experiencia
++
;
cont_experiencia
++
;
}
}
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
function
agregarFieldTecnologia
(){
function
agregarFieldTecnologia
(){
...
@@ -137,10 +174,14 @@ async function postData(url = '', data = {}) {
...
@@ -137,10 +174,14 @@ async function postData(url = '', data = {}) {
});
});
return
response
;
// parses JSON response into native JavaScript objects
return
response
;
// parses JSON response into native JavaScript objects
}
}
formValidator
()
form
=
document
.
querySelector
(
"form"
);
form
=
document
.
querySelector
(
"form"
);
form
.
addEventListener
(
"submit"
,(
evt
)
=>
{
form
.
addEventListener
(
"submit"
,(
evt
)
=>
{
// if (!form.checkValidity()) {
// evt.preventDefault()
// evt.stopPropagation()
// }
// form.classList.add('was-validated')
postData
(
'postulante'
,
serializeJSON
(
form
))
postData
(
'postulante'
,
serializeJSON
(
form
))
.
then
(
response
=>
{
.
then
(
response
=>
{
if
(
response
.
status
==
200
||
response
.
status
==
302
){
if
(
response
.
status
==
200
||
response
.
status
==
302
){
...
...
curriculumsearch/src/main/webapp/jsp/postulante-form.jsp
View file @
364b178e
...
@@ -16,47 +16,74 @@
...
@@ -16,47 +16,74 @@
<body
class=
"container"
>
<body
class=
"container"
>
<h1>
Curriculum
</h1>
<h1>
Curriculum
</h1>
<form
name=
"postulante"
method=
"post"
>
<form
name=
"postulante"
method=
"post"
class=
"row g-3 needs-validation"
novalidate
>
<div
class=
"mb-3 col-5"
>
<div
class=
"mb-3 col-5"
>
<label
for=
"correo"
class=
"form-label"
>
Email address
</label>
<label
for=
"correo"
class=
"form-label"
>
Email address
</label>
<input
type=
"email"
name=
"correo"
class=
"form-control "
id=
"correo"
>
<input
type=
"email"
name=
"correo"
class=
"form-control "
id=
"correo"
required
>
<div
id=
"emailHelp"
class=
"form-text"
>
We'll never share your email with anyone else.
</div>
<div
id=
"emailHelp"
class=
"form-text"
>
We'll never share your email with anyone else.
</div>
<div
class=
"valid-feedback"
>
Luce Bien!
</div>
</div>
</div>
<div
class=
"mb-3 col-5"
>
<div
class=
"mb-3 col-5"
>
<label
for=
"nombre"
class=
"form-label"
>
Nombre
</label>
<label
for=
"nombre"
class=
"form-label"
>
Nombre
</label>
<input
type=
"text"
name=
"nombre"
class=
"form-control "
id=
"nombre"
>
<input
type=
"text"
name=
"nombre"
class=
"form-control"
id=
"nombre"
required
>
<div
class=
"valid-feedback"
>
Luce Bien!
</div>
</div>
</div>
<div
class=
"mb-3 col-5"
>
<div
class=
"mb-3 col-5"
>
<label
for=
"apellido"
class=
"form-label"
>
Apellido
</label>
<label
for=
"apellido"
class=
"form-label"
>
Apellido
</label>
<input
type=
"text"
name=
"apellido"
class=
"form-control "
id=
"apellido"
>
<input
type=
"text"
name=
"apellido"
class=
"form-control "
id=
"apellido"
required
>
<div
class=
"valid-feedback"
>
Luce Bien!
</div>
</div>
</div>
<div
class=
"mb-3 col-3"
>
<div
class=
"mb-3 col-3"
>
<label
for=
"ci"
class=
"form-label"
>
Cedula de identidad
</label>
<label
for=
"ci"
class=
"form-label"
>
Cedula de identidad
</label>
<input
type=
"number"
name=
"ci"
class=
"form-control "
id=
"ci"
>
<input
type=
"number"
name=
"ci"
class=
"form-control "
id=
"ci"
required
>
<div
class=
"valid-feedback"
>
Luce Bien!
</div>
</div>
</div>
<div
class=
"mb-3 col-5"
>
<div
class=
"mb-3 col-5"
>
<label
for=
"ciudad"
class=
"form-label"
>
Ciudad
</label>
<label
for=
"ciudad"
class=
"form-label"
>
Ciudad
</label>
<input
type=
"text"
name=
"ciudad"
class=
"form-control "
id=
"ciudad"
>
<input
type=
"text"
name=
"ciudad"
class=
"form-control "
id=
"ciudad"
required
>
<div
class=
"valid-feedback"
>
Luce Bien!
</div>
</div>
</div>
<div
class=
"mb-3 col-5"
>
<div
class=
"mb-3 col-5"
>
<label
for=
"telefono"
class=
"form-label"
>
Telefono
</label>
<label
for=
"telefono"
class=
"form-label"
>
Telefono
</label>
<input
type=
"number"
name=
"telefono"
class=
"form-control "
id=
"telefono"
>
<input
type=
"number"
name=
"telefono"
class=
"form-control "
id=
"telefono"
required
>
<div
class=
"valid-feedback"
>
Luce Bien!
</div>
</div>
</div>
<div
class=
"mb-3 col-5"
>
<div
class=
"mb-3 col-5"
>
<label
for=
"fechaNacimiento"
class=
"form-label"
>
Fecha de nacimiento
</label>
<label
for=
"fechaNacimiento"
class=
"form-label"
>
Fecha de nacimiento
</label>
<input
type=
"date"
name=
"fechaNacimiento"
class=
"form-control "
id=
"fechaNacimiento"
>
<input
type=
"date"
min=
"1910-01-01"
name=
"fechaNacimiento"
class=
"form-control "
id=
"fechaNacimiento"
required
>
<div
class=
"valid-feedback"
>
Luce Bien!
</div>
</div>
</div>
<div
class=
"mb-3 col-5"
>
<div
class=
"mb-3 col-5"
>
<label
for=
"resumen"
class=
"form-label"
>
Resumen
</label>
<label
for=
"resumen"
class=
"form-label"
>
Resumen
</label>
<textarea
class=
"form-control "
name=
"resumen"
id=
"resumen"
>
</textarea>
<textarea
class=
"form-control "
name=
"resumen"
id=
"resumen"
required
>
</textarea>
<div
class=
"valid-feedback"
>
Luce Bien!
</div>
</div>
</div>
<div
class=
"mb-3 col-5"
>
<div
class=
"mb-3 col-5"
>
<label
for=
"nivelIngles"
class=
"form-label"
>
Nivel de ingles
</label>
<label
for=
"nivelIngles"
class=
"form-label"
>
Nivel de ingles
</label>
<input
type=
"number"
class=
"form-control"
name=
"nivelIngles"
id=
"nivelIngles"
>
<input
type=
"number"
class=
"form-control"
name=
"nivelIngles"
id=
"nivelIngles"
required
>
<div
class=
"valid-feedback"
>
Luce Bien!
</div>
</div>
</div>
<div
class=
"mb-3 col-5"
>
<div
class=
"mb-3 col-5"
>
<label
for=
"curriculum"
class=
"form-label"
>
Curriculum
</label>
<label
for=
"curriculum"
class=
"form-label"
>
Curriculum
</label>
...
@@ -64,13 +91,21 @@
...
@@ -64,13 +91,21 @@
</div>
</div>
<div
class=
"mb-3 col-5"
>
<div
class=
"mb-3 col-5"
>
<label
for=
"disponibilidad"
class=
"form-label"
>
Disponibilidad
</label>
<label
for=
"disponibilidad"
class=
"form-label"
>
Disponibilidad
</label>
<input
type=
"text"
class=
"form-control "
name=
"disponibilidad"
id=
"disponibilidad"
>
<input
type=
"text"
class=
"form-control "
name=
"disponibilidad"
id=
"disponibilidad"
required
>
<div
class=
"valid-feedback"
>
Luce Bien!
</div>
</div>
</div>
<div
class=
"mb-3 col-5"
>
<div
class=
"mb-3 col-5"
>
<label
for=
"modalidad"
class=
"form-label"
>
Modalidad
</label>
<label
for=
"modalidad"
class=
"form-label"
>
Modalidad
</label>
<input
type=
"text"
class=
"form-control "
name=
"modalidad"
id=
"modalidad"
>
<input
type=
"text"
class=
"form-control "
name=
"modalidad"
id=
"modalidad"
required
>
<div
class=
"valid-feedback"
>
Luce Bien!
</div>
</div>
</div>
<br>
<br>
<button
type=
"button"
class=
"btn btn-primary"
data-toggle=
"modal"
data-target=
"#experienciaForm"
>
<button
type=
"button"
class=
"btn btn-primary"
data-toggle=
"modal"
data-target=
"#experienciaForm"
>
Agregar Experiencia
Agregar Experiencia
</button>
</button>
...
@@ -105,13 +140,16 @@
...
@@ -105,13 +140,16 @@
<div
class=
"modal-body"
>
<div
class=
"modal-body"
>
<form
name=
"experiencia-form"
>
<form
name=
"experiencia-form"
>
<label
for=
"institucion"
class=
"form-label"
>
Institucion
</label>
<label
for=
"institucion"
class=
"form-label"
>
Institucion
</label>
<input
type=
"text"
class=
"form-control "
name=
"institucion"
id=
"institucion"
>
<input
type=
"text"
class=
"form-control "
name=
"institucion"
id=
"institucion"
required
>
<label
for=
"fechaDesde"
class=
"form-label"
>
FechaDesde
</label>
<label
for=
"fechaDesde"
class=
"form-label"
>
FechaDesde
</label>
<input
type=
"date"
class=
"form-control "
name=
"fechaDesde"
id=
"fechaDesde"
>
<input
type=
"date"
min=
"1960-01-01"
class=
"form-control "
name=
"fechaDesde"
id=
"fechaDesde"
required
>
<label
for=
"fechaHasta"
class=
"form-label"
>
Fecha Hasta
</label>
<label
for=
"fechaHasta"
class=
"form-label"
>
Fecha Hasta
</label>
<input
type=
"date"
class=
"form-control "
name=
"fechaHasta"
id=
"fechaHasta"
>
<input
type=
"date"
class=
"form-control "
name=
"fechaHasta"
id=
"fechaHasta"
>
<label
for=
"cargo"
class=
"form-label"
>
Cargo
</label>
<label
for=
"cargo"
class=
"form-label"
>
Cargo
</label>
<input
type=
"text"
class=
"form-control "
name=
"cargo"
id=
"cargo"
>
<input
type=
"text"
class=
"form-control "
name=
"cargo"
id=
"cargo"
required
>
<label
for=
"descripcion"
class=
"form-label"
>
Descripcion
</label>
<label
for=
"descripcion"
class=
"form-label"
>
Descripcion
</label>
<textarea
class=
"form-control "
name=
"descripcion"
id=
"descripcion"
>
</textarea>
<textarea
class=
"form-control "
name=
"descripcion"
id=
"descripcion"
>
</textarea>
...
@@ -149,7 +187,7 @@
...
@@ -149,7 +187,7 @@
</div>
</div>
<div
class=
"modal-footer"
>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-secondary"
data-dismiss=
"modal"
>
Close
</button>
<button
type=
"button"
class=
"btn btn-secondary"
data-dismiss=
"modal"
>
Close
</button>
<button
type=
"button"
class=
"btn btn-primary"
onclick=
"agregarFieldExpierncia()"
data-dismiss=
"modal"
>
Agregar
</button>
<button
id=
"agregar-exp"
type=
"button"
class=
"btn btn-primary"
onclick=
"agregarFieldExpierncia()"
data-dismiss=
"modal"
>
Agregar
</button>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment