commit a2e84e8cc7b9e0eb17e9042d86a7bf55ca761b87
Author: Vojtěch Danišík <32537562+danisik@users.noreply.github.com>
Date:   Mon Apr 20 22:23:57 2020 +0200

    re #7886 Creating + Editing assembly
    Not working: Adding new role to access list, Loading values for parameter, Adding new values for parameter, disabling functions + operators if data type = enumeration, deleting role from Access list, Deleting parameter. Saving new assembly + checking all form elements.
    Added new sql script file for creating test records.
    re #7888 Added back button for Creating + Editing assembly page and page for Generating contingency table.

diff --git a/src/main/java/vldc/aswi/domain/parameter/Parameter.java b/src/main/java/vldc/aswi/domain/parameter/Parameter.java
index 72384e42..3edf49f1 100644
--- a/src/main/java/vldc/aswi/domain/parameter/Parameter.java
+++ b/src/main/java/vldc/aswi/domain/parameter/Parameter.java
@@ -41,6 +41,11 @@ public class Parameter extends EntityParent {
     @OneToMany(mappedBy = "parameter")
     private List<ParameterValue> parameterValues;
 
+    /** Specific type of parameter, which represents type of entry. */
+    @ManyToOne(fetch=FetchType.LAZY)
+    @JoinColumn(name = "parametr_typ_id")
+    private ParameterType parameterType;
+
     /**
      * Creating new table with M:N relationship between Parameter and Location.
      * Specify which locations can be used for parameter.
diff --git a/src/main/java/vldc/aswi/domain/parameter/ParameterInConfiguration.java b/src/main/java/vldc/aswi/domain/parameter/ParameterInConfiguration.java
index 0963fdb6..5fdaf491 100644
--- a/src/main/java/vldc/aswi/domain/parameter/ParameterInConfiguration.java
+++ b/src/main/java/vldc/aswi/domain/parameter/ParameterInConfiguration.java
@@ -30,11 +30,6 @@ public class ParameterInConfiguration extends EntityParent {
     @Column(name = "hodnota_operatoru")
     private String operatorValue;
 
-    /** Specific type of parameter, which represents type of entry. */
-    @ManyToOne(fetch=FetchType.LAZY)
-    @JoinColumn(name = "parametr_typ_id")
-    private ParameterType parameterType;
-
     /** Specific location in which this parameterConfiguration will be used. */
     @ManyToOne(fetch=FetchType.LAZY)
     @JoinColumn(name = "umisteni_id")
diff --git a/src/main/java/vldc/aswi/domain/parameter/ParameterType.java b/src/main/java/vldc/aswi/domain/parameter/ParameterType.java
index aa78c5f7..947b2773 100644
--- a/src/main/java/vldc/aswi/domain/parameter/ParameterType.java
+++ b/src/main/java/vldc/aswi/domain/parameter/ParameterType.java
@@ -25,7 +25,7 @@ public class ParameterType extends EntityParent {
 
     /** List of parameterInConfigurations, which using this parameter type. */
     @OneToMany(mappedBy = "parameterType")
-    private List<ParameterInConfiguration> parametersInConfiguration;
+    private List<Parameter> parameters;
 
     /**
      * Constructor.
diff --git a/src/main/java/vldc/aswi/web/controller/AssemblyController.java b/src/main/java/vldc/aswi/web/controller/AssemblyController.java
index 0a854e53..e3b771bc 100644
--- a/src/main/java/vldc/aswi/web/controller/AssemblyController.java
+++ b/src/main/java/vldc/aswi/web/controller/AssemblyController.java
@@ -1,5 +1,6 @@
 package vldc.aswi.web.controller;
 
+import oracle.jdbc.proxy.annotation.Post;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.ModelMap;
@@ -10,10 +11,13 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.servlet.ModelAndView;
 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 import vldc.aswi.domain.Assembly;
-import vldc.aswi.service.AssemblyManager;
-import vldc.aswi.service.SqlQueryManager;
+import vldc.aswi.domain.Role;
+import vldc.aswi.service.*;
+import vldc.aswi.service.parameter.ParameterTypeManager;
 
 import javax.validation.Valid;
+import java.util.ArrayList;
+import java.util.List;
 
 @Controller
 public class AssemblyController {
@@ -24,6 +28,21 @@ public class AssemblyController {
     @Autowired
     private AssemblyManager assemblyManager;
 
+    @Autowired
+    private RoleManager roleManager;
+
+    @Autowired
+    private ParameterTypeManager parameterTypeManager;
+
+    @Autowired
+    private OperatorManager operatorManager;
+
+    @Autowired
+    private FunctionManager functionManager;
+
+    @Autowired
+    private LocationManager locationManager;
+
     @GetMapping("/assembly")
     public ModelAndView assemblyIndex(@Valid @ModelAttribute("assemblyID") String id) {
         ModelAndView modelAndView = new ModelAndView("assembly");
@@ -46,9 +65,8 @@ public class AssemblyController {
         ModelMap modelMap = modelAndView.getModelMap();
 
         long assemblyID = assembly.getId();
-System.out.println(assemblyID);
-        Assembly assembly2 = assemblyManager.getAssemblyById(assemblyID);
 
+        Assembly assembly2 = assemblyManager.getAssemblyById(assemblyID);
 
         modelMap.addAttribute("assemblies", assemblyManager.getAssemblies());
         modelMap.addAttribute("assembly", assembly2);
@@ -59,14 +77,44 @@ System.out.println(assemblyID);
 
     @GetMapping("/assembly_edit")
     public ModelAndView assemblyEditIndex(@Valid @ModelAttribute("assemblyID") String id) {
-        ModelAndView modelAndView = new ModelAndView("assembly_edit");
+        ModelAndView modelAndView = new ModelAndView("assembly_manage");
 
         ModelMap modelMap = modelAndView.getModelMap();
 
         Assembly assembly = assemblyManager.getAssemblyById(Long.parseLong(id));
 
-        modelMap.addAttribute("assemblies", assemblyManager.getAssemblies());
         modelMap.addAttribute("assembly", assembly);
+        modelMap.addAttribute("roles", roleManager.getRoles());
+        modelMap.addAttribute("rolesWithAccess", assembly.getRoles());
+        modelMap.addAttribute("parameters", assembly.getParameters());
+        modelMap.addAttribute("parameterTypes", parameterTypeManager.getParameterTypes());
+        modelMap.addAttribute("functions", functionManager.getFunctions());
+        modelMap.addAttribute("operators", operatorManager.getOperators());
+        modelMap.addAttribute("locations", locationManager.getLocations());
+
+        return modelAndView;
+    }
+
+    @GetMapping("/assembly_new")
+    public ModelAndView assemblyNewIndex() {
+        ModelAndView modelAndView = new ModelAndView("assembly_manage");
+
+        ModelMap modelMap = modelAndView.getModelMap();
+
+        modelMap.addAttribute("assembly", new Assembly());
+        modelMap.addAttribute("roles", roleManager.getRoles());
+
+        return modelAndView;
+    }
+
+    @PostMapping("/assembly_new")
+    public ModelAndView assemblyNewIndexPost() {
+        ModelAndView modelAndView = new ModelAndView("assembly_manage");
+
+        ModelMap modelMap = modelAndView.getModelMap();
+
+        modelMap.addAttribute("assembly", new Assembly());
+        modelMap.addAttribute("roles", roleManager.getRoles());
 
         return modelAndView;
     }
diff --git a/src/main/webapp/WEB-INF/templates/assembly.html b/src/main/webapp/WEB-INF/templates/assembly.html
index 42d57581..68910f44 100644
--- a/src/main/webapp/WEB-INF/templates/assembly.html
+++ b/src/main/webapp/WEB-INF/templates/assembly.html
@@ -24,6 +24,7 @@
 <main role="main">
 
     <div class="container">
+        <input type=button onclick="history.back()" class="btn btn-success mb-2" value="Zpět">
         <h1>
             Sestava - Studenti - studijní programy
         </h1>
diff --git a/src/main/webapp/WEB-INF/templates/assembly_edit.html b/src/main/webapp/WEB-INF/templates/assembly_edit.html
deleted file mode 100644
index a356a32a..00000000
--- a/src/main/webapp/WEB-INF/templates/assembly_edit.html
+++ /dev/null
@@ -1,429 +0,0 @@
-<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml"><head>
-    <meta charset="utf-8">
-    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
-    <meta name="description" content="">
-    <meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
-    <meta name="generator" content="Jekyll v3.8.6">
-    <title>Album example · Bootstrap</title>
-    <link rel="canonical" href="https://getbootstrap.com/docs/4.4/examples/album/">
-
-    <!-- Bootstrap core CSS -->
-    <link href="css/bootstrap.min.css" rel="stylesheet">
-
-    <link href="css/bootstrap-select.min.css" rel="stylesheet">
-    <link href="css/fontawesome.min.css" rel="stylesheet">
-    <link href="css/style.css" rel="stylesheet">
-
-    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
-    <script type="text/javascript" src="js/jquery.js"></script>
-    <script type="text/javascript" src="js/bootstrap.min.js"></script>
-    <script type="text/javascript" src="js/bootstrap-select.min.js"></script>
-</head>
-<body>
-<div id="test"></div>
-<main role="main">
-
-  <div class="container">
-    <h1>
-      Editace - Studenti - studijní programy
-    </h1>
-  </div>
-
-<form>
-  <div class="container box">
-    <div class="col-md-12">
-    <div class="form-group row">
-      <label for="name" class="col-sm-2 col-form-label">Název sestavy:</label>
-      <div class="col-sm-10">
-        <input type="text" class="form-control" id="name" th:value="${assembly.name}">
-      </div>
-    </div>
-    <div class="form-group row">
-      <label for="sql_query" class="col-sm-2 col-form-label">SQL dotaz:</label>
-      <div class="col-sm-10">
-        <textarea class="form-control" id="sql_query" rows="6" th:text="${assembly.SQLQuery}"></textarea>
-      </div>
-    </div>
-    <div class="form-group row">
-      <label class="form-check-label col-sm-2" for="defaultCheck1">Veřejný:</label>
-      <div class="col-sm-10">
-        <div class="form-check">
-          <input th:if="${assembly.isPublic == 0}" class="form-check-input" type="checkbox" value="" id="defaultCheck1">
-          <input th:unless="${assembly.isPublic == 0}" class="form-check-input" type="checkbox" value="" id="defaultCheck1" checked="true">
-        </div>
-      </div>
-    </div>
-</div>
-  </div>
-</div>
-
-  <div class="container box">
-    <div class="col-md-12">
-    <div class="box-header">
-      <h3 class="box-title">Parametry</h3>
-      <button type="button" class="btn btn-success"><i class="fas fa-plus"></i> Přidat parametr</button>
-    </div>
-
-    <div class="panel-group" id="accordion">
-      <div class="panel panel-default">
-
-        <div class="panel-heading">
-          <a data-toggle="collapse" data-parent="#accordion" href="#collapse1">
-            <span class="panel-title">
-                <i class="fas fa-angle-right"></i> Akademický rok
-            </span>
-          </a>
-
-          <span class="align-right collapse-actions">
-            <span class="action-padding input-action-margin-collapse sort-icon">
-              <i class="fas fa-sort"></i>
-            </span>
-            <span class="action-padding action-button input-action-margin-collapse">
-              <a href=# class="action-link far fa-trash-alt"></a>
-            </span>
-          </span>
-
-        </div>
-        <div id="collapse1" class="panel-collapse collapse in">
-          <div class="panel-body">
-            <div class="form-group row">
-              <label for="name" class="col-sm-2 col-form-label">Název:</label>
-              <div class="col-sm-10">
-                <input type="text" class="form-control" id="name">
-              </div>
-            </div>
-            <div class="form-group row">
-              <label for="name" class="col-md-2 col-form-label">V&nbsp;SQL:</label>
-              <div class="col-sm-10">
-                <input type="text" class="form-control" id="name">
-              </div>
-            </div>
-            <div class="form-group row">
-              <label for="exampleFormControlSelect1" class="col-sm-2">Typ:</label>
-              <div class="col-sm-10">
-                <select class="form-control" id="exampleFormControlSelect1">
-                  <option>Text</option>
-                  <option>Datum</option>
-                  <option>Výčet</option>
-                </select>
-              </div>
-            </div>
-            <div class="form-group row">
-              <label for="exampleFormControlSelect1" class="col-sm-2">Sloupec:</label>
-              <div class="col-sm-10">
-                <div class="form-check form-check-inline">
-                  <input class="form-check-input" type="checkbox" id="inlineCheckbox1" value="option1">
-                  <label class="form-check-label" for="inlineCheckbox1">Sloupec</label>
-                </div>
-                <div class="form-check form-check-inline">
-                  <input class="form-check-input" type="checkbox" id="inlineCheckbox2" value="option2">
-                  <label class="form-check-label" for="inlineCheckbox2">Řádek</label>
-                </div>
-                <div class="form-check form-check-inline">
-                  <input class="form-check-input" type="checkbox" id="inlineCheckbox3" value="option3">
-                  <label class="form-check-label" for="inlineCheckbox3">Hodnota</label>
-                </div>
-              </div>
-            </div>
-            <div class="form-group row">
-                <label for="exampleFormControlSelect1" class="col-sm-2">Funkce:</label>
-                <div class="col-sm-10">
-                  <select class="selectpicker" multiple data-live-search="true">
-                    <option>SUM</option>
-                    <option>AVG</option>
-                    <option>MAX</option>
-                    <option>MIN</option>
-                  </select>
-                </div>
-            </div>
-            <div class="form-group row">
-                <label for="exampleFormControlSelect1" class="col-sm-2">Operátory:</label>
-                <div class="col-sm-10">
-                  <select class="selectpicker" multiple data-live-search="true">
-                    <option>LIKE</option>
-                    <option>BETWEEN</option>
-                    <option>EQUAL</option>
-                    <option>LESS</option>
-                  </select>
-                </div>
-            </div>
-          </div>
-        </div>
-      </div>
-      <div class="panel panel-default">
-        <div class="panel-heading">
-          <span class="panel-title">
-            <a data-toggle="collapse" data-parent="#accordion" href="#collapse2">
-              <i class="fas fa-angle-right"></i> Typ studia
-            </a>
-
-            <span class="align-right collapse-actions">
-              <span class="action-padding input-action-margin-collapse sort-icon">
-                <i class="fas fa-sort"></i>
-              </span>
-              <span class="action-padding action-button input-action-margin-collapse">
-                <a href=# class="action-link far fa-trash-alt"></a>
-              </span>
-            </span>
-          </span>
-        </div>
-        <div id="collapse2" class="panel-collapse collapse">
-          <div class="panel-body">
-            <div class="form-group row">
-              <label for="name" class="col-sm-2 col-form-label">Název:</label>
-              <div class="col-sm-10">
-                <input type="text" class="form-control" id="name">
-              </div>
-            </div>
-            <div class="form-group row">
-              <label for="name" class="col-sm-2 col-form-label">V&nbsp;SQL:</label>
-              <div class="col-sm-10">
-                <input type="text" class="form-control" id="name">
-              </div>
-            </div>
-            <div class="form-group row">
-              <label for="exampleFormControlSelect1" class="col-sm-2">Typ:</label>
-              <div class="col-sm-10">
-                <select class="form-control" id="exampleFormControlSelect1">
-                  <option>Text</option>
-                  <option>Datum</option>
-                  <option>Výčet</option>
-                </select>
-              </div>
-            </div>
-            <div class="form-group row">
-              <label for="exampleFormControlSelect1" class="col-sm-2">Sloupec:</label>
-              <div class="col-sm-10">
-                <div class="form-check form-check-inline">
-                  <input class="form-check-input" type="checkbox" id="inlineCheckbox1" value="option1">
-                  <label class="form-check-label" for="inlineCheckbox1">Sloupec</label>
-                </div>
-                <div class="form-check form-check-inline">
-                  <input class="form-check-input" type="checkbox" id="inlineCheckbox2" value="option2">
-                  <label class="form-check-label" for="inlineCheckbox2">Řádek</label>
-                </div>
-                <div class="form-check form-check-inline">
-                  <input class="form-check-input" type="checkbox" id="inlineCheckbox3" value="option3">
-                  <label class="form-check-label" for="inlineCheckbox3">Hodnota</label>
-                </div>
-              </div>
-            </div>
-            <div class="form-group row">
-                <label for="exampleFormControlSelect1" class="col-sm-2">Funkce:</label>
-                <div class="col-sm-10">
-                  <select class="selectpicker" multiple data-live-search="true">
-                    <option>SUM</option>
-                    <option>AVG</option>
-                    <option>MAX</option>
-                    <option>MIN</option>
-                  </select>
-                </div>
-            </div>
-            <div class="form-group row">
-                <label for="exampleFormControlSelect1" class="col-sm-2">Operátory:</label>
-                <div class="col-sm-10">
-                  <select class="selectpicker" multiple data-live-search="true">
-                    <option>LIKE</option>
-                    <option>BETWEEN</option>
-                    <option>EQUAL</option>
-                    <option>LESS</option>
-                  </select>
-                </div>
-            </div>
-          </div>
-        </div>
-      </div>
-      <div class="panel panel-default">
-        <div class="panel-heading">
-          <span class="panel-title">
-            <a data-toggle="collapse" data-parent="#accordion" href="#collapse3">
-              <i class="fas fa-angle-right"></i> Fakulta
-            </a>
-            <span class="align-right collapse-actions">
-              <span class="action-padding input-action-margin-collapse sort-icon">
-                <i class="fas fa-sort"></i>
-              </span>
-              <span class="action-padding action-button input-action-margin-collapse">
-                <a href=# class="action-link far fa-trash-alt"></a>
-              </span>
-            </span>
-          </span>
-        </div>
-        <div id="collapse3" class="panel-collapse collapse">
-          <div class="panel-body">
-            <div class="form-group row">
-              <label for="name" class="col-sm-2 col-form-label">Název:</label>
-              <div class="col-sm-10">
-                <input type="text" class="form-control" id="name">
-              </div>
-            </div>
-            <div class="form-group row">
-              <label for="name" class="col-sm-2 col-form-label">V&nbsp;SQL:</label>
-              <div class="col-sm-10">
-                <input type="text" class="form-control" id="name">
-              </div>
-            </div>
-            <div class="form-group row">
-              <label for="exampleFormControlSelect1" class="col-sm-2">Typ:</label>
-              <div class="col-sm-10">
-                <select class="form-control" id="exampleFormControlSelect1">
-                  <option>Text</option>
-                  <option>Datum</option>
-                  <option>Výčet</option>
-                </select>
-              </div>
-            </div>
-
-            <div class="enum_box">
-              Hodnoty:
-              <div class="enum_values col-md-8">
-                <div class="input-action-box input-border-bottom">
-                  <input type="text" readonly class="form-control-plaintext" id="staticEmail" value="Doktorský">
-
-                  <span class="action-padding input-action-margin sort-icon">
-                    <i class="fas fa-sort"></i>
-                  </span>
-                  <span class="action-padding action-button input-action-margin">
-                    <a href=# class="action-link far fa-trash-alt"></a>
-                  </span>
-                </div>
-                <div class="input-action-box input-border-bottom">
-                  <input type="text" readonly class="form-control-plaintext" id="staticEmail" value="Navazující">
-
-                  <span class="action-padding input-action-margin sort-icon">
-                    <i class="fas fa-sort"></i>
-                  </span>
-                  <span class="action-padding action-button input-action-margin">
-                    <a href=# class="action-link far fa-trash-alt"></a>
-                  </span>
-
-                </div>
-                <div class="input-action-box input-border-bottom">
-                  <input type="text" readonly class="form-control-plaintext" id="staticEmail" value="Bakalářský">
-
-                  <span class="action-padding input-action-margin sort-icon">
-                    <i class="fas fa-sort"></i>
-                  </span>
-                  <span class="action-padding action-button input-action-margin">
-                    <a href=# class="action-link far fa-trash-alt"></a>
-                  </span>
-                </div>
-
-                <div class="form-group row form-add-item">
-                  <div class="col-md-9">
-                    <input type="text" class="form-control" id="name">
-                  </div>
-                  <button type="submit" class="btn btn-primary mb-2">Přidat</button>
-                </div>
-
-
-
-
-              </div>
-            </div>
-
-            <div class="form-group row">
-              <label for="exampleFormControlSelect1" class="col-sm-2">Sloupec:</label>
-              <div class="col-sm-10">
-                <div class="form-check form-check-inline">
-                  <input class="form-check-input" type="checkbox" id="inlineCheckbox1" value="option1">
-                  <label class="form-check-label" for="inlineCheckbox1">Sloupec</label>
-                </div>
-                <div class="form-check form-check-inline">
-                  <input class="form-check-input" type="checkbox" id="inlineCheckbox2" value="option2">
-                  <label class="form-check-label" for="inlineCheckbox2">Řádek</label>
-                </div>
-                <div class="form-check form-check-inline">
-                  <input class="form-check-input" type="checkbox" id="inlineCheckbox3" value="option3">
-                  <label class="form-check-label" for="inlineCheckbox3">Hodnota</label>
-                </div>
-              </div>
-            </div>
-            <div class="form-group row">
-                <label for="exampleFormControlSelect1" class="col-sm-2">Funkce:</label>
-                <div class="col-sm-10">
-                  <select class="mbSelect selectpicker" multiple data-live-search="true">
-                    <option>SUM</option>
-                    <option>AVG</option>
-                    <option>MAX</option>
-                    <option>MIN</option>
-                  </select>
-                </div>
-            </div>
-            <div class="form-group row">
-                <label for="exampleFormControlSelect1" class="col-sm-2">Operátory:</label>
-                <div class="col-sm-10">
-                  <select class="mbSelect selectpicker" multiple data-live-search="true">
-                    <option>LIKE</option>
-                    <option>BETWEEN</option>
-                    <option>EQUAL</option>
-                    <option>LESS</option>
-                  </select>
-                </div>
-            </div>
-          </div>
-        </div>
-      </div>
-    </div>
-  </div>
-</div>
-
-  <div class="container box">
-    <div class="col-md-4">
-    <div class="box-header">
-      <h3 class="box-title">Oprávnění</h3>
-    </div>
-    <div class="input-action-box input-border-bottom">
-      <input type="text" readonly class="form-control-plaintext" id="staticEmail" value="Rektor">
-
-      <span class="action-padding input-action-margin sort-icon">
-        <i class="fas fa-sort"></i>
-      </span>
-      <span class="action-padding action-button input-action-margin">
-        <a href=# class="action-link far fa-trash-alt"></a>
-      </span>
-    </div>
-    <div class="input-action-box input-border-bottom">
-      <input type="text" readonly class="form-control-plaintext" id="staticEmail" value="Referentka">
-
-      <span class="action-padding input-action-margin sort-icon">
-        <i class="fas fa-sort"></i>
-      </span>
-      <span class="action-padding action-button input-action-margin">
-        <a href=# class="action-link far fa-trash-alt"></a>
-      </span>
-    </div>
-
-    <div class="form-group row form-add-item">
-      <div class="col-md-9">
-        <select class="form-control " id="exampleFormControlSelect1">
-          <option>Rektor</option>
-          <option>Studijní oddělení</option>
-          <option>Strudenti</option>
-        </select>
-      </div>
-      <button type="submit" class="btn btn-primary mb-2">Přidat</button>
-    </div>
-  </div>
-</div>
-  <div class="submit_center_button">
-      <button type="submit" class="btn btn-success mb-2">Uložit</button>
-  </div>
-
-</form>
-
-
-</main>
-
-<footer class="text-muted">
-  <div class="container">
-
-  </div>
-</footer>
-
-<script type="text/javascript" src="js/app.js"></script>
-</body>
-</html>
-<script type="text/javascript">
-$("select").selectpicker();
-</script>
diff --git a/src/main/webapp/WEB-INF/templates/assembly_manage.html b/src/main/webapp/WEB-INF/templates/assembly_manage.html
new file mode 100644
index 00000000..a2a48007
--- /dev/null
+++ b/src/main/webapp/WEB-INF/templates/assembly_manage.html
@@ -0,0 +1,230 @@
+<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml"><head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
+    <meta name="description" content="">
+    <meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
+    <meta name="generator" content="Jekyll v3.8.6">
+    <title>Album example · Bootstrap</title>
+    <link rel="canonical" href="https://getbootstrap.com/docs/4.4/examples/album/">
+
+    <!-- Bootstrap core CSS -->
+    <link href="css/bootstrap.min.css" rel="stylesheet">
+
+    <link href="css/bootstrap-select.min.css" rel="stylesheet">
+    <link href="css/fontawesome.min.css" rel="stylesheet">
+    <link href="css/style.css" rel="stylesheet">
+
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
+    <script type="text/javascript" src="js/jquery.js"></script>
+    <script type="text/javascript" src="js/bootstrap.min.js"></script>
+    <script type="text/javascript" src="js/bootstrap-select.min.js"></script>
+</head>
+<body>
+<div id="test"></div>
+<main role="main">
+
+  <div class="container">
+    <input type=button onclick="history.back()" class="btn btn-success mb-2" value="Zpět">
+    <h1>
+      Editace - Studenti - studijní programy
+    </h1>
+  </div>
+
+<form>
+  <div class="container box">
+    <div class="col-md-12">
+    <div class="form-group row">
+      <label for="name" class="col-sm-2 col-form-label">Název sestavy:</label>
+      <div class="col-sm-10">
+        <input type="text" class="form-control" id="name" th:value="${assembly.name}">
+      </div>
+    </div>
+    <div class="form-group row">
+      <label for="sql_query" class="col-sm-2 col-form-label">SQL dotaz:</label>
+      <div class="col-sm-10">
+        <textarea class="form-control" id="sql_query" rows="6" th:text="${assembly.SQLQuery}"></textarea>
+      </div>
+    </div>
+    <div class="form-group row">
+      <label class="form-check-label col-sm-2" for="checkboxPublic">Veřejný:</label>
+      <div class="col-sm-10">
+        <div class="form-check">
+          <input class="form-check-input" type="checkbox" value="" th:checked="${assembly.isPublic} == 1" id="checkboxPublic">
+        </div>
+      </div>
+    </div>
+</div>
+  </div>
+</div>
+
+  <div class="container box">
+    <div class="col-md-12">
+    <div class="box-header">
+      <h3 class="box-title">Parametry</h3>
+      <button type="button" class="btn btn-success"><i class="fas fa-plus"></i> Přidat parametr</button>
+    </div>
+
+    <div th:each="parameter : ${parameters}" class="panel-group" id="accordion">
+      <div class="panel panel-default">
+        <div class="panel-heading">
+          <span class="panel-title">
+            <a data-toggle="collapse" data-parent="#accordion" th:attr="href='#collapse' + ${parameter.id}">
+              <i class="fas fa-angle-right"></i> <span th:text="${parameter.name}"></span>
+            </a>
+            <span class="align-right collapse-actions">
+              <span class="action-padding input-action-margin-collapse sort-icon">
+                <i class="fas fa-sort"></i>
+              </span>
+              <span class="action-padding action-button input-action-margin-collapse">
+                <a href=# class="action-link far fa-trash-alt"></a>
+              </span>
+            </span>
+          </span>
+        </div>
+        <div th:id="'collapse' + ${parameter.id}" class="panel-collapse collapse">
+          <div class="panel-body">
+            <div class="form-group row">
+              <label for="name" class="col-sm-2 col-form-label">Název:</label>
+              <div class="col-sm-10">
+                <input type="text" class="form-control" id="name" th:value="${parameter.name}">
+              </div>
+            </div>
+            <div class="form-group row">
+              <label for="name" class="col-sm-2 col-form-label">V&nbsp;SQL:</label>
+              <div class="col-sm-10">
+                <input type="text" class="form-control" id="name" th:value="${parameter.nameOfSelect}">
+              </div>
+            </div>
+            <div class="form-group row">
+              <label for="exampleFormControlSelect1" class="col-sm-2">Typ:</label>
+              <div class="col-sm-10">
+                <select class="form-control" id="exampleFormControlSelect1">
+                  <option th:each="parameterType : ${parameterTypes}" th:value="newParameterType + ${parameterType.name}" th:text="${parameterType.name}"></option>
+                </select>
+              </div>
+            </div>
+
+            <div class="enum_box">
+              Hodnoty:
+              <div class="enum_values col-md-8">
+                <div class="input-action-box input-border-bottom">
+                  <input type="text" readonly class="form-control-plaintext" id="staticEmail" value="Doktorský">
+
+                  <span class="action-padding input-action-margin sort-icon">
+                    <i class="fas fa-sort"></i>
+                  </span>
+                  <span class="action-padding action-button input-action-margin">
+                    <a href=# class="action-link far fa-trash-alt"></a>
+                  </span>
+                </div>
+                <div class="input-action-box input-border-bottom">
+                  <input type="text" readonly class="form-control-plaintext" id="staticEmail" value="Navazující">
+
+                  <span class="action-padding input-action-margin sort-icon">
+                    <i class="fas fa-sort"></i>
+                  </span>
+                  <span class="action-padding action-button input-action-margin">
+                    <a href=# class="action-link far fa-trash-alt"></a>
+                  </span>
+
+                </div>
+                <div class="input-action-box input-border-bottom">
+                  <input type="text" readonly class="form-control-plaintext" id="staticEmail" value="Bakalářský">
+
+                  <span class="action-padding input-action-margin sort-icon">
+                    <i class="fas fa-sort"></i>
+                  </span>
+                  <span class="action-padding action-button input-action-margin">
+                    <a href=# class="action-link far fa-trash-alt"></a>
+                  </span>
+                </div>
+
+                <div class="form-group row form-add-item">
+                  <div class="col-md-9">
+                    <input type="text" class="form-control" id="name">
+                  </div>
+                  <button type="submit" class="btn btn-primary mb-2">Přidat</button>
+                </div>
+              </div>
+            </div>
+
+            <div class="form-group row">
+              <label for="exampleFormControlSelect1" class="col-sm-2">Umístění:</label>
+              <div class="col-sm-10">
+                <div th:each="location : ${locations}" class="form-check form-check-inline">
+                  <input class="form-check-input" type="checkbox" th:id="'checkbox' + ${location.name}" th:value="${location.name}" th:checked="${parameter.locations.contains(location)}">
+                  <label class="form-check-label" th:for="checkbox + ${location.name}" th:text="${location.name}"></label>
+                </div>
+              </div>
+            </div>
+            <div class="form-group row">
+                <label for="exampleFormControlSelect1" class="col-sm-2">Funkce:</label>
+                <div class="col-sm-10">
+                  <select class="mbSelect selectpicker" multiple data-live-search="true">
+                    <option th:each="function : ${functions}" th:value="'selectedFunction' + ${function.name}" th:text="${function.name}" th:selected="${parameter.functions.contains(function)}"></option>
+                  </select>
+                </div>
+            </div>
+            <div class="form-group row">
+                <label for="exampleFormControlSelect1" class="col-sm-2">Operátory:</label>
+                <div class="col-sm-10">
+                  <select class="mbSelect selectpicker" multiple data-live-search="true">
+                    <option th:each="operator : ${operators}" th:value="'selectedOperator' + ${operator.name}" th:text="${operator.name}" th:selected="${parameter.operators.contains(operator)}"></option>
+                  </select>
+                </div>
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
+  </div>
+</div>
+
+  <div class="container box">
+    <div class="col-md-4">
+    <div class="box-header">
+      <h3 class="box-title">Oprávnění</h3>
+    </div>
+
+    <div th:each="roleWithAccess : ${rolesWithAccess}" class="input-action-box input-border-bottom">
+      <input type="text" readonly class="form-control-plaintext" th:id="selectedRole + ${roleWithAccess.name}" th:value="${roleWithAccess.name}">
+
+      <span class="action-padding input-action-margin sort-icon">
+      <i class="fas fa-sort"></i>
+      </span>
+        <span class="action-padding action-button input-action-margin">
+        <a href=# class="action-link far fa-trash-alt"></a>
+      </span>
+    </div>
+
+    <div class="form-group row form-add-item">
+      <div class="col-md-9">
+        <select class="form-control " id="selectNewRole">
+          <option th:each="role : ${roles}" th:value="newRole + ${role.name}" th:text="${role.name}"></option>
+        </select>
+      </div>
+      <button type="submit" class="btn btn-primary mb-2">Přidat</button>
+    </div>
+  </div>
+</div>
+  <div class="submit_center_button">
+      <button type="submit" class="btn btn-success mb-2">Uložit</button>
+  </div>
+
+</form>
+
+
+</main>
+
+<footer class="text-muted">
+  <div class="container">
+
+  </div>
+</footer>
+
+<script type="text/javascript" src="js/app.js"></script>
+</body>
+</html>
+<script type="text/javascript">
+$("select").selectpicker();
+</script>
diff --git a/src/main/webapp/WEB-INF/templates/index.html b/src/main/webapp/WEB-INF/templates/index.html
index efab95de..208415ea 100644
--- a/src/main/webapp/WEB-INF/templates/index.html
+++ b/src/main/webapp/WEB-INF/templates/index.html
@@ -57,7 +57,8 @@
 				<h3 class="box-title">Seznam sestav</h3>
 			</div>
 			<div class="button-container">
-				<button type="button" class="btn btn-success"><i class="fas fa-plus"></i> Přidat novou sestavu</button>
+
+				<a th:href="@{/assembly_new}" class="btn btn-success mb-2"><i class="fas fa-plus"></i> Přidat novou sestavu</a>
 				<button type="button" class="btn btn-success align-right"><i class="fas fa-sort"></i> Upravit řazení</button>
 			</div>
 
