grading.html.twig 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. {% if grading_electronic.show %}
  2. <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modal-grading-electronic">
  3. {{ 'GenerateFile'|get_plugin_lang('GradingElectronicPlugin') }}
  4. </button>
  5. <div class="modal fade" id="modal-grading-electronic" tabindex="-1" role="dialog"
  6. aria-labelledby="modal-grading-electronic-title">
  7. <div class="modal-dialog" role="document">
  8. <div class="modal-content">
  9. <div class="modal-header">
  10. <button type="button" class="close" data-dismiss="modal" aria-label="{{ 'Close'|get_lang }}">
  11. <span aria-hidden="true">&times;</span>
  12. </button>
  13. <h4 class="modal-title" id="modal-grading-electronic-title">
  14. {{ 'plugin_title'|get_plugin_lang('GradingElectronicPlugin') }}
  15. </h4>
  16. </div>
  17. <div class="modal-body">
  18. {{ grading_electronic.form.display() }}
  19. <div id="modal-grading-electronic-result" class="text-center"></div>
  20. </div>
  21. </div>
  22. </div>
  23. </div>
  24. <script>
  25. $(function () {
  26. $('form[name="frm_grading_electronic"]').on('submit', function (e) {
  27. e.preventDefault();
  28. var $self = $(this);
  29. $.post('{{ _p.web_plugin }}grading_electronic/generate.php', $self.serialize())
  30. .done(function (response) {
  31. $('#modal-grading-electronic-result').html(
  32. response
  33. );
  34. });
  35. });
  36. });
  37. </script>
  38. {% endif %}