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
58f92202
Commit
58f92202
authored
Nov 02, 2021
by
Joaquin Elias Baranda Ayala
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Agregar estudios a postulantes
parent
6c7fe450
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
105 additions
and
9 deletions
+105
-9
curriculumsearch/src/main/resources/static/main.js
+54
-2
curriculumsearch/src/main/webapp/jsp/postulante-form.jsp
+51
-7
No files found.
curriculumsearch/src/main/resources/static/main.js
View file @
58f92202
...
@@ -89,4 +89,57 @@ form.addEventListener("submit",(evt)=>{
...
@@ -89,4 +89,57 @@ form.addEventListener("submit",(evt)=>{
location
.
replace
(
response
.
url
);
location
.
replace
(
response
.
url
);
});
});
evt
.
preventDefault
();
evt
.
preventDefault
();
}
);
}
);
\ No newline at end of file
//Metodos para Estudios
function
agregarFieldEstudio
(){
//recoger del form
const
pairs
=
{};
const
formest
=
document
.
querySelector
(
"[name=estudio-form"
);
const
formData
=
new
FormData
(
formest
);
for
(
const
[
name
,
value
]
of
formData
){
pairs
[
name
]
=
value
}
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 @
58f92202
...
@@ -66,19 +66,22 @@
...
@@ -66,19 +66,22 @@
<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"
>
</div>
</div>
<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>
<div
id=
"experiencias"
>
<div
id=
"experiencias"
></div>
<br>
</div>
<button
type=
"button"
class=
"btn btn-primary"
data-toggle=
"modal"
data-target=
"#estudioForm"
>
Agregar Estudios
</button>
<br><br>
<div
id=
"estudios"
></div>
<button
type=
"submit"
class=
"btn btn-primary"
>
Submit
</button>
<button
type=
"submit"
class=
"btn btn-primary"
>
Submit
</button>
</form>
</form>
<!--Modal de Experiencia-->
<div
class=
"modal fade"
id=
"experienciaForm"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"experienciaForm"
aria-hidden=
"true"
>
<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-dialog"
role=
"document"
>
<div
class=
"modal-content"
>
<div
class=
"modal-content"
>
...
@@ -110,6 +113,47 @@
...
@@ -110,6 +113,47 @@
</div>
</div>
</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=
"referencias"
class=
"form-label"
>
Referencias
</label>
<input
type=
"text"
class=
"form-control "
name=
"referencias"
id=
"referencias"
>
<label
for=
"titulo"
class=
"form-label"
>
Titulo
</label>
<input
type=
"text"
class=
"form-control "
name=
"titulo"
id=
"titulo"
>
</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! -->
<!-- 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>
<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