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
2c98ce83
Commit
2c98ce83
authored
Nov 02, 2021
by
Joel Florentin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'William_001' of
https://phoebe.roshka.com/gitlab/hshah/TalentoHumano
into joel-001
parents
82843de9
260f5f9b
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
85 additions
and
6 deletions
+85
-6
curriculumsearch/src/main/java/com/roshka/CurriculumsearchApplication.java
+1
-0
curriculumsearch/src/main/java/com/roshka/modelo/PostulanteTecnologia.java
+2
-2
curriculumsearch/src/main/resources/static/main.js
+47
-1
curriculumsearch/src/main/webapp/jsp/postulante-form.jsp
+35
-3
No files found.
curriculumsearch/src/main/java/com/roshka/CurriculumsearchApplication.java
View file @
2c98ce83
...
@@ -14,4 +14,5 @@ public class CurriculumsearchApplication {
...
@@ -14,4 +14,5 @@ public class CurriculumsearchApplication {
SpringApplication
.
run
(
CurriculumsearchApplication
.
class
,
args
);
SpringApplication
.
run
(
CurriculumsearchApplication
.
class
,
args
);
}
}
}
}
curriculumsearch/src/main/java/com/roshka/modelo/PostulanteTecnologia.java
View file @
2c98ce83
package
com
.
roshka
.
modelo
;
package
com
.
roshka
.
modelo
;
import
javax.persistence.CascadeType
;
import
javax.persistence.Column
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GeneratedValue
;
...
@@ -26,8 +27,7 @@ public class PostulanteTecnologia {
...
@@ -26,8 +27,7 @@ public class PostulanteTecnologia {
@Min
(
value
=
1
)
@Min
(
value
=
1
)
@Max
(
value
=
5
)
@Max
(
value
=
5
)
private
Long
nivel
;
private
Long
nivel
;
@ManyToOne
(
cascade
=
CascadeType
.
PERSIST
)
@ManyToOne
()
@JoinColumn
@JoinColumn
private
Tecnologia
tecnologia
;
private
Tecnologia
tecnologia
;
...
...
curriculumsearch/src/main/resources/static/main.js
View file @
2c98ce83
...
@@ -28,7 +28,6 @@ function agregarFieldExpierncia(){
...
@@ -28,7 +28,6 @@ function agregarFieldExpierncia(){
const
div
=
document
.
querySelector
(
"#experiencias"
)
const
div
=
document
.
querySelector
(
"#experiencias"
)
const
div1
=
document
.
createElement
(
'div'
);
const
div1
=
document
.
createElement
(
'div'
);
let
content
=
'<ul>'
let
content
=
'<ul>'
for
(
let
index
=
0
;
index
<
experiencias
.
length
;
index
++
)
{
for
(
let
index
=
0
;
index
<
experiencias
.
length
;
index
++
)
{
const
exp
=
experiencias
[
index
];
const
exp
=
experiencias
[
index
];
if
(
exp
==
null
)
continue
;
if
(
exp
==
null
)
continue
;
...
@@ -47,13 +46,60 @@ function agregarFieldExpierncia(){
...
@@ -47,13 +46,60 @@ function agregarFieldExpierncia(){
cont_experiencia
++
;
cont_experiencia
++
;
}
}
/*--------------------------------------------------------------------*/
function
agregarFieldTecnologia
(){
//recoger del form
const
pairs
=
{};
const
formtecn
=
document
.
querySelector
(
"[name=tecnologia-form]"
);
const
formData
=
new
FormData
(
formtecn
);
for
(
const
[
name
,
value
]
of
formData
){
pairs
[
name
]
=
value
}
tecnologias
[
cont_tecnologia
]
=
{}
tecnologias
[
cont_tecnologia
][
"tecnologia"
]
=
{
nombre
:
pairs
.
nombre
}
tecnologias
[
cont_tecnologia
][
"nivel"
]
=
pairs
.
nivel
//tecnologias[cont_tecnologia] = pairs;
formtecn
.
reset
();
//imprimir lista actualizada
const
div
=
document
.
querySelector
(
"#tecnologias"
)
const
div1
=
document
.
createElement
(
'div'
);
console
.
log
(
tecnologias
[
0
])
let
content1
=
'<ul>'
for
(
let
index
=
0
;
index
<
tecnologias
.
length
;
index
++
)
{
const
tecn
=
tecnologias
[
index
];
if
(
tecn
==
null
)
continue
;
content1
+=
`
<li id="tecn-
${
index
}
">
${
tecn
.
tecnologia
.
nombre
}
<button type="button" onclick="eliminarTecnologia(event)">Eliminar</button>
</li>
`
}
content1
+=
"</ul>"
div1
.
innerHTML
=
content1
div
.
innerHTML
=
''
;
div
.
appendChild
(
div1
);
cont_tecnologia
++
;
}
/*--------------------------------------------------------------------*/
function
eliminarExperiencia
(
event
)
{
function
eliminarExperiencia
(
event
)
{
//eliminar del array
//eliminar del array
experiencias
[
event
.
target
.
parentElement
.
id
.
split
(
"-"
)[
1
]]
=
null
experiencias
[
event
.
target
.
parentElement
.
id
.
split
(
"-"
)[
1
]]
=
null
//eliminar en html
//eliminar en html
event
.
target
.
parentElement
.
remove
()
event
.
target
.
parentElement
.
remove
()
}
}
/*----------------------------------------------------------------- */
function
eliminarTecnologia
(
event
)
{
//eliminar del array
tecnologias
[
event
.
target
.
parentElement
.
id
.
split
(
"-"
)[
1
]]
=
null
//eliminar en html
event
.
target
.
parentElement
.
remove
()
}
/*----------------------------------------------------------------- */
function
serializeJSON
(
form
)
{
function
serializeJSON
(
form
)
{
// Create a new FormData object
// Create a new FormData object
const
formData
=
new
FormData
(
form
);
const
formData
=
new
FormData
(
form
);
...
...
curriculumsearch/src/main/webapp/jsp/postulante-form.jsp
View file @
2c98ce83
...
@@ -76,6 +76,12 @@
...
@@ -76,6 +76,12 @@
<div
id=
"experiencias"
>
<div
id=
"experiencias"
>
</div>
</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>
<button
type=
"submit"
class=
"btn btn-primary"
>
Submit
</button>
</form>
</form>
...
@@ -140,12 +146,37 @@
...
@@ -140,12 +146,37 @@
</div>
</div>
</div>
</div>
</div>
</div>
<!--------------------------------------------------------------------------------------->
<div
class=
"modal fade"
id=
"tecnologiaForm"
tabindex=
"-2"
role=
"dialog"
aria-labelledby=
"tecnologiaForm"
aria-hidden=
"true"
>
<div
class=
"modal-dialog"
role=
"document"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<h5
class=
"modal-title"
id=
"exampleModalLabel"
>
tecnologia
</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=
"tecnologia-form"
>
<label
for=
"nombre"
class=
"form-label"
>
Nombre
</label>
<input
type=
"text"
class=
"form-control"
name=
"nombre"
id=
"nombre"
>
<label
for=
"nivel"
class=
"form-label"
>
Nivel
</label>
<input
type=
"number"
class=
"form-control"
name=
"nivel"
id=
"nivel"
>
</form>
</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=
"agregarFieldTecnologia()"
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>
<script
src=
"https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"
integrity=
"sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
crossorigin=
"anonymous"
></script>
<script
src=
"https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"
integrity=
"sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
crossorigin=
"anonymous"
></script>
<script
src=
"https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"
integrity=
"sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"
crossorigin=
"anonymous"
></script>
<script
src=
"https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"
integrity=
"sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"
crossorigin=
"anonymous"
></script>
<script
src=
"./main.js"
></script>
<script
src=
"./main.js"
></script>
</body>
</body>
</html>
</html>
\ No newline at end of file
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