commit c2873e44616678922b2b7f13216e17622ebc1ac3
Author: Anděl Ondřej <ondrej.andel@marbes.cz>
Date:   Fri Apr 2 17:33:38 2021 +0200

    Bug #8528: Rozdělení položky způsob

diff --git a/application/view/modals/detailModal.html b/application/view/modals/detailModal.html
index 115b537..7a4d111 100644
--- a/application/view/modals/detailModal.html
+++ b/application/view/modals/detailModal.html
@@ -137,6 +137,14 @@
                             <i id="mood"></i>
                         </div>
                     </div>
+                    <div class="row" id="irregular-wrapper">
+                        <div class="col-xs-12 col-sm-4">
+                            <label>Neurčitý slovesný tvar:</label>
+                        </div>
+                        <div class="col-xs-12 col-sm-8">
+                            <i id="irregular"></i>
+                        </div>
+                    </div>
                     <div class="row" id="person-wrapper">
                         <div class="col-xs-12 col-sm-4">
                             <label>Osoba:</label>
@@ -225,16 +233,19 @@
             modal.find('#k-type-wrapper').hide();
             modal.find('#type-wrapper').hide();
             modal.find('#mood-wrapper').hide();
+            modal.find('#irregular-wrapper').hide();
         } else {
             if(morphem.charAt(0) === 'J') {
                 modal.find('#mood-wrapper').hide();
                 modal.find('#type-wrapper').hide();
+                modal.find('#irregular-wrapper').hide();
 
                 modal.find('#k-type-wrapper').show();
                 modal.find('#k-type').text(codeToKType[morphem.charAt(7)]);
             } else if(morphem.charAt(0) === 'P') {
                 modal.find('#k-type-wrapper').hide();
                 modal.find('#mood-wrapper').hide();
+                modal.find('#irregular-wrapper').hide();
 
                 modal.find('#type-wrapper').show();
                 modal.find('#type').text(codeToType[morphem.charAt(7)]);
@@ -242,12 +253,20 @@
                 modal.find('#k-type-wrapper').hide();
                 modal.find('#type-wrapper').hide();
 
-                modal.find('#mood-wrapper').show();
-                modal.find('#mood').text(codeToMood[morphem.charAt(7)]);
+                if(codeToMood[morphem.charAt(7)] !== undefined){
+                    modal.find('#irregular-wrapper').hide();
+                    modal.find('#mood-wrapper').show();
+                    modal.find('#mood').text(codeToMood[morphem.charAt(7)]);
+                } else {
+                    modal.find('#mood-wrapper').hide();
+                    modal.find('#irregular-wrapper').show();
+                    modal.find('#irregular').text(codeToIrregular[morphem.charAt(7)]);
+                }
             } else {
                 modal.find('#k-type-wrapper').hide();
                 modal.find('#type-wrapper').hide();
                 modal.find('#mood-wrapper').hide();
+                modal.find('#irregular-wrapper').hide();
             }
         }
 
@@ -400,10 +419,13 @@
     };
 
     const codeToMood = {
-        "f": "Infinitiv",
         "d": "Indikativ",
         "i": "Imperativ",
-        "c": "Kondicionál",
+        "c": "Kondicionál"
+    };
+
+    const codeToIrregular = {
+        "f": "Infinitiv",
         "S": "Supinum",
         "e": "Přech. přítomný",
         "m": "Přech. minulý",
diff --git a/application/view/searchContent.php b/application/view/searchContent.php
index 662e604..84abeae 100644
--- a/application/view/searchContent.php
+++ b/application/view/searchContent.php
@@ -91,6 +91,7 @@
                             false,
                             false,
                             false,
+                            false,
                             false
                         ]);
                         break;
@@ -107,6 +108,7 @@
                             false,
                             false,
                             false,
+                            false,
                             false
                         ]);
                         break;
@@ -123,6 +125,7 @@
                             false,
                             false,
                             false,
+                            false,
                             false
                         ]);
                         break;
@@ -139,6 +142,7 @@
                             false,
                             false,
                             false,
+                            false,
                             false
                         ]);
                         break;
@@ -155,6 +159,7 @@
                             true,
                             true,
                             true,
+                            true,
                             false
                         ]);
                         break;
@@ -171,6 +176,7 @@
                             false,
                             false,
                             false,
+                            false,
                             false
                         ]);
                         break;
@@ -187,6 +193,7 @@
                             false,
                             false,
                             false,
+                            false,
                             false
                         ]);
                         break;
@@ -203,6 +210,7 @@
                             false,
                             false,
                             false,
+                            false,
                             true
                         ]);
                         break;
@@ -219,6 +227,7 @@
                             false,
                             false,
                             false,
+                            false,
                             false
                         ]);
                         break;
@@ -235,6 +244,7 @@
                             false,
                             false,
                             false,
+                            false,
                             false
                         ]);
                         break;
@@ -251,6 +261,7 @@
                             false,
                             false,
                             false,
+                            false,
                             false
                         ]);
                         break;
@@ -266,6 +277,7 @@
                     "filter-grade",
                     "filter-type",
                     "filter-mood",
+                    "filter-irregular",
                     "filter-person",
                     "filter-time",
                     "filter-vid",
@@ -347,10 +359,16 @@
             <label for="mood" class="mr-2">Způsob</label>
             <select id="mood">
                 <option selected="selected" value = "">Nevybráno</option>
-                <option value = "f">Infinitiv</option>
                 <option value = "d">Indikativ</option>
                 <option value = "i">Imperativ</option>
                 <option value = "c">Kondicionál</option>
+            </select>
+        </div>
+        <div class="mr-3" id="filter-irregular">
+            <label for="irregular" class="mr-2">Neurčitý slovesný tvar</label>
+            <select id="irregular">
+                <option selected="selected" value = "">Nevybráno</option>
+                <option value = "f">Infinitiv</option>
                 <option value = "S">Supinum</option>
                 <option value = "e">Přech. přítomný</option>
                 <option value = "m">Přech. minulý</option>
@@ -459,7 +477,12 @@
                     if(pos === "P"){
                         formData.append("tag_sentence", document.getElementById("type").value);
                     } else if(pos === "V"){
-                        formData.append("tag_sentence", document.getElementById("mood").value);
+                        const mood = document.getElementById("mood").value;
+                        if(mood !== ""){
+                            formData.append("tag_sentence", mood);
+                        } else {
+                            formData.append("tag_sentence", document.getElementById("irregular").value);
+                        }
                     } else if(pos === "J"){
                         formData.append("tag_sentence", document.getElementById("k-type").value);
                     }
