commit b3c57a7c68f475e8bf254cab82a230855d58362e
Author: cagy <ml.cagy@seznam.cz>
Date:   Mon May 4 11:13:04 2020 +0200

    re #7970 added confirmation before assembly delete. Srcipts moved from templates to separated files

diff --git a/src/main/webapp/WEB-INF/templates/assembly.html b/src/main/webapp/WEB-INF/templates/assembly.html
index 6a10178a..9712c255 100644
--- a/src/main/webapp/WEB-INF/templates/assembly.html
+++ b/src/main/webapp/WEB-INF/templates/assembly.html
@@ -262,164 +262,4 @@
 <script type="text/javascript">
     $("select").selectpicker();
 </script>
-<script>
-    $(document).ready(function() {
-
-        $('.select-action-button').on('click', function () {
-            if ($(this).hasClass('select-action-headlight'))
-            {
-                $(this).removeClass('select-action-headlight');
-                removeParameter(getParameterTitle($(this)), getParameterType($(this)));
-            }
-            else
-            {
-                $(this).closest('.select-action-buttons').find('.select-action-button').removeClass('select-action-headlight');
-
-                removeFromAll(getParameterTitle($(this)));
-
-                $(this).addClass('select-action-headlight');
-
-                addParameter(getParameterIndex($(this)),
-                             getParameterTitle($(this)),
-                             getParameterType($(this)),
-                             getParameterHiddenValue($(this)));
-
-                initParameters();
-            }
-        });
-
-        initParameters();
-
-    });
-
-    function removeFromAll(title) {
-        $rows = $('.selected-input-container');
-
-        $rows.each(function () {
-            $(this).find('.parameter-name').each(function () {
-                if ($(this).text() == title)
-                {
-                    $(this).closest('.parameter').remove();
-                }
-            })
-        });
-    }
-
-    function getParameterIndex(button) {
-        return $(button).closest('.parameter-row').find('.parameterIndex').val();
-    }
-
-    function addParameter(index, parameterName, type, hiddenValue) {
-        var row = document.createElement('tr');
-        row.classList.add(type + '-parameter', 'parameter');
-
-        let hiddenInput = document.createElement('input');
-        hiddenInput.type = 'hidden';
-        hiddenInput.id = `parametersInConfiguration${index}.location.id`;
-        hiddenInput.name = `parametersInConfiguration[${index}].location.id`;
-        hiddenInput.value = hiddenValue;
-
-        row.appendChild(hiddenInput);
-
-        var firstTd = document.createElement('td');
-
-        var firstTdBody = document.createElement('span');
-        firstTdBody.classList.add('parameter-name');
-        firstTdBody.innerHTML = parameterName;
-
-        firstTd.appendChild(firstTdBody);
-
-        row.appendChild(firstTd);
-
-        var thirdTd = document.createElement('td');
-
-        var thirdTdBody;
-
-
-        if (type == 'value')
-        {
-            thirdTdBody = $('#function-select-' + index).clone()[0];
-
-            $(thirdTdBody).removeClass('hidden');
-        }
-        else
-        {
-            var secondTd = document.createElement('td');
-
-            var secondTdBody = document.createElement('input');
-            secondTdBody.type = 'text';
-            secondTdBody.classList.add('form-control', 'select-filter-input-name');
-            secondTdBody.name = `parametersInConfiguration[${index}].columnName`;
-
-            secondTd.appendChild(secondTdBody);
-
-            row.appendChild(secondTd);
-
-            thirdTdBody = document.createElement('span');
-            thirdTdBody.innerHTML = "<i class=\"fas fa-sort\"></i>";
-        }
-
-        thirdTd.appendChild(thirdTdBody);
-
-        row.appendChild(thirdTd);
-
-        $('#' + type + '-wrapper').append($(row));
-
-    }
-    
-    function removeParameter(title, parameterClass) {
-        $rows = $('.' + parameterClass + '-parameter');
-
-        $rows.each(function () {
-            $(this).find('.parameter-name').each(function () {
-                if ($(this).text() == title)
-                {
-                    $(this).closest('.' + parameterClass + '-parameter').remove();
-                }
-            })
-        });
-    }
-
-    function getParameterType(context) {
-        if ($(context).hasClass('column-button'))
-        {
-            return 'column';
-        }
-        else if ($(context).hasClass('row-button'))
-        {
-            return 'row';
-        }
-        else if ($(context).hasClass('value-button'))
-        {
-            return 'value';
-        }
-    }
-
-    function getParameterHiddenValue(context) {
-        if ($(context).hasClass('column-button'))
-        {
-            return 1;
-        }
-        else if ($(context).hasClass('row-button'))
-        {
-            return 2;
-        }
-        else if ($(context).hasClass('value-button'))
-        {
-            return 3;
-        }
-    }
-
-    function getParameterTitle(context) {
-        return $(context).closest('.parameter-row').find('.parameter-name').text();
-    }
-
-
-    function initParameters()
-    {
-        $('.sortable').sortable();
-        $("select").selectpicker('refresh');
-    }
-
-
-</script>
\ No newline at end of file
+<script ype="text/javascript" src="js/assemblyScripts.js"></script>
\ No newline at end of file
diff --git a/src/main/webapp/WEB-INF/templates/assembly_manage.html b/src/main/webapp/WEB-INF/templates/assembly_manage.html
index fe6e04af..b6aeb02b 100644
--- a/src/main/webapp/WEB-INF/templates/assembly_manage.html
+++ b/src/main/webapp/WEB-INF/templates/assembly_manage.html
@@ -237,328 +237,4 @@
 
 </script>
 
