app/Plugin/NZCustomPlugin/Resource/template/admin/list.twig line 1

Open in your IDE?
  1. {% extends '@admin/default_frame.twig' %}
  2. {% block title %}カスタムフォーム一覧{% endblock %}
  3. {% block sub_title %}カスタムフォーム管理{% endblock %}
  4. {% block main %}
  5. <div class="c-contentsArea__cols">
  6.     <div class="c-contentsArea__primaryCol">
  7.         <div class="c-primaryCol">
  8.             <div class="card rounded border-0 mb-4">
  9.                 <div class="card-header d-flex justify-content-between align-items-center">
  10.                     <span class="card-title">フォーム一覧</span>
  11.                     <a href="{{ url('nzcustomplugin_admin_new') }}" class="btn btn-ec-conversion btn-sm">
  12.                         <i class="fa fa-plus"></i> 新規作成
  13.                     </a>
  14.                 </div>
  15.                 <div class="card-body p-0">
  16.                     {% if forms|length > 0 %}
  17.                     <table class="table mb-0">
  18.                         <thead>
  19.                             <tr>
  20.                                 <th>ID</th>
  21.                                 <th>フォーム名</th>
  22.                                 <th>フォームキー</th>
  23.                                 <th>状態</th>
  24.                                 <th>更新日時</th>
  25.                                 <th style="width: 350px;">操作</th>
  26.                             </tr>
  27.                         </thead>
  28.                         <tbody>
  29.                             {% for form in forms %}
  30.                             <tr>
  31.                                 <td>{{ form.id }}</td>
  32.                                 <td>{{ form.name }}</td>
  33.                                 <td><code>{{ form.formKey }}</code></td>
  34.                                 <td>
  35.                                     {% if form.isActive %}
  36.                                     <span class="badge badge-success">有効</span>
  37.                                     {% else %}
  38.                                     <span class="badge badge-secondary">無効</span>
  39.                                     {% endif %}
  40.                                 </td>
  41.                                 <td>{{ form.updateDate|date('Y/m/d H:i') }}</td>
  42.                                 <td>
  43.                                     <a href="{{ url('nzcustomplugin_form_display', {'key': form.formKey}) }}" 
  44.                                        class="btn btn-sm btn-outline-primary" 
  45.                                        target="_blank"
  46.                                        title="プレビュー">
  47.                                         <i class="fa fa-eye"></i>
  48.                                     </a>
  49.                                     <a href="{{ url('nzcustomplugin_admin_edit', {'id': form.id}) }}" 
  50.                                        class="btn btn-sm btn-primary" 
  51.                                        style="color: white; margin-left: 5px;"
  52.                                        title="編集">
  53.                                         編集
  54.                                     </a>
  55.                                     <a href="{{ url('nzcustomplugin_admin_submissions', {'form_id': form.id}) }}" 
  56.                                        class="btn btn-sm btn-info" 
  57.                                        style="color: white; margin-left: 5px;"
  58.                                        title="送信データ">
  59.                                         送信データ
  60.                                     </a>
  61.                                     <form method="post" action="{{ url('nzcustomplugin_admin_duplicate', {'id': form.id}) }}" style="display:inline; margin-left: 5px;">
  62.                                         <input type="hidden" name="_token" value="{{ csrf_token('duplicate' ~ form.id) }}">
  63.                                         <button type="submit" class="btn btn-sm btn-success" style="color: white;" title="複製">
  64.                                             <i class="fa fa-copy"></i> 複製
  65.                                         </button>
  66.                                     </form>
  67.                                     <form method="post" action="{{ url('nzcustomplugin_admin_delete', {'id': form.id}) }}" style="display:inline; margin-left: 5px;" onsubmit="return confirm('このフォームを削除してもよろしいですか?');">
  68.                                         <input type="hidden" name="_token" value="{{ csrf_token('delete' ~ form.id) }}">
  69.                                         <button type="submit" class="btn btn-sm btn-danger" style="color: white;" title="削除">削除</button>
  70.                                     </form>
  71.                                 </td>
  72.                             </tr>
  73.                             {% endfor %}
  74.                         </tbody>
  75.                     </table>
  76.                     {% else %}
  77.                     <div class="text-center p-5 text-muted">
  78.                         フォームが登録されていません
  79.                     </div>
  80.                     {% endif %}
  81.                 </div>
  82.             </div>
  83.         </div>
  84.     </div>
  85. </div>
  86. {% endblock %}