templates/variation/list.html.twig line 1

Open in your IDE?
  1. {% extends 'layouts/report.html.twig' %}
  2. {% block title %}Domain Variations{% endblock %}
  3. {% block report_content %}
  4.     <div class="row mb-4">
  5.         <div class="col-12 js_message_alert_report text-center">
  6.             {% for msg in app.session.flashbag.get('notification-success') %}
  7.                 <div class="alert alert-success col-md-12" role="alert">
  8.                     {{ msg }}
  9.                 </div>
  10.             {% endfor %}
  11.         </div>
  12.     </div>
  13.     <div class="row mb-4 js-actions-bar">
  14.         <div class="col-12 text-right">
  15.             <a class="btn btn-primary" href="{{ path('variation_new') }}" title="New Domain Variation">+ New</a>
  16.         </div>
  17.     </div>
  18.     <div class="row">
  19.         <div class="col-12">
  20.             <table class="table table-striped display dt-responsive overflow-auto" id="reportTable" width="100%"
  21.                    data-opsui-base-url="{{ opsui_base_url }}">
  22.                 <thead>
  23.                 <tr>
  24.                     <th scope="col">Id</th>
  25.                     <th scope="col">Domain Pools</th>
  26.                     <th scope="col">Created</th>
  27.                     <th scope="col">Updated</th>
  28.                     <th scope="col">Actions</th>
  29.                 </tr>
  30.                 </thead>
  31.                 <tbody>
  32.                 {% if lstVariations is empty %}
  33.                     <tr>
  34.                         <th colspan="8">There are no variations.</th>
  35.                     </tr>
  36.                 {% endif %}
  37.                 {% for variation in lstVariations %}
  38.                     <tr>
  39.                         <td class="align-middle">{{ variation.id }}</td>
  40.                         <td class="align-middle text-truncate">
  41.                             <ul>
  42.                                 {% for domain in variation.domainPool %}
  43.                                     <li>{{ domain }}</li>
  44.                                 {% endfor %}
  45.                             </ul>
  46.                         </td>
  47.                         <td class="align-middle">{{ variation.created|date("Y-m-d H:i:s T") }}</td>
  48.                         <td class="align-middle">{{ variation.updated|date("Y-m-d H:i:s T") }}</td>
  49.                         <td class="align-middle">
  50.                             <a class="btn btn-primary" href="{{ path('variation_edit', {id: variation.id}) }}"
  51.                                title="Edit Variation">Edit</a>
  52.                             <a class="btn btn-danger" title="Delete Variation"
  53.                                onclick="onDeleteButtonClicked({{ variation.id }})">Delete</a>
  54.                         </td>
  55.                     </tr>
  56.                 {% endfor %}
  57.                 </tbody>
  58.             </table>
  59.         </div>
  60.     </div>
  61.     <div class="modal modal-confirm-delete" tabindex="-1" role="dialog">
  62.         <div class="modal-dialog" role="document">
  63.             <div class="modal-content">
  64.                 <div class="modal-header">
  65.                     <h5 class="modal-title">Confirm Deletion</h5>
  66.                     <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  67.                         <span aria-hidden="true">&times;</span>
  68.                     </button>
  69.                 </div>
  70.                 <div class="modal-body">
  71.                     <p>Do you want to delete?</p>
  72.                 </div>
  73.                 <div class="modal-footer">
  74.                     <form action="delete" method="post">
  75.                         <input type="hidden" name="variationId" id="variationId"/>
  76.                         <button type="submit" class="btn btn-danger">Confirm</button>
  77.                         <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
  78.                     </form>
  79.                 </div>
  80.             </div>
  81.         </div>
  82.     </div>
  83.     <script>
  84.         $(document).ready(function () {
  85.             //Initialize DataTables, with no sorting on the 'details' column
  86.             $('table#reportTable').DataTable({
  87.                 paging: true,
  88.                 columns: [
  89.                     {"name": "id", orderable: true},
  90.                     {"name": "domainPool", searchable: true, orderable: true},
  91.                     {"name": "created", searchable: false, orderable: true},
  92.                     {"name": "updated", searchable: false, orderable: true},
  93.                     {"name": "action"}
  94.                 ]
  95.             });
  96.         });
  97.         function onDeleteButtonClicked(id) {
  98.             $('input#variationId').val(id);
  99.             $('div.modal-confirm-delete').modal();
  100.         }
  101.     </script>
  102. {% endblock %}