src/Flexy/FrontBundle/Themes/Lasalle/templates/admin/shopadmin/order/new.html.twig line 1

  1. {# @var ea \EasyCorp\Bundle\EasyAdminBundle\Context\AdminContext #}
  2. {# @var entity \EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto #}
  3. {% extends ea.templatePath('layout') %}
  4. {% form_theme new_form with ea.crud.formThemes only %}
  5. {% trans_default_domain ea.i18n.translationDomain %}
  6. {% block body_id 'ea-new-' ~ entity.name %}
  7. {% block body_class 'ea-new ea-new-' ~ entity.name %}
  8. {% set ea_field_assets = ea.crud.fieldAssets(constant('EasyCorp\\Bundle\\EasyAdminBundle\\Config\\Crud::PAGE_NEW')) %}
  9. {% block configured_head_contents %}
  10.     {{ parent() }}
  11.     {% for htmlContent in ea_field_assets.headContents %}
  12.         {{ htmlContent|raw }}
  13.     {% endfor %}
  14. {% endblock %}
  15. {% block configured_body_contents %}
  16.     {{ parent() }}
  17.     {% for htmlContent in ea_field_assets.bodyContents %}
  18.         {{ htmlContent|raw }}
  19.     {% endfor %}
  20. {% endblock %}
  21. {% block configured_stylesheets %}
  22.     {{ parent() }}
  23.     {{ include('@EasyAdmin/includes/_css_assets.html.twig', { assets: ea_field_assets.cssAssets }, with_context = false) }}
  24.     {{ include('@EasyAdmin/includes/_encore_link_tags.html.twig', { assets: ea_field_assets.webpackEncoreAssets }, with_context = false) }}
  25. {% endblock %}
  26. {% block content_title %}
  27.     {%- apply spaceless -%}
  28.         {% set custom_page_title = ea.crud.customPageTitle('new', null, ea.i18n.translationParameters) %}
  29.         {{ custom_page_title is null
  30.             ? ea.crud.defaultPageTitle('new', null, ea.i18n.translationParameters)|trans|raw
  31.             : custom_page_title|trans|raw }}
  32.     {%- endapply -%}
  33. {% endblock %}
  34. {% block page_actions %}
  35.     {% for action in entity.actions %}
  36.         {{ include(action.templatePath, { action: action }, with_context = false) }}
  37.     {% endfor %}
  38. {% endblock %}
  39. {% block main %}
  40.     {% block new_form %}
  41.         {{ form(new_form) }}
  42.     {% endblock new_form %}
  43. {% endblock %}
  44. {% block body_javascript %}
  45. {{parent()}}
  46. <script>
  47. document.addEventListener('turbo:load', function(event) {
  48.  $("body").on("change","select[name$='[paymentMethod]']",function(){
  49.     var checkFields = $(this).parent().parent().parent().parent().parent().parent().find(".check-field");
  50.     if($(this).find("option:selected").text() == "Cheque"){
  51.         $(checkFields).removeClass("d-none");
  52.     }else{
  53.         $(checkFields).addClass("d-none");
  54.     }
  55.     
  56.  }
  57.  );
  58.   });
  59. </script>
  60. {% endblock %}