src/Eccube/Resource/template/admin/Order/mail.twig line 1

Open in your IDE?
  1. {#
  2. This file is part of EC-CUBE
  3. Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  4. http://www.ec-cube.co.jp/
  5. For the full copyright and license information, please view the LICENSE
  6. file that was distributed with this source code.
  7. #}
  8. {% extends '@admin/default_frame.twig' %}
  9. {% set menus = ['order', 'order_edit'] %}
  10. {% block title %}{{ 'admin.order.mail'|trans }}{% endblock %}
  11. {% block sub_title %}{{ 'admin.order.order_management'|trans }}{% endblock %}
  12. {% form_theme form '@admin/Form/bootstrap_4_horizontal_layout.html.twig' %}
  13. {% block javascript %}
  14. <script>
  15. $(function() {
  16.     $('#template-change').on('change', function() {
  17.         $('#mode').val('change');
  18.         $('#order-mail-form').submit();
  19.         return false;
  20.     });
  21.     ace.require('ace/ext/language_tools');
  22.     var editor = ace.edit('editor');
  23.     editor.session.setMode('ace/mode/twig');
  24.     editor.setTheme('ace/theme/tomorrow');
  25.     editor.setValue("{{ form.tpl_data.vars.value|escape('js') }}");
  26.     editor.setOptions({
  27.         enableBasicAutocompletion: true,
  28.         enableSnippets: true,
  29.         enableLiveAutocompletion: true,
  30.         showInvisibles: true
  31.     });
  32.     $('#order-mail-form').on('submit', function() {
  33.         $('#admin_order_mail_tpl_data').val(editor.getValue());
  34.     });
  35. });
  36. </script>
  37. {% endblock javascript %}
  38. {% block main %}
  39. <div class="c-contentsArea__cols">
  40.     <div class="c-contentsArea__primaryCol">
  41.         <div class="c-primaryCol">
  42.             <div class="card rounded border-0 mb-4">
  43.                 <div class="card-header">
  44.                     <div class="row">
  45.                         <div class="col-8">
  46.                             <div class="d-inline-block" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ 'tooltip.order.mail_destination_info'|trans }}"><span class="card-title">{{ 'admin.order.mail_destination_info'|trans }}</span><i class="fa fa-question-circle fa-lg ms-1"></i></div>
  47.                         </div>
  48.                         <div class="col-4 text-end"><a data-bs-toggle="collapse" href="#mailTo" aria-expanded="false" aria-controls="mailTo"><i class="fa fa-angle-up fa-lg"></i></a></div>
  49.                     </div>
  50.                 </div>
  51.                 <div class="collapse show ec-cardCollapse" id="mailTo">
  52.                     <div class="card-body">
  53.                         <div class="row mb-2">
  54.                             <div class="col-2"><span>{{ 'admin.order.order_no'|trans }}</span></div>
  55.                             <div class="col-4"><span>{{ Order.id }}</span></div>
  56.                             <div class="col-2"><span>{{ 'admin.order.purchase_price'|trans }}</span></div>
  57.                             <div class="col-4"><span>{{ Order.payment_total|price }}</span></div>
  58.                         </div>
  59.                         <div class="row mb-2">
  60.                             <div class="col-2"><span>{{ 'admin.order.orderer'|trans }}</span></div>
  61.                             <div class="col-4"><span>{{ Order.name01 }} {{ Order.name02 }}({{ Order.kana01 }} {{ Order.kana02 }})</span><br>{{ 'admin.common.postal_symbol'|trans }}{{ Order.postal_code }}<br>{{ Order.pref }}{{ Order.addr01 }}{{ Order.addr02 }}</div>
  62.                             <div class="col-2"><span>{{ 'admin.order.purchase_product'|trans }}</span></div>
  63.                             <div class="col-4"><span>
  64.                             {% if Order.productOrderItems %}
  65.                                 {{ Order.productOrderItems[0].productName }}
  66.                                 {% if Order.productOrderItems|length > 2 %}
  67.                                     {{ 'admin.order.mail_purchase_product_count'|trans({'%count%':Order.productOrderItems|length - 1})|raw }}
  68.                                 {% endif %}
  69.                             {% endif %}
  70.                             </span></div>
  71.                         </div>
  72.                         <div class="row">
  73.                             <div class="col-2"><span>{{ 'admin.order.order_status'|trans }}</span></div>
  74.                             <div class="col-10"><span class="badge badge-ec-blue" style="background-color: #fff; color: {{ Order.OrderStatusColor }}; border-color: {{ Order.OrderStatusColor }}">{{ Order.OrderStatus }}</span></div>
  75.                         </div>
  76.                     </div>
  77.                 </div>
  78.             </div>
  79.             <form id="order-mail-form" class="form-horizontal" method="post" action="{{ url('admin_order_mail', {id : Order.id}) }}">
  80.                 {{ form_widget(form._token) }}
  81.                 <input id="mode" type="hidden" name="mode">
  82.                 <div class="card rounded border-0 mb-4">
  83.                 <div class="card-header">
  84.                     <div class="row">
  85.                         <div class="col-8"><span class="card-title">{{ 'admin.order.mail_mail_info'|trans }}</span></div>
  86.                         <div class="col-4 text-end"><a data-bs-toggle="collapse" href="#mailCreate" aria-expanded="false" aria-controls="mailCreate"><i class="fa fa-angle-up fa-lg"></i></a></div>
  87.                     </div>
  88.                 </div>
  89.                 <div class="collapse show ec-cardCollapse" id="mailCreate">
  90.                     <div class="card-body">
  91.                         <div class="row mb-2">
  92.                             <div class="col-3">
  93.                                 <div class="d-inline-block" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ 'tooltip.order.mail_template'|trans }}">
  94.                                     <span>{{ 'admin.order.mail_template'|trans }}</span><i class="fa fa-question-circle fa-lg ms-1"></i>
  95.                                 </div>
  96.                             </div>
  97.                             <div class="col">
  98.                                 {{ form_widget(form.template, {'id': 'template-change'}) }}
  99.                                 {{ form_errors(form.template) }}
  100.                             </div>
  101.                         </div>
  102.                         <div class="row mb-2">
  103.                             <div class="col-3">
  104.                                 <div class="d-inline-block" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ 'tooltip.order.mail_subject'|trans }}">
  105.                                     <span>{{ 'admin.order.mail_subject'|trans }}</span><i class="fa fa-question-circle fa-lg ms-1"></i>
  106.                                 </div>
  107.                                 <span class="badge bg-primary ms-1">{{ 'admin.common.required'|trans }}</span>
  108.                             </div>
  109.                             <div class="col">
  110.                                 {{ form_widget(form.mail_subject) }}
  111.                                 {{ form_errors(form.mail_subject) }}
  112.                             </div>
  113.                         </div>
  114.                         <div class="row mb-2">
  115.                             <div class="col-3"><span>{{ 'admin.order.mail_body'|trans }}</span></div>
  116.                             <div class="col">
  117.                                 <div id="detail_box__tpl_data" class="mb-3 tab-pane active">
  118.                                     {{ form_label(form.tpl_data) }}
  119.                                     <div id="editor" style="height: 480px" class="form-control{{ has_errors(form.tpl_data) ? ' is-invalid' }}"></div>
  120.                                     <div style="display: none">{{ form_widget(form.tpl_data) }}</div>
  121.                                     {{ form_errors(form.tpl_data) }}
  122.                                 </div>
  123.                             </div>
  124.                         </div>
  125.                     </div>
  126.                 </div>
  127.             </div>
  128.                 <div class="c-conversionArea">
  129.                     <div class="c-conversionArea__container">
  130.                         <div class="row justify-content-between align-items-center">
  131.                             <div class="col-6">
  132.                                 <div class="c-conversionArea__leftBlockItem"><a class="c-baseLink" href="{{ url('admin_order_edit', { id: Order.id }) }}"><i class="fa fa-backward" aria-hidden="true"></i><span>{{ 'admin.order.order_registration'|trans }}</span></a>
  133.                                 </div>
  134.                             </div>
  135.                             <div class="col-6">
  136.                                 <div class="row align-items-center justify-content-end">
  137.                                     <div class="col-auto">
  138.                                         <button type="submit" class="btn btn-ec-conversion px-5" name="mode" value="confirm">{{ 'admin.order.mail_confirm'|trans }}</button>
  139.                                     </div>
  140.                                 </div>
  141.                             </div>
  142.                         </div>
  143.                     </div>
  144.                 </div>
  145.             </form>
  146.         </div>
  147.     </div>
  148. </div>
  149. {% endblock %}