templates/adserver/list.html.twig line 1

Open in your IDE?
  1. {% extends 'layouts/report.html.twig' %}
  2. {% block title %}Ad Server Mapping{% 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('server_mapping_new') }}" title="New Mapping">+ 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</th>
  26.                     <th scope="col">Ad Server</th>
  27.                     <th scope="col">Actions</th>
  28.                 </tr>
  29.                 </thead>
  30.                 <tbody>
  31.                 {% if lstMapping is empty %}
  32.                     <tr>
  33.                         <th colspan="8">There are no endpoints.</th>
  34.                     </tr>
  35.                 {% endif %}
  36.                 {% for mapping in lstMapping %}
  37.                     <tr>
  38.                         <td class="align-middle">{{ mapping.id }}</td>
  39.                         <td class="align-middle text-truncate">{{ mapping.domain }}</td>
  40.                         <td class="align-middle text-truncate">{{ mapping.adServer }}</td>
  41.                         <td class="align-items-end">
  42.                             <a class="btn btn-primary" href="{{ path('server_mapping_edit', {id: mapping.id}) }}"
  43.                                title="Edit Mapping">Edit</a>
  44.                             <a class="btn btn-danger" title="Delete Mapping"
  45.                                onclick="onDeleteButtonClicked({{ mapping.id }})">Delete</a>
  46.                         </td>
  47.                     </tr>
  48.                 {% endfor %}
  49.                 </tbody>
  50.             </table>
  51.         </div>
  52.     </div>
  53.     <div class="modal modal-confirm-delete" tabindex="-1" role="dialog">
  54.         <div class="modal-dialog" role="document">
  55.             <div class="modal-content">
  56.                 <div class="modal-header">
  57.                     <h5 class="modal-title">Confirm Deletion</h5>
  58.                     <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  59.                         <span aria-hidden="true">&times;</span>
  60.                     </button>
  61.                 </div>
  62.                 <div class="modal-body">
  63.                     <p>Do you want to delete?</p>
  64.                 </div>
  65.                 <div class="modal-footer">
  66.                     <form action="delete" method="post">
  67.                         <input type="hidden" name="mappingId" id="mappingId"/>
  68.                         <button type="submit" class="btn btn-danger">Confirm</button>
  69.                         <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
  70.                     </form>
  71.                 </div>
  72.             </div>
  73.         </div>
  74.     </div>
  75.     <script>
  76.         $(document).ready(function () {
  77.             //Initialize DataTables, with no sorting on the 'details' column
  78.             $('table#reportTable').DataTable({
  79.                 paging: true,
  80.                 columns: [
  81.                     {"name": "id", orderable: true},
  82.                     {"name": "domain", searchable: true, orderable: true},
  83.                     {"name": "adserver", searchable: true, orderable: true},
  84.                     {"name": "action"}
  85.                 ]
  86.             });
  87.         });
  88.         function onDeleteButtonClicked(id) {
  89.             $('input#mappingId').val(id);
  90.             $('div.modal-confirm-delete').modal();
  91.         }
  92.     </script>
  93. {% endblock %}