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
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
127 additions
and
48 deletions
+127
-48
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
+24
-24
curriculumsearch/src/main/resources/static/main.js
+45
-4
curriculumsearch/src/main/webapp/jsp/postulante-form.jsp
+55
-17
No files found.
curriculumsearch/src/main/java/com/roshka/modelo/Experiencia.java
View file @
364b178e
...
...
@@ -78,7 +78,7 @@ public class Experiencia {
if
(
fechaDesde
==
null
||
fechaDesde
.
isEmpty
())
return
;
try
{
this
.
fechaDesde
=
new
SimpleDateFormat
(
"yyyy-
mm
-dd"
).
parse
(
fechaDesde
);
this
.
fechaDesde
=
new
SimpleDateFormat
(
"yyyy-
MM
-dd"
).
parse
(
fechaDesde
);
}
catch
(
ParseException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
...
...
@@ -94,7 +94,7 @@ public class Experiencia {
if
(
fechaHasta
==
null
||
fechaHasta
.
isEmpty
())
return
;
try
{
this
.
fechaHasta
=
new
SimpleDateFormat
(
"yyyy-
mm
-dd"
).
parse
(
fechaHasta
);
this
.
fechaHasta
=
new
SimpleDateFormat
(
"yyyy-
MM
-dd"
).
parse
(
fechaHasta
);
}
catch
(
ParseException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
...
...
curriculumsearch/src/main/java/com/roshka/modelo/Postulante.java
View file @
364b178e
...
...
@@ -153,7 +153,7 @@ public class Postulante {
if
(
fechaNacimiento
==
null
||
fechaNacimiento
.
isEmpty
())
return
;
try
{
this
.
fechaNacimiento
=
new
SimpleDateFormat
(
"yyyy-mm
-dd"
).
parse
(
fechaNacimiento
);
this
.
fechaNacimiento
=
new
SimpleDateFormat
(
"yyyy-MM
-dd"
).
parse
(
fechaNacimiento
);
}
catch
(
ParseException
e
)
{
// TODO Auto-generated catch block
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 {
@JoinColumn
@JsonBackReference
private
Postulante
postulante
;
public
long
getId
()
{
return
id
;
}
public
void
setId
(
long
id
)
{
this
.
id
=
id
;
}
public
Long
getNivel
()
{
return
nivel
;
}
public
void
setNivel
(
Long
nivel
)
{
this
.
nivel
=
nivel
;
}
public
Tecnologia
getTecnologia
()
{
return
tecnologia
;
}
public
void
setTecnologia
(
Tecnologia
tecnologia
)
{
this
.
tecnologia
=
tecnologia
;
}
public
Postulante
getPostulante
()
{
return
postulante
;
}
public
void
setPostulante
(
Postulante
postulante
)
{
this
.
postulante
=
postulante
;
}
public
long
getId
()
{
return
id
;
}
public
void
setId
(
long
id
)
{
this
.
id
=
id
;
}
public
Long
getNivel
()
{
return
nivel
;
}
public
void
setNivel
(
Long
nivel
)
{
this
.
nivel
=
nivel
;
}
public
Tecnologia
getTecnologia
()
{
return
tecnologia
;
}
public
void
setTecnologia
(
Tecnologia
tecnologia
)
{
this
.
tecnologia
=
tecnologia
;
}
public
Postulante
getPostulante
()
{
return
postulante
;
}
public
void
setPostulante
(
Postulante
postulante
)
{
this
.
postulante
=
postulante
;
}
...
...
curriculumsearch/src/main/resources/static/main.js
View file @
364b178e
...
...
@@ -4,13 +4,51 @@ let cont_tecnologia = 0;
const
experiencias
=
[];
const
estudios
=
[];
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
const
pairs
=
{};
const
formexp
=
document
.
querySelector
(
"[name=experiencia-form]"
);
const
formData
=
new
FormData
(
formexp
);
const
reconocimientos
=
[{},{},{}];
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
){
pos_rec
=
name
.
split
(
"-"
);
//rec-nombre-index
if
(
pos_rec
.
length
>
1
)
{
...
...
@@ -44,7 +82,6 @@ function agregarFieldExpierncia(){
div
.
innerHTML
=
''
;
div
.
appendChild
(
div1
);
cont_experiencia
++
;
}
/*--------------------------------------------------------------------*/
function
agregarFieldTecnologia
(){
...
...
@@ -137,10 +174,14 @@ async function postData(url = '', data = {}) {
});
return
response
;
// parses JSON response into native JavaScript objects
}
formValidator
()
form
=
document
.
querySelector
(
"form"
);
form
.
addEventListener
(
"submit"
,(
evt
)
=>
{
// if (!form.checkValidity()) {
// evt.preventDefault()
// evt.stopPropagation()
// }
// form.classList.add('was-validated')
postData
(
'postulante'
,
serializeJSON
(
form
))
.
then
(
response
=>
{
if
(
response
.
status
==
200
||
response
.
status
==
302
){
...
...
curriculumsearch/src/main/webapp/jsp/postulante-form.jsp
View file @
364b178e
...
...
@@ -16,47 +16,74 @@
<body
class=
"container"
>
<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"
>
<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
class=
"valid-feedback"
>
Luce Bien!
</div>
</div>
<div
class=
"mb-3 col-5"
>
<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
class=
"mb-3 col-5"
>
<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
class=
"mb-3 col-3"
>
<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
class=
"mb-3 col-5"
>
<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
class=
"mb-3 col-5"
>
<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
class=
"mb-3 col-5"
>
<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
class=
"mb-3 col-5"
>
<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
class=
"mb-3 col-5"
>
<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
class=
"mb-3 col-5"
>
<label
for=
"curriculum"
class=
"form-label"
>
Curriculum
</label>
...
...
@@ -64,13 +91,21 @@
</div>
<div
class=
"mb-3 col-5"
>
<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
class=
"mb-3 col-5"
>
<label
for=
"modalidad"
class=
"form-label"
>
Modalidad
</label>
<input
type=
"text"
class=
"form-control "
name=
"modalidad"
id=
"modalidad"
>
</div>
<input
type=
"text"
class=
"form-control "
name=
"modalidad"
id=
"modalidad"
required
>
<div
class=
"valid-feedback"
>
Luce Bien!
</div>
</div>
<br>
<button
type=
"button"
class=
"btn btn-primary"
data-toggle=
"modal"
data-target=
"#experienciaForm"
>
Agregar Experiencia
</button>
...
...
@@ -105,13 +140,16 @@
<div
class=
"modal-body"
>
<form
name=
"experiencia-form"
>
<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>
<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>
<input
type=
"date"
class=
"form-control "
name=
"fechaHasta"
id=
"fechaHasta"
>
<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>
<textarea
class=
"form-control "
name=
"descripcion"
id=
"descripcion"
>
</textarea>
...
...
@@ -149,7 +187,7 @@
</div>
<div
class=
"modal-footer"
>
<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>
...
...
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