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
f37bbaf2
Commit
f37bbaf2
authored
Jun 14, 2020
by
alinetenorio
Browse files
old input em dados de participantes
parent
c3a82172
Changes
1
Show whitespace changes
Inline
Side-by-side
resources/views/evento/submeterTrabalho.blade.php
View file @
f37bbaf2
...
@@ -266,13 +266,18 @@
...
@@ -266,13 +266,18 @@
<div class="
row
" style="
margin
-
top
:
20
px
">
<div class="
row
" style="
margin
-
top
:
20
px
">
<div class="
col
-
sm
-
12
">
<div class="
col
-
sm
-
12
">
<div id="
participantes
">
<div id="
participantes
">
@if(old('divParticipante') == null)
@php
$countParticipante
= 1; @endphp
@if(old('countParticipante') != null)
@php
$countParticipante
= old('countParticipante') @endphp
@endif
{
{$countParticipante}
}
@if (
$countParticipante
!= null &&
$countParticipante
> 0)
@for (
$i
= 0;
$i
<
$countParticipante
;
$i
++)
<div id="
novoParticipante
" style="
display
:
block
;
">
<div id="
novoParticipante
" style="
display
:
block
;
">
<br>
<br>
<h5>Dados do participante</h5>
<h5>Dados do participante</h5>
@php
$i
= 0;
@endphp
<div class="
row
">
<div class="
row
">
<div class="
col
-
sm
-
5
">
<div class="
col
-
sm
-
5
">
<label>Nome Completo*</label>
<label>Nome Completo*</label>
...
@@ -351,11 +356,10 @@
...
@@ -351,11 +356,10 @@
</div>
</div>
</div>
</div>
</div>
</div>
@else
@endfor
<div id="
novoParticipante
" style="
display
:
none
;
">
{
{old('divParticipante')}
}
</div>
@endif
@endif
</div>
</div>
<input type="
hidden
" name="
div
Participante
" id="
div
Participante
" value="
{{
old
(
'
div
Participante'
)}}
"></input>
<input type="
hidden
" name="
count
Participante
" id="
count
Participante
" value="
{{
old
(
'
countParticipante'
)
!=
null
?
old
(
'count
Participante'
)
:
1
}}
"></input>
<a href="
#" class="btn btn-primary" id="addCoautor" style="width:100%;margin-top:10px">Participantes +</a>
<a href="
#" class="btn btn-primary" id="addCoautor" style="width:100%;margin-top:10px">Participantes +</a>
</
div
>
</
div
>
</
div
>
</
div
>
...
@@ -391,42 +395,17 @@
...
@@ -391,42 +395,17 @@
e
.
preventDefault
();
e
.
preventDefault
();
linha
=
montarLinhaInput
();
linha
=
montarLinhaInput
();
$
(
'#participantes'
)
.
append
(
linha
);
$
(
'#participantes'
)
.
append
(
linha
);
setParticipanteDiv
(
qtdParticipantes
);
qtdParticipantes
++
;
qtdParticipantes
++
;
setParticipanteDiv
();
}
}
});
});
function
setParticipanteDiv
(){
function
setParticipanteDiv
(
qtdParticipante
){
var
participantes
=
document
.
getElementById
(
'participantes'
);
var
countParticipante
=
document
.
getElementById
(
'countParticipante'
);
var
novoParticipante
=
document
.
getElementById
(
'novoParticipante'
);
countParticipante
.
value
=
qtdParticipante
;
var
divParticipante
=
document
.
getElementById
(
'divParticipante'
);
//console.log(participantes.innerHTML);
if
(
novoParticipante
.
style
.
display
==
'block'
){
console
.
log
(
'block'
);
divParticipante
.
value
=
participantes
.
innerHTML
;
}
else
{
console
.
log
(
'none'
);
participantes
.
innerHTML
=
divParticipante
.
value
;
}
}
function
getParticipanteDiv
(){
var
oldNovoParticipante
=
document
.
getElementById
(
'oldNovoParticipante'
);
var
participantes
=
document
.
getElementById
(
'participantes'
);
var
divParticipante
=
document
.
getElementById
(
'divParticipante'
);
// console.log(participantes.innerHTML);
if
(
novoParticipante
.
style
.
display
==
'none'
){
console
.
log
(
'none'
);
participantes
.
innerHTML
=
divParticipante
.
value
;
}
else
{
console
.
log
(
'block'
);
}
}
}
//window.onload = setParticipanteDiv();
window
.
onload
=
getParticipanteDiv
();
$
(
'#addPlanoTrabalho'
)
.
click
(
function
(
e
)
{
$
(
'#addPlanoTrabalho'
)
.
click
(
function
(
e
)
{
e
.
preventDefault
();
e
.
preventDefault
();
if
(
qtdLinhas
<
4
)
{
if
(
qtdLinhas
<
4
)
{
...
@@ -444,6 +423,7 @@
...
@@ -444,6 +423,7 @@
$
(
document
)
.
on
(
'click'
,
'.delete'
,
function
()
{
$
(
document
)
.
on
(
'click'
,
'.delete'
,
function
()
{
if
(
qtdParticipantes
>
2
)
{
if
(
qtdParticipantes
>
2
)
{
qtdParticipantes
--
;
qtdParticipantes
--
;
setParticipanteDiv
(
qtdParticipantes
-
1
);
$
(
this
)
.
closest
(
'#novoParticipante'
)
.
remove
();
$
(
this
)
.
closest
(
'#novoParticipante'
)
.
remove
();
return
false
;
return
false
;
}
}
...
...
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