commit 388846c1f158754a5da17e3f2936d2900eb4c159
Author: Anděl Ondřej <ondrej.andel@marbes.cz>
Date:   Sat Apr 3 11:14:48 2021 +0200

    Bug #8529: Upravit pořadí filterů pro slovesa

diff --git a/application/view/modals/detailModal.html b/application/view/modals/detailModal.html
index 7a4d111..4165e42 100644
--- a/application/view/modals/detailModal.html
+++ b/application/view/modals/detailModal.html
@@ -73,6 +73,14 @@
                     </div>
 
                     <!-- conditional render -->
+                    <div class="row" id="person-wrapper">
+                        <div class="col-xs-12 col-sm-4">
+                            <label>Osoba:</label>
+                        </div>
+                        <div class="col-xs-12 col-sm-8">
+                            <i id="person"></i>
+                        </div>
+                    </div>
                     <div class="row" id="case-wrapper">
                         <div class="col-xs-12 col-sm-4">
                             <label>Pád:</label>
@@ -97,14 +105,6 @@
                             <i id="gender"></i>
                         </div>
                     </div>
-                    <div class="row" id="grade-wrapper">
-                        <div class="col-xs-12 col-sm-4">
-                            <label>Stupeň:</label>
-                        </div>
-                        <div class="col-xs-12 col-sm-8">
-                            <i id="grade"></i>
-                        </div>
-                    </div>
                     <div class="row" id="shape-wrapper">
                         <div class="col-xs-12 col-sm-4">
                             <label>Tvar:</label>
@@ -113,12 +113,12 @@
                             <i id="shape"></i>
                         </div>
                     </div>
-                    <div class="row" id="k-type-wrapper">
+                    <div class="row" id="grade-wrapper">
                         <div class="col-xs-12 col-sm-4">
-                            <label>Typ:</label>
+                            <label>Stupeň:</label>
                         </div>
                         <div class="col-xs-12 col-sm-8">
-                            <i id="k-type"></i>
+                            <i id="grade"></i>
                         </div>
                     </div>
                     <div class="row" id="type-wrapper">
@@ -129,6 +129,14 @@
                             <i id="type"></i>
                         </div>
                     </div>
+                    <div class="row" id="time-wrapper">
+                        <div class="col-xs-12 col-sm-4">
+                            <label>Čas:</label>
+                        </div>
+                        <div class="col-xs-12 col-sm-8">
+                            <i id="time"></i>
+                        </div>
+                    </div>
                     <div class="row" id="mood-wrapper">
                         <div class="col-xs-12 col-sm-4">
                             <label>Způsob:</label>
@@ -145,22 +153,6 @@
                             <i id="irregular"></i>
                         </div>
                     </div>
-                    <div class="row" id="person-wrapper">
-                        <div class="col-xs-12 col-sm-4">
-                            <label>Osoba:</label>
-                        </div>
-                        <div class="col-xs-12 col-sm-8">
-                            <i id="person"></i>
-                        </div>
-                    </div>
-                    <div class="row" id="time-wrapper">
-                        <div class="col-xs-12 col-sm-4">
-                            <label>Čas:</label>
-                        </div>
-                        <div class="col-xs-12 col-sm-8">
-                            <i id="time"></i>
-                        </div>
-                    </div>
                     <div class="row" id="v-type-wrapper">
                         <div class="col-xs-12 col-sm-4">
                             <label>Slovesný rod:</label>
@@ -177,6 +169,14 @@
                             <i id="vid"></i>
                         </div>
                     </div>
+                    <div class="row" id="k-type-wrapper">
+                        <div class="col-xs-12 col-sm-4">
+                            <label>Typ:</label>
+                        </div>
+                        <div class="col-xs-12 col-sm-8">
+                            <i id="k-type"></i>
+                        </div>
+                    </div>
                 </div>
             </div>
             <div class="modal-footer">
