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
1
Merge Requests
1
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
Oscar Enrique Gonzalez Escurra
th-app-java
Commits
eb16b56a
Commit
eb16b56a
authored
Nov 02, 2021
by
Joel Florentin
Browse files
Options
Browse Files
Download
Plain Diff
merge con estudio
parents
52078ec2
75f96f7f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
138 additions
and
18 deletions
+138
-18
curriculumsearch/src/main/java/com/roshka/modelo/Estudio.java
+3
-13
curriculumsearch/src/main/resources/static/main.js
+62
-0
curriculumsearch/src/main/webapp/jsp/postulante-form.jsp
+73
-5
No files found.
curriculumsearch/src/main/java/com/roshka/modelo/Estudio.java
View file @
eb16b56a
...
...
@@ -3,6 +3,7 @@ package com.roshka.modelo;
import
java.util.Date
;
import
java.util.List
;
import
javax.persistence.CascadeType
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
...
...
@@ -22,7 +23,7 @@ import com.fasterxml.jackson.annotation.JsonManagedReference;
@Table
(
name
=
"estudio"
)
public
class
Estudio
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@Column
(
name
=
"id"
)
private
long
id
;
...
...
@@ -42,9 +43,6 @@ public class Estudio {
@Column
(
name
=
"fecha_hasta"
)
private
Date
fechaHasta
;
@Column
(
name
=
"referencias"
)
private
String
referencias
;
@Column
(
name
=
"titulo"
)
@NotBlank
(
message
=
"Este campo no puede estar vacio"
)
private
String
titulo
;
...
...
@@ -55,7 +53,7 @@ public class Estudio {
private
Postulante
postulante
;
@JsonManagedReference
@OneToMany
(
mappedBy
=
"estudio"
)
@OneToMany
(
mappedBy
=
"estudio"
,
cascade
=
CascadeType
.
ALL
)
private
List
<
EstudioReconocimiento
>
estudioReconocimiento
;
...
...
@@ -119,14 +117,6 @@ public class Estudio {
this
.
fechaHasta
=
fechaHasta
;
}
public
String
getReferencias
()
{
return
this
.
referencias
;
}
public
void
setReferencias
(
String
referencias
)
{
this
.
referencias
=
referencias
;
}
public
String
getTitulo
()
{
return
this
.
titulo
;
}
...
...
curriculumsearch/src/main/resources/static/main.js
View file @
eb16b56a
...
...
@@ -153,3 +153,65 @@ form.addEventListener("submit",(evt)=>{
}
);
document
.
querySelector
(
"#btn-new-tech"
).
addEventListener
(
'click'
,()
=>
{
document
.
querySelector
(
"#tecnologia-nombre"
).
classList
.
remove
(
'd-none'
)})
//Metodos para Estudios
function
agregarFieldEstudio
(){
//recoger del form
const
pairs
=
{};
const
formest
=
document
.
querySelector
(
"[name=estudio-form"
);
const
formData
=
new
FormData
(
formest
);
const
estudioReconocimiento
=
[{},{},{}];
let
pos_rec
;
for
(
const
[
name
,
value
]
of
formData
){
pos_rec
=
name
.
split
(
"-"
);
//rec-nombre-index
if
(
pos_rec
.
length
>
1
)
{
estudioReconocimiento
[
pos_rec
[
2
]][
pos_rec
[
1
]]
=
value
}
else
{
pairs
[
name
]
=
value
}
}
pairs
[
"estudioReconocimiento"
]
=
estudioReconocimiento
.
filter
(
rec
=>
rec
.
nombre
);
estudios
[
cont_estudios
]
=
pairs
;
formest
.
reset
();
//imprimir lista actualizada
const
div
=
document
.
querySelector
(
"#estudios"
)
const
div1
=
document
.
createElement
(
'div'
);
let
content
=
'<ul>'
for
(
let
index
=
0
;
index
<
estudios
.
length
;
index
++
)
{
const
est
=
estudios
[
index
];
if
(
est
==
null
)
continue
;
content
+=
`
<li id="est-
${
index
}
">
${
est
.
institucion
}
<button type="button" onclick="eliminarEstudio(event)">Eliminar</button>
</li>
`
}
content
+=
"</ul>"
div1
.
innerHTML
=
content
div
.
innerHTML
=
''
;
div
.
appendChild
(
div1
);
cont_estudios
++
;
}
function
eliminarEstudio
(
event
)
{
//eliminar del array
estudios
[
event
.
target
.
parentElement
.
id
.
split
(
"-"
)[
1
]]
=
null
//eliminar en html
event
.
target
.
parentElement
.
remove
()
}
curriculumsearch/src/main/webapp/jsp/postulante-form.jsp
View file @
eb16b56a
...
...
@@ -70,24 +70,29 @@
<label
for=
"modalidad"
class=
"form-label"
>
Modalidad
</label>
<input
type=
"text"
class=
"form-control "
name=
"modalidad"
id=
"modalidad"
>
</div>
<br>
<button
type=
"button"
class=
"btn btn-primary"
data-toggle=
"modal"
data-target=
"#experienciaForm"
>
Agregar Experiencia
</button>
<div
id=
"experiencias"
>
<div
id=
"experiencias"
></div>
<br>
<button
type=
"button"
class=
"btn btn-primary"
data-toggle=
"modal"
data-target=
"#estudioForm"
>
Agregar Estudios
</button>
<br><br>
<div
id=
"estudios"
>
</div>
<button
type=
"button"
class=
"btn btn-primary"
data-toggle=
"modal"
data-target=
"#tecnologiaForm"
>
Agregar Tecnologia
</button>
<div
id=
"tecnologias"
>
</div>
<button
type=
"submit"
class=
"btn btn-primary"
>
Submit
</button>
</form>
<!--Modal de Experiencia-->
<div
class=
"modal fade"
id=
"experienciaForm"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"experienciaForm"
aria-hidden=
"true"
>
<div
class=
"modal-dialog"
role=
"document"
>
<div
class=
"modal-content"
>
...
...
@@ -186,6 +191,69 @@
</div>
</div>
<!--------------------------------------------------------------------------------------->
<!--Modal de Estudios-->
<div
class=
"modal fade"
id=
"estudioForm"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"estudioForm"
aria-hidden=
"true"
>
<div
class=
"modal-dialog"
role=
"document"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<h5
class=
"modal-title"
id=
"exampleModalLabel"
>
Estudios
</h5>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
>
<span
aria-hidden=
"true"
>
×
</span>
</button>
</div>
<div
class=
"modal-body"
>
<form
name=
"estudio-form"
>
<label
for=
"tipoDeEstudio"
class=
"form-label"
>
Tipo De Estudio
</label>
<input
type=
"text"
class=
"form-control "
name=
"tipoDeEstudio"
id=
"tipoDeEstudio"
>
<label
for=
"institucion"
class=
"form-label"
>
Institucion
</label>
<input
type=
"text"
class=
"form-control "
name=
"institucion"
id=
"institucion"
>
<label
for=
"fechaDesde"
class=
"form-label"
>
Fecha Desde
</label>
<input
type=
"date"
class=
"form-control "
name=
"fechaDesde"
id=
"fechaDesde"
>
<label
for=
"fechaHasta"
class=
"form-label"
>
Fecha Hasta
</label>
<input
type=
"date"
class=
"form-control "
name=
"fechaHasta"
id=
"fechaHasta"
>
<label
for=
"titulo"
class=
"form-label"
>
Titulo
</label>
<input
type=
"text"
class=
"form-control "
name=
"titulo"
id=
"titulo"
>
<label
class=
"form-label"
>
Reconocimientos
</label>
<div
class=
"row mb-3"
>
<div
class=
"col"
>
<input
type=
"text"
class=
"form-control"
name=
"rec-nombre-0"
placeholder=
"Titulo del reconocimiento"
aria-label=
"First name"
>
</div>
<div
class=
"col"
>
<input
type=
"text"
class=
"form-control"
name=
"rec-certificado-0"
placeholder=
"Adjuntar archivo"
aria-label=
"Last name"
>
</div>
</div>
<div
class=
"row mb-3"
>
<div
class=
"col"
>
<input
type=
"text"
class=
"form-control"
name=
"rec-nombre-1"
placeholder=
"Titulo del reconocimiento"
aria-label=
"First name"
>
</div>
<div
class=
"col"
>
<input
type=
"text"
class=
"form-control"
name=
"rec-certificado-1"
placeholder=
"Adjuntar archivo"
aria-label=
"Last name"
>
</div>
</div>
<div
class=
"row mb-3"
>
<div
class=
"col"
>
<input
type=
"text"
class=
"form-control"
name=
"rec-nombre-2"
placeholder=
"Titulo del reconocimiento"
aria-label=
"First name"
>
</div>
<div
class=
"col"
>
<input
type=
"text"
class=
"form-control"
name=
"rec-certificado-2"
placeholder=
"Adjuntar archivo"
aria-label=
"Last name"
>
</div>
</div>
</form>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-secondary"
data-dismiss=
"modal"
>
Cerrar
</button>
<button
type=
"button"
class=
"btn btn-primary"
onclick=
"agregarFieldEstudio()"
data-dismiss=
"modal"
>
Agregar
</button>
</div>
</div>
</div>
</div>
<!-- Optional JavaScript; choose one of the two! -->
<script
src=
"https://code.jquery.com/jquery-3.3.1.slim.min.js"
integrity=
"sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
crossorigin=
"anonymous"
></script>
...
...
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