-<script type="text/javascript">
-
-  $(document).ready(function() {
-
-    $(".panel-wrapper").sortable({
-      stop: function(event, ui) {
-        reindexParametrOrder();
-      }
-    }).disableSelection();
-
-
-    $('.fa-trash-alt').click(function(event){
-      event.preventDefault();
-    });
-
-    $('#add-param-button').on('click', function () {
-      addCollapse();
-    });
-
-    reindexParametrOrder();
-    initPanelBody();
-
-  });
-
-  $('#permission-button').on('click', function () {
-    var selectedRoleId = $('select[name=permission-select] option').filter(':selected').val();
-    var selectedRoleValue = $('select[name=permission-select] option').filter(':selected').text();
-
-    var addedRoles = $('.permission-role');
-
-    var roles = [];
-
-    // get assigned roles
-    addedRoles.each(function () {
-      roles.push($(this).val())
-    });
-
-    if (roles.includes(selectedRoleId))
-    {
-      return;
-    }
-
-    addPermissionRow(selectedRoleId, selectedRoleValue);
-
-  });
-
-
-  function addPermissionRow(id, value){
-
-    let row = document.createElement('div');
-    row.classList.add('input-action-box', 'input-border-bottom', 'permission-row');
-
-    let input = document.createElement('input');
-    input.type = 'text';
-    input.classList.add('form-control-plaintext', 'permission-title');
-    input.id = id;
-    input.value = value;
-    input.setAttribute('readonly', "true");
-
-    let hiddenInput = document.createElement('input');
-    hiddenInput.type = 'hidden';
-    hiddenInput.classList.add('permission-role');
-    hiddenInput.value = id;
-
-
-    row.appendChild(input);
-    row.appendChild(hiddenInput);
-
-    let actionButton = document.createElement('span');
-    actionButton.classList.add('action-padding', 'action-button', 'input-action-margin');
-
-    let deleteButton = document.createElement('span');
-    deleteButton.classList.add('action-link', 'far', 'fa-trash-alt');
-    deleteButton.setAttribute('onclick', 'removeRole(this);');
-    deleteButton.setAttribute('role', 'button');
-
-    actionButton.appendChild(deleteButton);
-    row.appendChild(actionButton);
-
-    document.getElementById('permission-wrapper').appendChild(row);
-
-    var permissionRoles = $('.permission-row');
-    var permissionIndex = 0;
-
-    permissionRoles.each(function () {
-        var hiddenInput = $(this).find('.permission-role');
-
-        hiddenInput.attr("id",`roles${permissionIndex}.id`);
-
-        hiddenInput.attr("name",`roles[${permissionIndex}].id`);
-
-        var input = $(this).find('.permission-title');
-        input.attr("name", `roles[${permissionIndex}].name`);
-        input.attr("id", `roles${permissionIndex}.name`);
-        permissionIndex++;
-    });
-
-  };
-
-
-
-  function addEnumRow(context, value)
-  {
-    let enumIndex = $(context).closest('.enum_box').find('.enum-index').val();
-    let countIndex = $(context).closest('.enum_box').find('.enum-row').length;
-
-    let row = document.createElement('div');
-    row.classList.add('input-action-box', 'input-border-bottom', 'enum-row');
-
-
-    let input = document.createElement('input');
-    input.type = 'text';
-    input.classList.add('form-control-plaintext');
-    input.value = value;
-    input.setAttribute('readonly', "true");
-    input.setAttribute('id', `parameters${enumIndex}.parameterValues${countIndex}.value`);
-    input.setAttribute('name', `parameters[${enumIndex}].parameterValues[${countIndex}].value`);
-
-    row.appendChild(input);
-
-    let sortSpan = document.createElement('span');
-    sortSpan.classList.add('action-padding', 'input-action-margin', 'sort-icon');
-    sortSpan.innerHTML = "<i class=\"fas fa-sort\"></i>";
-
-    row.appendChild(sortSpan);
-
-    let deleteSpan = document.createElement('span');
-    deleteSpan.classList.add('action-padding', 'input-action-margin', 'action-button');
-
-    let deleteButton = document.createElement('span');
-    deleteButton.classList.add('action-link', 'far', 'fa-trash-alt');
-    deleteButton.setAttribute('onclick', 'removeEnum(this)');
-
-    deleteSpan.appendChild(deleteButton);
-
-    row.appendChild(deleteSpan);
-
-    $(context).closest(".enum_box").find(".enum-wrapper").append($(row));
-
-  }
-
-
-  function removeRole (selectedField) {
-    selectedField.closest('.permission-row').remove();
-  }
-
-
-  function showEnum(select) {
-    var enumBox = $(select).closest(".panel-collapse").find(".enum_box");
-    enumBox.removeClass("hidden");
-  }
-
-  function hideEnum(select) {
-    var enumBox = $(select).closest(".panel-collapse").find(".enum_box");
-    enumBox.addClass("hidden");
-  }
-
-
-  function removeEnum(select) {
-    $(select).closest(".enum-row").remove();
-  }
-
-  function removePanel(panel) {
-    var r = confirm("Opravdu si přejete odstranit parametr?");
-    if (r == true) {
-      $(panel).closest(".parameter").remove();
-    }
-
-  }
-
-
-  function addCollapse() {
-
-    var index = $(".parameter").length;
-
-    var typeSelectValues = $("#allParametersHiddenSelect").html();
-    var functionSelectValues = $("#allFunctionsHiddenSelect").html();
-    var operatorSelectValues = $("#allOperatorsHiddenSelect").html();
-
-    $(".panel-wrapper").append('\n' +
-            '      <div class="panel-group parameter">\n' +
-            `      <input type="hidden" class="parametr-order" value="0" id="parameters${index}.parameterOrder" name="parameters[${index}].parameterOrder">\n` +
-            '        <div class="panel panel-default">\n' +
-            '          <div class="panel-heading">\n' +
-            '            <span class="panel-title">\n' +
-            `              <a data-toggle="collapse" data-parent="#accordion" href=#collapse${index}>\n` +
-            `                <i class="fas fa-angle-right"></i> Nový parametr\n` +
-            '              </a>\n' +
-            '              <span class="align-right collapse-actions">\n' +
-            '                <span class="action-padding input-action-margin-collapse sort-icon">\n' +
-            '                  <i class="fas fa-sort"></i>\n' +
-            '                </span>\n' +
-            '                <span class="action-padding action-button input-action-margin-collapse">\n' +
-            '                  <span href=# class="action-link far fa-trash-alt" onclick="removePanel(this);"></span>\n' +
-            '                </span>\n' +
-            '              </span>\n' +
-            '            </span>\n' +
-            '          </div>\n' +
-            `          <div id="collapse${index}" class="panel-collapse collapse">\n` +
-            '            <div class="panel-body">\n' +
-            '              <div class="form-group row">\n' +
-            '                <label for="name" class="col-sm-2 col-form-label">Název:</label>\n' +
-            '                <div class="col-sm-10">\n' +
-            `                  <input type="text" class="form-control" name="parameters[${index}].name" id="parameterName${index}" value="Nový parametr" required>\n` +
-            '                </div>\n' +
-            '              </div>\n' +
-            '              <div class="form-group row">\n' +
-            '                <label for="name" class="col-sm-2 col-form-label">V&nbsp;SQL:</label>\n' +
-            '                <div class="col-sm-10">\n' +
-            `                  <input type="text" class="form-control" name="parameters[${index}].nameOfSelect" id="parameterSQLName${index}" required>\n` +
-            '                </div>\n' +
-            '              </div>\n' +
-            '              <div class="form-group row">\n' +
-            '                <label for="exampleFormControlSelect1" class="col-sm-2">Typ:</label>\n' +
-            '                <div class="col-sm-10">\n' +
-            `                  <select name="parameters[${index}].parameterType" class="form-control type-select">\n` +
-                                  typeSelectValues+
-            '                  </select>\n' +
-            '                </div>\n' +
-            '              </div>\n' +
-            '\n' +
-            '              <div class="enum_box">\n' +
-            '                Hodnoty:\n' +
-            '                <div class="enum_values col-md-8">\n' +
-            '                  <div class="enum-wrapper">\n' +
-            `                     <input type="hidden" class="enum-index" value="${index}">\n` +
-            '                  </div>\n' +
-            '\n' +
-            '                  <div class="form-group row form-add-item">\n' +
-            '                    <div class="col-md-9">\n' +
-            '                      <input type="text" class="form-control enum-add-input">\n' +
-            '                    </div>\n' +
-            '                    <span class="btn btn-primary mb-2 enum-add-button">Přidat</span>\n' +
-            '                  </div>\n' +
-            '                </div>\n' +
-            '              </div>\n' +
-            '\n' +
-            `              <div class="form-group row">\n` +
-            '                <label for="exampleFormControlSelect1" class="col-sm-2">Umístění:</label>\n' +
-            '                <div class="col-sm-10">\n' +
-            '                  <div class="form-check form-check-inline">\n' +
-            `                    <input type="hidden" name="_parameters[${index}].locations" value="on">\n` +
-            `                    <input class="form-check-input" name="parameters[${index}].locations" id="parameters${index}.locations1" type="checkbox" value="1">\n` +
-            `                    <label class="form-check-label" for="parameters[${index}].locations" >Sloupec</label>\n` +
-            '                  </div>\n' +
-            '                  <div class="form-check form-check-inline">\n' +
-            `                    <input type="hidden" name="_parameters[${index}].locations" value="on">\n` +
-            `                    <input class="form-check-input" name="parameters[${index}].locations" id="parameters${index}.locations2" type="checkbox" value="2">\n` +
-            '                    <label class="form-check-label" for="parameters[${index}].locations">Řádek</label>\n' +
-            '                  </div>\n' +
-            '                  <div class="form-check form-check-inline">\n' +
-            `                    <input type="hidden" name="_parameters[${index}].locations" value="on">\n` +
-            `                    <input class="form-check-input" name="parameters[${index}].locations" id="parameters${index}.locations3" type="checkbox" value="3">\n` +
-            '                    <label class="form-check-label" for="parameters[${index}].locations" >Hodnota</label>\n' +
-            '                  </div>\n' +
-            '                </div>\n' +
-            '              </div>\n' +
-            '              <div class="form-group row">\n' +
-            '                  <label for="exampleFormControlSelect1" class="col-sm-2">Funkce:</label>\n' +
-            '                  <div class="col-sm-10">\n' +
-            `                    <select name="parameters[${index}].functions" id="parameters${index}.functions" class="mbSelect selectpicker" multiple data-live-search="true">\n` +
-                                    functionSelectValues +
-            '                    </select>\n' +
-            '                  </div>\n' +
-            '              </div>\n' +
-            '              <div class="form-group row">\n' +
-            '                  <label for="exampleFormControlSelect1" class="col-sm-2">Operátory:</label>\n' +
-            '                  <div class="col-sm-10">\n' +
-            `                    <select name="parameters[${index}].operators" id="parameters${index}.operators" class="mbSelect selectpicker" multiple data-live-search="true">\n` +
-                                    operatorSelectValues +
-            '                    </select>\n' +
-            '                  </div>\n' +
-            '              </div>\n' +
-            '            </div>\n' +
-            '          </div>\n' +
-            '        </div>\n' +
-            '      </div>\n' +
-            '    ');
-
-    this.reindexParametrOrder();
-    this.initPanelBody();
-
-  }
-
-  function initPanelBody() {
-    $('.enum-add-button').on('click', function () {
-      var input = $(this).closest(".row").find('.enum-add-input');
-      addEnumRow(this, input.val());
-
-      input.val("");
-    });
-
-    $('.enum-wrapper').sortable().disableSelection();
-
-    $('.type-select').on('change', function () {
-      if (this.value == 1)
-      {
-        showEnum(this);
-      }
-      else
-      {
-        hideEnum(this);
-      }
-    });
-
-    $(".selectpicker").selectpicker('refresh');
-
-    $('.fa-trash-alt').click(function(event){
-      event.preventDefault();
-    });
-  }
-
-  function reindexParametrOrder() {
-    var data = $(".parametr-order");
-
-    let index = 0;
-    $(data).each(function () {
-      console.log($(this));
-      $(this).attr('value', index);
-      index++;
-      console.log($(this));
-    });
-  }
-
-</script>
\ No newline at end of file
+<script type="text/javascript" src="js/assemblyManageScripts.js"></script>
\ No newline at end of file
diff --git a/src/main/webapp/WEB-INF/templates/index.html b/src/main/webapp/WEB-INF/templates/index.html
index fb151b13..62c584b3 100644
--- a/src/main/webapp/WEB-INF/templates/index.html
+++ b/src/main/webapp/WEB-INF/templates/index.html
@@ -42,7 +42,7 @@
 						<td><a th:href="@{/configuration(configurationID=${iconfiguration.id})}"><span th:text="${iconfiguration.name}"></span></a></td>
 						<td class="center-cell">
 				  <span class="action-button">
