X-Git-Url: http://mmka.chem.univ.gda.pl/gitweb/?a=blobdiff_plain;f=qcg%2Ftemplates%2Fqcg%2Fjob_submit.html;h=87b8a2c4d827ff9f1fd14a36ca7df04bb6186663;hb=5d89371016f27ca592862971f0e4c56a32c497bd;hp=5fabdc0bef4b242c881e637049a6bc6d7caae475;hpb=a48622a1086a47a1abc26dcd3d1d05a384eb1e8f;p=qcg-portal.git diff --git a/qcg/templates/qcg/job_submit.html b/qcg/templates/qcg/job_submit.html index 5fabdc0..87b8a2c 100644 --- a/qcg/templates/qcg/job_submit.html +++ b/qcg/templates/qcg/job_submit.html @@ -131,34 +131,14 @@ }); $('#template').on('show.bs.modal', function() { - $(this).find('.alert').remove(); this.reset(); }).on('shown.bs.modal', function() { $(this).find('input[type="text"]')[0].focus(); }).on('submit', function(e) { e.preventDefault(); - var $this = $(this), - $btn = $this.find('[type="submit"]'); - - $this.find('.alert-danger').remove(); - $btn.button('loading'); - - $.post(this.action, $('#description,#template').serializeArray(), function(response) { - // FIXME url after redirection - document.open(); - document.write(response); - document.close(); - }).fail(function(xhr) { - var error = (xhr.responseJSON || {}).error || 'Błąd serwera'; - - $('
', { - 'class': 'alert alert-danger', - html: ' ' + error - }).prependTo($this.find('.modal-body')); - - $btn.button('reset'); - }); + // copy this form's fields to description form and send it + $('#description').append($(this).find('input').clone().attr('type', 'hidden')).submit(); }); }); @@ -398,8 +378,8 @@