Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Walter Felipe
submeta
Commits
c5cf76e3
Commit
c5cf76e3
authored
May 10, 2023
by
Yuri Resende
Browse files
Fazendo com que seja possível salvar como rascunho na edição do projeto
parent
ecfe84a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
resources/views/projeto/editar.blade.php
View file @
c5cf76e3
...
@@ -105,27 +105,29 @@
...
@@ -105,27 +105,29 @@
<
script
>
<
script
>
let
radio_sim
=
document
.
getElementById
(
"radioSim"
);
if
(
document
.
getElementById
(
"radioSim"
)
.
checked
){
if
(
radio_sim
){
document
.
getElementById
(
"radioSim"
)
.
checked
=
true
;
if
(
radio_sim
.
checked
){
document
.
getElementById
(
"radioNao"
)
.
checked
=
false
;
document
.
getElementById
(
"radioSim"
)
.
checked
=
true
;
document
.
getElementById
(
"displaySim"
)
.
style
.
display
=
"block"
;
document
.
getElementById
(
"radioNao"
)
.
checked
=
false
;
document
.
getElementById
(
"displayNao"
)
.
style
.
display
=
"none"
;
document
.
getElementById
(
"displaySim"
)
.
style
.
display
=
"block"
;
document
.
getElementById
(
"idAvisoAutorizacaoEspecial"
)
.
style
.
display
=
"none"
;
document
.
getElementById
(
"displayNao"
)
.
style
.
display
=
"none"
;
}
else
{
document
.
getElementById
(
"idAvisoAutorizacaoEspecial"
)
.
style
.
display
=
"none"
;
document
.
getElementById
(
"radioSim"
)
.
checked
=
false
;
}
else
{
document
.
getElementById
(
"radioNao"
)
.
checked
=
true
;
document
.
getElementById
(
"radioSim"
)
.
checked
=
false
;
document
.
getElementById
(
"displaySim"
)
.
style
.
display
=
"none"
;
document
.
getElementById
(
"radioNao"
)
.
checked
=
true
;
document
.
getElementById
(
"displayNao"
)
.
style
.
display
=
"block"
;
document
.
getElementById
(
"displaySim"
)
.
style
.
display
=
"none"
;
document
.
getElementById
(
"idAvisoAutorizacaoEspecial"
)
.
style
.
display
=
"none"
;
document
.
getElementById
(
"displayNao"
)
.
style
.
display
=
"block"
;
document
.
getElementById
(
"idAvisoAutorizacaoEspecial"
)
.
style
.
display
=
"none"
;
}
}
}
let
buttonSubmit
=
document
.
getElementById
(
'idButtonSubmitProjeto'
);
let
buttonSubmit
=
document
.
getElementById
(
'idButtonSubmitProjeto'
);
let
buttonRascunho
=
document
.
getElementById
(
'idButtonSubmitRascunho'
);
let
buttonRascunho
=
document
.
getElementById
(
'idButtonSubmitRascunho'
);
@
if
(
$edital
->
numParticipantes
!=
0
)
@
if
(
$edital
->
numParticipantes
!=
0
)
let
parts
=
document
.
getElementById
(
'participante'
);
let
parts
=
document
.
getElementById
(
'participante'
);
let
partsFirst
=
document
.
getElementById
(
'participanteFirst'
);
//
let partsFirst = document.getElementById('participanteFirst');
const
participante
=
partsFirst
.
firstElementChild
;
//
const participante = partsFirst.firstElementChild;
@
endif
@
endif
let
contador
=
0
;
let
contador
=
0
;
...
@@ -138,6 +140,7 @@
...
@@ -138,6 +140,7 @@
const
input
=
'<input id="input_rascunho" type="hidden" name="rascunho" value="true">'
;
const
input
=
'<input id="input_rascunho" type="hidden" name="rascunho" value="true">'
;
$
(
"#updateProjetoForm"
)
.
append
(
input
);
$
(
"#updateProjetoForm"
)
.
append
(
input
);
})
})
@
if
(
$edital
->
numParticipantes
!=
0
)
@
if
(
$edital
->
numParticipantes
!=
0
)
function
gerarPeriodo
(
e
){
function
gerarPeriodo
(
e
){
var
select
=
e
.
parentElement
.
parentElement
.
nextElementSibling
;
var
select
=
e
.
parentElement
.
parentElement
.
nextElementSibling
;
...
@@ -172,57 +175,57 @@
...
@@ -172,57 +175,57 @@
}
}
};
};
$
(
"input.cpf:text"
)
.
mask
(
"000.000.000-00"
);
//
$("input.cpf:text").mask("000.000.000-00");
$
(
"input.celular:text"
)
.
mask
(
SPMaskBehavior
,
spOptions
);
//
$("input.celular:text").mask(SPMaskBehavior, spOptions);
$
(
"input.cep:text"
)
.
mask
(
"00000-000"
);
//
$("input.cep:text").mask("00000-000");
buttonMais
.
addEventListener
(
"click"
,
(
e
)
=>
{
//
buttonMais.addEventListener("click", (e) => {
if
(
parts
.
children
.
length
>=
"{{
$edital->numParticipantes
}}"
){
//
if(parts.children.length >= "{{ $edital->numParticipantes }}"){
alert
(
'Limite de participante.'
)
//
alert('Limite de participante.')
}
else
{
//
}else{
contador
++
;
//
contador++;
var
cln
=
participante
.
cloneNode
(
true
);
//
var cln = participante.cloneNode(true);
cln
.
setAttribute
(
'style'
,
" "
);
//
cln.setAttribute('style', " ");
var
id
=
cln
.
children
[
2
]
.
firstElementChild
.
id
;
//
var id = cln.children[2].firstElementChild.id;
var
id2
=
cln
.
children
[
0
]
.
firstElementChild
.
id
;
//
var id2 = cln.children[0].firstElementChild.id;
cln
.
children
[
2
]
.
firstElementChild
.
setAttribute
(
'id'
,
id
+
contador
);
//
cln.children[2].firstElementChild.setAttribute('id', id + contador);
cln
.
children
[
0
]
.
firstElementChild
.
setAttribute
(
'href'
,
"#collapseParticipante"
+
contador
);
//
cln.children[0].firstElementChild.setAttribute('href', "#collapseParticipante" + contador);
cln
.
children
[
0
]
.
firstElementChild
.
setAttribute
(
'id'
,
id2
+
contador
);
//
cln.children[0].firstElementChild.setAttribute('id', id2 + contador);
for
(
i
=
0
;
i
<
cln
.
children
.
length
;
i
++
)
{
//
for (i = 0; i < cln.children.length; i++) {
for
(
let
index
=
0
;
index
<
cln
.
children
[
i
]
.
querySelectorAll
(
'input'
)
.
length
;
index
++
)
{
//
for (let index = 0; index < cln.children[i].querySelectorAll('input').length; index++) {
let
input
=
cln
.
children
[
i
]
.
querySelectorAll
(
'input'
)[
index
];
//
let input = cln.children[i].querySelectorAll('input')[index];
let
name
=
input
.
getAttributeNode
(
"name"
)
.
value
;
//
let name = input.getAttributeNode("name").value;
name
=
name
.
replace
(
"[]"
,
""
);
//
name = name.replace("[]", "");
input
.
getAttributeNode
(
"name"
)
.
value
=
name
+
'['
+
contador
+
']'
;
//
input.getAttributeNode("name").value = name + '['+ contador +']';
let
select
=
cln
.
children
[
i
]
.
querySelectorAll
(
'select'
)[
index
];
//
let select = cln.children[i].querySelectorAll('select')[index];
if
(
select
){
//
if(select){
let
selectName
=
select
.
getAttributeNode
(
"name"
)
.
value
;
//
let selectName = select.getAttributeNode("name").value;
selectName
=
selectName
.
replace
(
"["
,
""
);
//
selectName = selectName.replace("[", "");
selectName
=
selectName
.
replace
(
"]"
,
""
);
//
selectName = selectName.replace("]", "");
select
.
getAttributeNode
(
"name"
)
.
value
=
selectName
+
'['
+
contador
+
']'
;
//
select.getAttributeNode("name").value = selectName + '['+ contador +']';
}
//
}
}
//
}
}
//
}
var
SPMaskBehavior
=
function
(
val
)
{
//
var SPMaskBehavior = function (val) {
return
val
.
replace
(
/
\
D
/
g
,
''
)
.
length
===
11
?
'(00) 00000-0000'
:
'(00) 0000-00009'
;
//
return val.replace(/\D/g, '').length === 11 ? '(00) 00000-0000' : '(00) 0000-00009';
},
//
},
spOptions
=
{
//
spOptions = {
onKeyPress
:
function
(
val
,
e
,
field
,
options
)
{
//
onKeyPress: function(val, e, field, options) {
field
.
mask
(
SPMaskBehavior
.
apply
({},
arguments
),
options
);
//
field.mask(SPMaskBehavior.apply({}, arguments), options);
}
//
}
};
//
};
parts
.
appendChild
(
cln
);
//
parts.appendChild(cln);
$
(
"input.cpf:text"
)
.
val
(
""
)
.
mask
(
"000.000.000-00"
);
//
$("input.cpf:text").val("").mask("000.000.000-00");
$
(
"input.celular:text"
)
.
val
(
""
)
.
mask
(
SPMaskBehavior
,
spOptions
);
//
$("input.celular:text").val("").mask(SPMaskBehavior, spOptions);
$
(
"input.cep:text"
)
.
val
(
""
)
.
mask
(
"00000-000"
);
//
$("input.cep:text").val("").mask("00000-000");
}
//
}
});
//
});
function
marcar
(
id
){
function
marcar
(
id
){
let
nome
=
document
.
getElementById
(
"nome"
+
id
);
let
nome
=
document
.
getElementById
(
"nome"
+
id
);
...
...
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