-					<a th:href="@{/configuration_delete(configurationID=${iconfiguration.id})}" class="action-link far fa-trash-alt"></a>
+					<a th:href="@{/configuration_delete(configurationID=${iconfiguration.id})}" class="action-link far fa-trash-alt" onclick="return confirm('Opravdu si přejete odstranit sestavu?');"></a>
 				  </span>
 						</td>
 					</tr>
@@ -80,9 +80,8 @@
 									  <a th:href="@{/assembly_edit(assemblyID=${iassembly.id})}" class="action-link far fa-edit"></a>
 									</span>
 									<span class="action-button">
-									  <a th:href="@{/assembly_delete(assemblyID=${iassembly.id})}" class="action-link far fa-trash-alt"></a>
+									  <a th:href="@{/assembly_delete(assemblyID=${iassembly.id})}" class="action-link far fa-trash-alt" onclick="return confirm('Opravdu si přejete odstranit sestavu?');"></a>
 									</span>
-
 									<i class="fas fa-sort"></i>
 								</div>
 							</td>
diff --git a/src/main/webapp/js/assemblyManageScripts.js b/src/main/webapp/js/assemblyManageScripts.js
new file mode 100644
index 00000000..3bcd5f93
--- /dev/null
+++ b/src/main/webapp/js/assemblyManageScripts.js
@@ -0,0 +1,322 @@
+
+$(document).ready(function() {
+
+    $(".panel-wrapper").sortable({
+        stop: function(event, ui) {
+            reindexParametrOrder();
+        }
+    }).disableSelection();
+
+
+    $('.fa-trash-alt').click(function(event){
+        event.preventDefault();
+    });
+
+    $('#add-param-button').on('click', function () {
+        addCollapse();
+    });
+
+    reindexParametrOrder();
+    initPanelBody();
+
+});
+
+$('#permission-button').on('click', function () {
+    var selectedRoleId = $('select[name=permission-select] option').filter(':selected').val();
+    var selectedRoleValue = $('select[name=permission-select] option').filter(':selected').text();
+
+    var addedRoles = $('.permission-role');
+
+    var roles = [];
+
+    // get assigned roles
+    addedRoles.each(function () {
+        roles.push($(this).val())
+    });
+
+    if (roles.includes(selectedRoleId))
+    {
+        return;
+    }
+
+    addPermissionRow(selectedRoleId, selectedRoleValue);
+
+});
+
+
+function addPermissionRow(id, value){
+
+    let row = document.createElement('div');
+    row.classList.add('input-action-box', 'input-border-bottom', 'permission-row');
+
+    let input = document.createElement('input');
+    input.type = 'text';
+    input.classList.add('form-control-plaintext', 'permission-title');
+    input.id = id;
+    input.value = value;
+    input.setAttribute('readonly', "true");
+
+    let hiddenInput = document.createElement('input');
+    hiddenInput.type = 'hidden';
+    hiddenInput.classList.add('permission-role');
+    hiddenInput.value = id;
+
+
+    row.appendChild(input);
+    row.appendChild(hiddenInput);
+
+    let actionButton = document.createElement('span');
+    actionButton.classList.add('action-padding', 'action-button', 'input-action-margin');
+
+    let deleteButton = document.createElement('span');
+    deleteButton.classList.add('action-link', 'far', 'fa-trash-alt');
+    deleteButton.setAttribute('onclick', 'removeRole(this);');
+    deleteButton.setAttribute('role', 'button');
+
+    actionButton.appendChild(deleteButton);
+    row.appendChild(actionButton);
+
+    document.getElementById('permission-wrapper').appendChild(row);
+
+    var permissionRoles = $('.permission-row');
+    var permissionIndex = 0;
+
+    permissionRoles.each(function () {
+        var hiddenInput = $(this).find('.permission-role');
+
+        hiddenInput.attr("id",`roles${permissionIndex}.id`);
+
+        hiddenInput.attr("name",`roles[${permissionIndex}].id`);
+
+        var input = $(this).find('.permission-title');
+        input.attr("name", `roles[${permissionIndex}].name`);
+        input.attr("id", `roles${permissionIndex}.name`);
+        permissionIndex++;
+    });
+
+};
+
+
+
+function addEnumRow(context, value)
+{
+    let enumIndex = $(context).closest('.enum_box').find('.enum-index').val();
+    let countIndex = $(context).closest('.enum_box').find('.enum-row').length;
+
+    let row = document.createElement('div');
+    row.classList.add('input-action-box', 'input-border-bottom', 'enum-row');
+
+
+    let input = document.createElement('input');
+    input.type = 'text';
+    input.classList.add('form-control-plaintext');
+    input.value = value;
+    input.setAttribute('readonly', "true");
+    input.setAttribute('id', `parameters${enumIndex}.parameterValues${countIndex}.value`);
+    input.setAttribute('name', `parameters[${enumIndex}].parameterValues[${countIndex}].value`);
+
+    row.appendChild(input);
+
+    let sortSpan = document.createElement('span');
+    sortSpan.classList.add('action-padding', 'input-action-margin', 'sort-icon');
+    sortSpan.innerHTML = "<i class=\"fas fa-sort\"></i>";
+
+    row.appendChild(sortSpan);
+
+    let deleteSpan = document.createElement('span');
+    deleteSpan.classList.add('action-padding', 'input-action-margin', 'action-button');
+
+    let deleteButton = document.createElement('span');
+    deleteButton.classList.add('action-link', 'far', 'fa-trash-alt');
+    deleteButton.setAttribute('onclick', 'removeEnum(this)');
+
+    deleteSpan.appendChild(deleteButton);
+
+    row.appendChild(deleteSpan);
+
+    $(context).closest(".enum_box").find(".enum-wrapper").append($(row));
+
+}
+
+
+function removeRole (selectedField) {
+    selectedField.closest('.permission-row').remove();
+}
+
+
+function showEnum(select) {
+    var enumBox = $(select).closest(".panel-collapse").find(".enum_box");
+    enumBox.removeClass("hidden");
+}
+
+function hideEnum(select) {
+    var enumBox = $(select).closest(".panel-collapse").find(".enum_box");
+    enumBox.addClass("hidden");
+}
+
+
+function removeEnum(select) {
+    $(select).closest(".enum-row").remove();
+}
+
+function removePanel(panel) {
+    var r = confirm("Opravdu si přejete odstranit parametr?");
+    if (r == true) {
+        $(panel).closest(".parameter").remove();
+    }
+
+}
+
+
+function addCollapse() {
+
+    var index = $(".parameter").length;
+
+    var typeSelectValues = $("#allParametersHiddenSelect").html();
+    var functionSelectValues = $("#allFunctionsHiddenSelect").html();
+    var operatorSelectValues = $("#allOperatorsHiddenSelect").html();
+
+    $(".panel-wrapper").append('\n' +
+        '      <div class="panel-group parameter">\n' +
+        `      <input type="hidden" class="parametr-order" value="0" id="parameters${index}.parameterOrder" name="parameters[${index}].parameterOrder">\n` +
+        '        <div class="panel panel-default">\n' +
+        '          <div class="panel-heading">\n' +
+        '            <span class="panel-title">\n' +
+        `              <a data-toggle="collapse" data-parent="#accordion" href=#collapse${index}>\n` +
+        `                <i class="fas fa-angle-right"></i> Nový parametr\n` +
+        '              </a>\n' +
+        '              <span class="align-right collapse-actions">\n' +
+        '                <span class="action-padding input-action-margin-collapse sort-icon">\n' +
+        '                  <i class="fas fa-sort"></i>\n' +
+        '                </span>\n' +
+        '                <span class="action-padding action-button input-action-margin-collapse">\n' +
+        '                  <span href=# class="action-link far fa-trash-alt" onclick="removePanel(this);"></span>\n' +
+        '                </span>\n' +
+        '              </span>\n' +
+        '            </span>\n' +
+        '          </div>\n' +
+        `          <div id="collapse${index}" class="panel-collapse collapse">\n` +
+        '            <div class="panel-body">\n' +
+        '              <div class="form-group row">\n' +
+        '                <label for="name" class="col-sm-2 col-form-label">Název:</label>\n' +
+        '                <div class="col-sm-10">\n' +
+        `                  <input type="text" class="form-control" name="parameters[${index}].name" id="parameterName${index}" value="Nový parametr" required>\n` +
+        '                </div>\n' +
+        '              </div>\n' +
+        '              <div class="form-group row">\n' +
+        '                <label for="name" class="col-sm-2 col-form-label">V&nbsp;SQL:</label>\n' +
+        '                <div class="col-sm-10">\n' +
+        `                  <input type="text" class="form-control" name="parameters[${index}].nameOfSelect" id="parameterSQLName${index}" required>\n` +
+        '                </div>\n' +
+        '              </div>\n' +
+        '              <div class="form-group row">\n' +
+        '                <label for="exampleFormControlSelect1" class="col-sm-2">Typ:</label>\n' +
+        '                <div class="col-sm-10">\n' +
+        `                  <select name="parameters[${index}].parameterType" class="form-control type-select">\n` +
+        typeSelectValues+
+        '                  </select>\n' +
+        '                </div>\n' +
+        '              </div>\n' +
+        '\n' +
+        '              <div class="enum_box">\n' +
+        '                Hodnoty:\n' +
+        '                <div class="enum_values col-md-8">\n' +
+        '                  <div class="enum-wrapper">\n' +
+        `                     <input type="hidden" class="enum-index" value="${index}">\n` +
+        '                  </div>\n' +
+        '\n' +
+        '                  <div class="form-group row form-add-item">\n' +
+        '                    <div class="col-md-9">\n' +
+        '                      <input type="text" class="form-control enum-add-input">\n' +
+        '                    </div>\n' +
+        '                    <span class="btn btn-primary mb-2 enum-add-button">Přidat</span>\n' +
+        '                  </div>\n' +
+        '                </div>\n' +
+        '              </div>\n' +
+        '\n' +
+        `              <div class="form-group row">\n` +
+        '                <label for="exampleFormControlSelect1" class="col-sm-2">Umístění:</label>\n' +
+        '                <div class="col-sm-10">\n' +
+        '                  <div class="form-check form-check-inline">\n' +
+        `                    <input type="hidden" name="_parameters[${index}].locations" value="on">\n` +
+        `                    <input class="form-check-input" name="parameters[${index}].locations" id="parameters${index}.locations1" type="checkbox" value="1">\n` +
+        `                    <label class="form-check-label" for="parameters[${index}].locations" >Sloupec</label>\n` +
+        '                  </div>\n' +
+        '                  <div class="form-check form-check-inline">\n' +
+        `                    <input type="hidden" name="_parameters[${index}].locations" value="on">\n` +
+        `                    <input class="form-check-input" name="parameters[${index}].locations" id="parameters${index}.locations2" type="checkbox" value="2">\n` +
+        '                    <label class="form-check-label" for="parameters[${index}].locations">Řádek</label>\n' +
+        '                  </div>\n' +
+        '                  <div class="form-check form-check-inline">\n' +
+        `                    <input type="hidden" name="_parameters[${index}].locations" value="on">\n` +
+        `                    <input class="form-check-input" name="parameters[${index}].locations" id="parameters${index}.locations3" type="checkbox" value="3">\n` +
+        '                    <label class="form-check-label" for="parameters[${index}].locations" >Hodnota</label>\n' +
+        '                  </div>\n' +
+        '                </div>\n' +
+        '              </div>\n' +
+        '              <div class="form-group row">\n' +
+        '                  <label for="exampleFormControlSelect1" class="col-sm-2">Funkce:</label>\n' +
+        '                  <div class="col-sm-10">\n' +
+        `                    <select name="parameters[${index}].functions" id="parameters${index}.functions" class="mbSelect selectpicker" multiple data-live-search="true">\n` +
+        functionSelectValues +
+        '                    </select>\n' +
+        '                  </div>\n' +
+        '              </div>\n' +
+        '              <div class="form-group row">\n' +
+        '                  <label for="exampleFormControlSelect1" class="col-sm-2">Operátory:</label>\n' +
+        '                  <div class="col-sm-10">\n' +
+        `                    <select name="parameters[${index}].operators" id="parameters${index}.operators" class="mbSelect selectpicker" multiple data-live-search="true">\n` +
+        operatorSelectValues +
+        '                    </select>\n' +
+        '                  </div>\n' +
+        '              </div>\n' +
+        '            </div>\n' +
+        '          </div>\n' +
+        '        </div>\n' +
+        '      </div>\n' +
+        '    ');
+
+    this.reindexParametrOrder();
+    this.initPanelBody();
+
+}
+
+function initPanelBody() {
+    $('.enum-add-button').on('click', function () {
+        var input = $(this).closest(".row").find('.enum-add-input');
+        addEnumRow(this, input.val());
+
+        input.val("");
+    });
+
+    $('.enum-wrapper').sortable().disableSelection();
+
+    $('.type-select').on('change', function () {
+        if (this.value == 1)
+        {
+            showEnum(this);
+        }
+        else
+        {
+            hideEnum(this);
+        }
+    });
+
+    $(".selectpicker").selectpicker('refresh');
+
+    $('.fa-trash-alt').click(function(event){
+        event.preventDefault();
+    });
+}
+
+function reindexParametrOrder() {
+    var data = $(".parametr-order");
+
+    let index = 0;
+    $(data).each(function () {
+        console.log($(this));
+        $(this).attr('value', index);
+        index++;
+        console.log($(this));
+    });
+}
\ No newline at end of file
diff --git a/src/main/webapp/js/assemblyScripts.js b/src/main/webapp/js/assemblyScripts.js
new file mode 100644
index 00000000..99be42ac
--- /dev/null
+++ b/src/main/webapp/js/assemblyScripts.js
@@ -0,0 +1,157 @@
+$(document).ready(function() {
+
+    $('.select-action-button').on('click', function () {
+        if ($(this).hasClass('select-action-headlight'))
+        {
+            $(this).removeClass('select-action-headlight');
+            removeParameter(getParameterTitle($(this)), getParameterType($(this)));
+        }
+        else
+        {
+            $(this).closest('.select-action-buttons').find('.select-action-button').removeClass('select-action-headlight');
+
+            removeFromAll(getParameterTitle($(this)));
+
+            $(this).addClass('select-action-headlight');
+
+            addParameter(getParameterIndex($(this)),
+                getParameterTitle($(this)),
+                getParameterType($(this)),
+                getParameterHiddenValue($(this)));
+
+            initParameters();
+        }
+    });
+
+    initParameters();
+
+});
+
+function removeFromAll(title) {
+    $rows = $('.selected-input-container');
+
+    $rows.each(function () {
+        $(this).find('.parameter-name').each(function () {
+            if ($(this).text() == title)
+            {
+                $(this).closest('.parameter').remove();
+            }
+        })
+    });
+}
+
+function getParameterIndex(button) {
+    return $(button).closest('.parameter-row').find('.parameterIndex').val();
+}
+
+function addParameter(index, parameterName, type, hiddenValue) {
+    var row = document.createElement('tr');
+    row.classList.add(type + '-parameter', 'parameter');
+
+    let hiddenInput = document.createElement('input');
+    hiddenInput.type = 'hidden';
+    hiddenInput.id = `parametersInConfiguration${index}.location.id`;
+    hiddenInput.name = `parametersInConfiguration[${index}].location.id`;
+    hiddenInput.value = hiddenValue;
+
+    row.appendChild(hiddenInput);
+
+    var firstTd = document.createElement('td');
+
+    var firstTdBody = document.createElement('span');
+    firstTdBody.classList.add('parameter-name');
+    firstTdBody.innerHTML = parameterName;
+
+    firstTd.appendChild(firstTdBody);
+
+    row.appendChild(firstTd);
+
+    var thirdTd = document.createElement('td');
+
+    var thirdTdBody;
+
+
+    if (type == 'value')
+    {
+        thirdTdBody = $('#function-select-' + index).clone()[0];
+
+        $(thirdTdBody).removeClass('hidden');
+    }
+    else
+    {
+        var secondTd = document.createElement('td');
+
+        var secondTdBody = document.createElement('input');
+        secondTdBody.type = 'text';
+        secondTdBody.classList.add('form-control', 'select-filter-input-name');
+        secondTdBody.name = `parametersInConfiguration[${index}].columnName`;
+
+        secondTd.appendChild(secondTdBody);
+
+        row.appendChild(secondTd);
+
+        thirdTdBody = document.createElement('span');
+        thirdTdBody.innerHTML = "<i class=\"fas fa-sort\"></i>";
+    }
+
+    thirdTd.appendChild(thirdTdBody);
+
+    row.appendChild(thirdTd);
+
+    $('#' + type + '-wrapper').append($(row));
+
+}
+
+function removeParameter(title, parameterClass) {
+    $rows = $('.' + parameterClass + '-parameter');
+
+    $rows.each(function () {
+        $(this).find('.parameter-name').each(function () {
+            if ($(this).text() == title)
+            {
+                $(this).closest('.' + parameterClass + '-parameter').remove();
+            }
+        })
+    });
+}
+
+function getParameterType(context) {
+    if ($(context).hasClass('column-button'))
+    {
+        return 'column';
+    }
+    else if ($(context).hasClass('row-button'))
+    {
+        return 'row';
+    }
+    else if ($(context).hasClass('value-button'))
+    {
+        return 'value';
+    }
+}
+
+function getParameterHiddenValue(context) {
+    if ($(context).hasClass('column-button'))
+    {
+        return 1;
+    }
+    else if ($(context).hasClass('row-button'))
+    {
+        return 2;
+    }
+    else if ($(context).hasClass('value-button'))
+    {
+        return 3;
+    }
+}
+
+function getParameterTitle(context) {
+    return $(context).closest('.parameter-row').find('.parameter-name').text();
+}
+
+
+function initParameters()
+{
+    $('.sortable').sortable();
+    $("select").selectpicker('refresh');
+}
\ No newline at end of file
diff --git a/src/main/webapp/js/indexScripts.js b/src/main/webapp/js/indexScripts.js
index a18bdc15..f08d5c0a 100644
--- a/src/main/webapp/js/indexScripts.js
+++ b/src/main/webapp/js/indexScripts.js
@@ -30,5 +30,5 @@ $(document).ready(function(){
             });
         }
 
-    })
+    });
 });
\ No newline at end of file
