templates/CRUD/list__action_database.html.twig line 1

Open in your IDE?
  1. {% block field %}
  2.     {% if object.isDbSet %}
  3.         <a class="btn btn-sm btn-default bg-info" href="{{ admin.generateObjectUrl('db_export', object) }}"><i class="fa fa-database" aria-hidden="true">&nbsp;</i><i class="fa fa-arrow-right" aria-hidden="true">&nbsp;</i>DB Export</a>
  4.         <select class="import_version" data-id="{{ object.id }}" id="import_version_{{ object.id }}">
  5.             <option value="-" readonly selected>Válassz verziót!</option>
  6.                 <optgroup label="Project SQLs">
  7.                     {% for value in object.getProject.getDbImpExps %}
  8.                         <option value="{{ value.id }}">
  9.                             {{ value.getFileName }}
  10.                             {% if value.getNote is not empty %}
  11.                                 ({{ value.getNote }})
  12.                             {% endif %}
  13.                         </option>
  14.                     {% endfor %}
  15.                 </optgroup>
  16.                 <optgroup label="Global SQLs">
  17.                     {% for value in admin.globalDbExports %}
  18.                         <option value="{{ value.id }}">
  19.                             {{ value.getFileName }}
  20.                             {% if value.getNote is not empty %}
  21.                                 ({{ value.getNote }})
  22.                             {% endif %}
  23.                         </option>
  24.                     {% endfor %}
  25.                 </optgroup>
  26.         </select>
  27.         <a class="btn btn-sm btn-default bg-success" id="import_button_{{ object.id }}" data-url="{{ admin.generateObjectUrl('db_import', object, {"version":""}) }}" href="#" disabled><i class="fa fa-database" aria-hidden="true">&nbsp;</i><i class="fa fa-arrow-left" aria-hidden="true">&nbsp;</i>DB Import</a>
  28.     
  29.             <a class="btn btn-sm btn-default bg-success" id="import_language_button_{{ object.id }}" data-url="{{ admin.generateObjectUrl('db_language_import', object, {"language":""}) }}" href="#" disabled><i class="fa fa-database" aria-hidden="true">&nbsp;</i><i class="fa fa-arrow-left" aria-hidden="true">&nbsp;</i>Import Language</a>
  30.         <a><select class="import_language" data-id="{{ object.id }}" id="import_language_{{ object.id }}">
  31.             <option value="-" readonly selected>Válassz Nyelvet!</option>
  32.                 <optgroup label="Project_Language">
  33.                         <option value="UA">UA</option>
  34.                     
  35.                 </optgroup>
  36.         </select></a>
  37.     
  38.     {% endif %}
  39. {% endblock %}
  40. {% block javascripts %}
  41.     <script type="text/javascript">
  42.         $( document ).ready(function() {
  43.             $("#import_version_{{ object.id }}").change(function() {
  44.                 if($(this).val() != "-") {
  45.                     button = $("#import_button_"+$(this).attr("data-id"));
  46.                     url = button.attr("data-url");
  47.                     button.attr("href", url+$(this).val());
  48.                     button.removeAttr("disabled");
  49.                 } else {
  50.                     button = $("#import_button_"+$(this).attr("data-id"));
  51.                     button.attr("href", "#");
  52.                     button.attr("disabled", true);
  53.                 }
  54.             });
  55.             if($("#import_version_{{ object.id }}").val() != "-") {
  56.                 $("#import_version_{{ object.id }}").trigger("change");
  57.             }
  58.             
  59.             $("#import_language_{{ object.id }}").change(function() {
  60.                 if($(this).val() != "-") {
  61.                     button = $("#import_language_button_"+$(this).attr("data-id"));
  62.                     url = button.attr("data-url");
  63.                     button.attr("href", url+$(this).val());
  64.                     button.removeAttr("disabled");
  65.                 } else {
  66.                     button = $("#import_language_button_"+$(this).attr("data-id"));
  67.                     button.attr("href", "#");
  68.                     button.attr("disabled", true);
  69.                 }
  70.             });
  71.             if($("#import_language_{{ object.id }}").val() != "-") {
  72.                 $("#import_language_{{ object.id }}").trigger("change");
  73.             }
  74.             
  75.         });
  76.     </script>
  77. {% endblock %}