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=560bd99c70e27ef8aeda8d80abafa378f3e70608;hpb=efdba7ecadc632e65fb58aa819964335dffd56a1;p=qcg-portal.git diff --git a/qcg/templates/qcg/job_submit.html b/qcg/templates/qcg/job_submit.html index 560bd99..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(); }); });