@@ -209,6 +209,18 @@
     function analyzeMorphem(modal, morphem) {
         modal.find('#wordclass').text(codeToWordclass[morphem.charAt(0)]);
 
+        let movedNode;
+        let beforeNode;
+        if(morphem.charAt(0) === 'V') {
+            movedNode = document.getElementById("case-wrapper");
+            beforeNode = document.getElementById(null);
+            movedNode.parentNode.insertBefore(movedNode, beforeNode);
+        } else {
+            movedNode = document.getElementById("case-wrapper");
+            beforeNode = document.getElementById("countability-wrapper");
+            movedNode.parentNode.insertBefore(movedNode, beforeNode);
+        }
+
         (morphem.charAt(1) === '-') ? modal.find('#case-wrapper').hide() :
             modal.find('#case-wrapper').show();
         modal.find('#case').text(codeToCase[morphem.charAt(1)]);
diff --git a/application/view/searchContent.php b/application/view/searchContent.php
index c073639..360f570 100644
--- a/application/view/searchContent.php
+++ b/application/view/searchContent.php
@@ -76,6 +76,8 @@
         <script>
             function filtersChange() {
                 const value = document.getElementById("wordclass").value;
+                let movedNode;
+                let beforeNode;
                 switch (value) {
                     case "N":
                         setFilerVisibility([
@@ -93,6 +95,9 @@
                             false,
                             false
                         ]);
+                        movedNode = document.getElementById("filter-case");
+                        beforeNode = document.getElementById("filter-countability");
+                        movedNode.parentNode.insertBefore(movedNode, beforeNode);
                         break;
                     case "A":
                         setFilerVisibility([
@@ -110,6 +115,9 @@
                             false,
                             false
                         ]);
+                        movedNode = document.getElementById("filter-case");
+                        beforeNode = document.getElementById("filter-countability");
+                        movedNode.parentNode.insertBefore(movedNode, beforeNode);
                         break;
                     case "P":
                         setFilerVisibility([
@@ -127,6 +135,9 @@
                             false,
                             false
                         ]);
+                        movedNode = document.getElementById("filter-case");
+                        beforeNode = document.getElementById("filter-countability");
+                        movedNode.parentNode.insertBefore(movedNode, beforeNode);
                         break;
                     case "C":
                         setFilerVisibility([
@@ -144,6 +155,9 @@
                             false,
                             false
                         ]);
+                        movedNode = document.getElementById("filter-case");
+                        beforeNode = document.getElementById("filter-countability");
+                        movedNode.parentNode.insertBefore(movedNode, beforeNode);
                         break;
                     case "V":
                         setFilerVisibility([
@@ -161,6 +175,9 @@
                             true,
                             false
                         ]);
+                        movedNode = document.getElementById("filter-case");
+                        beforeNode = document.getElementById("filter-vid");
+                        movedNode.parentNode.insertBefore(movedNode, null);
                         break;
                     case "D":
                         setFilerVisibility([
@@ -292,6 +309,15 @@
         </script>
 
         <!-- conditionaly rendered filters-->
+        <div class="mr-3" id="filter-person">
+            <label for="person" class="mr-2">Osoba</label>
+            <select id="person">
+                <option selected="selected" value = "">Nevybráno</option>
+                <option value = "1">1.</option>
+                <option value = "2">2.</option>
+                <option value = "3">3.</option>
+            </select>
+        </div>
         <div class="mr-3" id="filter-case">
             <label for="case" class="mr-2">Pád</label>
             <select id="case">
@@ -354,6 +380,18 @@
                 <option value = "W">Negativa</option>
             </select>
         </div>
+        <div class="mr-3" id="filter-time">
+            <label for="time" class="mr-2">Čas</label>
+            <select id="time">
+                <option selected="selected" value = "">Nevybráno</option>
+                <option value = "P">Prézens</option>
+                <option value = "A">Aorist</option>
+                <option value = "R">Préteritum</option>
+                <option value = "I">Imperfektum</option>
+                <option value = "H">Plusquamperfektum</option>
+                <option value = "F">Futurum</option>
+            </select>
+        </div>
         <div class="mr-3" id="filter-mood">
             <label for="mood" class="mr-2">Způsob</label>
             <select id="mood" onchange="moodChange()">
@@ -375,25 +413,12 @@
                 <option value = "P">Part. perf. pas.</option>
             </select>
         </div>
-        <div class="mr-3" id="filter-person">
-            <label for="person" class="mr-2">Osoba</label>
-            <select id="person">
-                <option selected="selected" value = "">Nevybráno</option>
-                <option value = "1">1.</option>
-                <option value = "2">2.</option>
-                <option value = "3">3.</option>
-            </select>
-        </div>
-        <div class="mr-3" id="filter-time">
-            <label for="time" class="mr-2">Čas</label>
-            <select id="time">
+        <div class="mr-3" id="filter-v-type">
+            <label for="v-type" class="mr-2">Slovesný rod</label>
+            <select id="v-type">
                 <option selected="selected" value = "">Nevybráno</option>
-                <option value = "P">Prézens</option>
-                <option value = "A">Aorist</option>
-                <option value = "R">Préteritum</option>
-                <option value = "I">Imperfektum</option>
-                <option value = "H">Plusquamperfektum</option>
-                <option value = "F">Futurum</option>
+                <option value = "A">Aktivum</option>
+                <option value = "P">Pasivum</option>
             </select>
         </div>
         <div class="mr-3" id="filter-vid">
@@ -404,14 +429,6 @@
                 <option value = "I">Imperfektivum </option>
             </select>
         </div>
-        <div class="mr-3" id="filter-v-type">
-            <label for="v-type" class="mr-2">Slovesný rod</label>
-            <select id="v-type">
-                <option selected="selected" value = "">Nevybráno</option>
-                <option value = "A">Aktivum</option>
-                <option value = "P">Pasivum</option>
-            </select>
-        </div>
         <div class="mr-3" id="filter-k-type">
             <label for="k-type" class="mr-2">Typ</label>
             <select id="k-type">
