app/Plugin/MypageFileupload42/Resource/template/admin/add_order_edit.twig line 1

Open in your IDE?
  1. {% set config = repository('Plugin\\MypageFileupload42\\Entity\\MypageFileupload42Config').get %}
  2. {% if config.mypage_fileupload_enable == 1 and Order.order_no is not empty %}
  3. {% block javascript %}
  4.     <script>
  5.         $(function() {
  6.             $('#mypage_fileupload_list_area').appendTo($('.c-contentsArea__cols .c-contentsArea__primaryCol .c-primaryCol'));
  7.         });
  8.     </script>
  9.     <script>
  10.         $(function() {
  11.             // 削除モーダルのhrefとmessageの変更
  12.             $('#DeleteModalFileupload').on('shown.bs.modal', function(event) {
  13.                 var target = $(event.relatedTarget);
  14.                 // hrefの変更
  15.                 $(this).find('[data-method="delete"]').attr('href', target.data('url'));
  16.                 // messageの変更
  17.                 $(this).find('p.modal-message').text(target.data('message'));
  18.             });
  19.         });
  20.     </script>
  21. {% endblock %}
  22.     <div id="mypage_fileupload_list_area">
  23.                     <div class="card rounded border-0 mb-4">
  24.                         <div class="card-header">
  25.                             <div class="row">
  26.                                 <div class="col-8">
  27.                                     <div class="d-inline-block"><span class="card-title">{{ 'アップロードファイル'|trans }}</div>
  28.                                 </div>
  29.                             </div>
  30.                         </div>
  31.                         <div class="collapse show ec-cardCollapse">
  32.                             <div class="card-body">
  33.                                 <div style="margin-bottom:10px;">
  34.                                     <a class="btn btn-ec-regular mr-2 add" href="{{ url('admin_order_mypage_fileupload_new', {order_no: Order.order_no}) }}">{{ '新規追加'|trans }}</a>
  35.                                 </div>
  36.                                 <table class="table table-striped">
  37.                                     <thead>
  38.                                         <tr id="mypage_fileupload_list__list_header">
  39.                                             <th id="mypage_fileupload_list__header_mypage_fileupload_no">{{ 'No.'|trans }}</th>
  40.                                             <th id="mypage_fileupload_list__header_mypage_fileupload_name">{{ 'ファイル名'|trans }}</th>
  41.                                             <th id="mypage_fileupload_list__header_mypage_fileupload_date">{{ '登録日・更新日'|trans }}</th>
  42.                                             <th id="mypage_fileupload_list__header_mypage_fileupload_first">{{ '初期送信'|trans }}</th>
  43.                                             <th id="mypage_fileupload_list__header_mypage_fileupload_menu">{{ '編集'|trans }}</th>
  44.                                             <th id="mypage_fileupload_list__header_mypage_fileupload_delete">{{ '削除'|trans }}</th>
  45.                                         </tr>
  46.                                     </thead>
  47.                                     <tbody>
  48.                                         {% for MypageFileupload42 in MypageFileupload42s %}
  49.                                         {% if Order.order_no == MypageFileupload42.order_no %}
  50.                                             <tr id="mypage_fileupload_list__item--{{ MypageFileupload42.Id }}">
  51.                                                 <td>
  52.                                                     {{ MypageFileupload42.Id }}
  53.                                                 </td>
  54.                                                 <td>
  55.                                                     <a href="{{ asset(MypageFileupload42.mypage_fileupload_image, 'save_image') }}" target="_blank">{{ MypageFileupload42.mypage_fileupload_image }}</a>
  56.                                                 </td>
  57.                                                 <td>
  58.                                                     {{ '登録日'|trans }}:{{ MypageFileupload42.create_date|date("Y/m/d H:i:s") }}
  59.                                                     {% if MypageFileupload42.create_date != MypageFileupload42.update_date %}
  60.                                                     <br />
  61.                                                     {{ '更新日'|trans }}:{{ MypageFileupload42.update_date|date("Y/m/d H:i:s") }}
  62.                                                     {% endif %}
  63.                                                 </td>
  64.                                                 <td>
  65.                                                     {% if MypageFileupload42.fixed == 2 %}
  66.                                                         {{ '管理画面'|trans }}
  67.                                                     {% elseif MypageFileupload42.fixed == 3 %}
  68.                                                         {{ 'マイページ'|trans }}
  69.                                                     {% endif %}
  70.                                                 </td>
  71.                                                 <td>
  72.                                                     <a class="ec-inlineBtn" href="{{ url('admin_order_mypage_fileupload', {id: MypageFileupload42.Id}) }}">{{ '編集'|trans }}</a>
  73.                                                 </td>
  74.                                                 <td>
  75.                                                     <a class="btn btn-ec-actionIcon" data-bs-toggle="modal" data-bs-target="#DeleteModalFileupload" data-url="{{ url('admin_order_mypage_fileupload_delete', {'id' : MypageFileupload42.id}) }}" data-message="{{ 'admin.common.delete_modal__message'|trans({ "%name%" : MypageFileupload42.mypage_fileupload_image }) }}"> <i class="fa fa-close fa-lg text-secondary"></i>
  76.                                                     </a>
  77.                                                 </td>
  78.                                             </tr>
  79.                                         {% endif %}
  80.                                         {% endfor %}
  81.                                     </tbody>
  82.                                 </table>
  83.                             </div>
  84.                         </div>
  85.                         <!-- 削除モーダル -->
  86.                         <div class="modal fade" id="DeleteModalFileupload" tabindex="-1" role="dialog"
  87.                              aria-labelledby="DeleteModalFileupload" aria-hidden="true">
  88.                             <div class="modal-dialog" role="document">
  89.                                 <div class="modal-content">
  90.                                     <div class="modal-header">
  91.                                         <h5 class="modal-title fw-bold">
  92.                                             {{ 'admin.common.delete_modal__title'|trans }}
  93.                                         </h5>
  94.                                         <button class="btn-close" type="button" data-bs-dismiss="modal" aria-label="Close">
  95.                                             
  96.                                         </button>
  97.                                     </div>
  98.                                     <div class="modal-body text-start">
  99.                                         <p class="text-start modal-message"><!-- jsでメッセージを挿入 --></p>
  100.                                     </div>
  101.                                     <div class="modal-footer">
  102.                                         <button class="btn btn-ec-sub" type="button" data-bs-dismiss="modal">
  103.                                             {{ 'admin.common.cancel'|trans }}
  104.                                         </button>
  105.                                         <a class="btn btn-ec-delete" href="#" {{ csrf_token_for_anchor() }}
  106.                                            data-method="delete" data-confirm="false">
  107.                                             {{ 'admin.common.delete'|trans }}
  108.                                         </a>
  109.                                     </div>
  110.                                 </div>
  111.                             </div>
  112.                         </div>
  113.                     </div>
  114.     </div>
  115. {% endif %}