Unverified Commit 15cf9630 authored by Yuri Resende's avatar Yuri Resende Committed by GitHub
Browse files

Merge pull request #811 from yuriresendematias/master

Desabilitando botão de rascunho
parents 21ec8dc1 1bf7470a
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<div class=" d-flex justify-content-between align-items-center" style="margin-top: 15px; margin-bottom:18px"> <div class=" d-flex justify-content-between align-items-center" style="margin-top: 15px; margin-bottom:18px">
<h6 style="font-weight: bold"><span style="color: red; font-weight:bold">*</span> Campos obrigatórios</h6> <h6 style="font-weight: bold"><span style="color: red; font-weight:bold">*</span> Campos obrigatórios</h6>
<button id="submeterFormProposta" type="submit" style="display: none;"></button> <button id="submeterFormProposta" type="submit" style="display: none;"></button>
<button type="button" class="btn btn-primary " id="idButtonSubmitRascunho" >{{ __('Salvar como rascunho') }}</button> <!-- <button type="button" class="btn btn-primary " id="idButtonSubmitRascunho" >{{ __('Salvar como rascunho') }}</button> -->
<button type="submit" class="btn btn-success" id="idButtonSubmitProjeto" >{{ __('Submeter projeto') }}</button> <button type="submit" class="btn btn-success" id="idButtonSubmitProjeto" >{{ __('Submeter projeto') }}</button>
</div> </div>
......
...@@ -12,9 +12,9 @@ ...@@ -12,9 +12,9 @@
<button id="submeterFormProposta" type="submit" style="display: none;"></button> <button id="submeterFormProposta" type="submit" style="display: none;"></button>
<a href="{{ route('proponente.projetosEdital', ['id' => $edital->id])}}" class="btn btn-secondary">Cancelar</a> <a href="{{ route('proponente.projetosEdital', ['id' => $edital->id])}}" class="btn btn-secondary">Cancelar</a>
@if(Auth::user()->tipo != 'administrador') <!-- @if(Auth::user()->tipo != 'administrador')
<button type="submit" class="btn btn-primary " id="idButtonSubmitRascunho" >{{ __('Salvar como rascunho') }}</button> <button type="submit" class="btn btn-primary " id="idButtonSubmitRascunho" >{{ __('Salvar como rascunho') }}</button>
@endif @endif -->
<button type="submit" class="btn btn-success" id="idButtonSubmitProjeto" >{{ __('Submeter projeto') }}</button> <button type="submit" class="btn btn-success" id="idButtonSubmitProjeto" >{{ __('Submeter projeto') }}</button>
</div> </div>
@if($errors->any()) @if($errors->any())
......
...@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment