Commit 968237ecac8f65a186a5e0510a3e6d997e84e9ac
Merge branch 'tomek' into dev
Showing
2 changed files
with
43 additions
and
28 deletions
semantics/phraseology_generator.py
... | ... | @@ -103,7 +103,7 @@ def get_nps(case, number, nouns, atr): |
103 | 103 | filtered = [] |
104 | 104 | for option in options: |
105 | 105 | (orth, tag) = option |
106 | - if u':' + case + u':' in tag: | |
106 | + if u':' + case in tag: | |
107 | 107 | filtered.append(option) |
108 | 108 | options = filtered |
109 | 109 | if number != u'_': |
... | ... |
semantics/static/js/semantics_view.js
... | ... | @@ -84,38 +84,47 @@ function displayMeanings() { |
84 | 84 | if (f.meaning <= 0) { |
85 | 85 | $.prompt.goToState('state21'); |
86 | 86 | } else { |
87 | - $.prompt.goToState('state20'); | |
87 | + // $.prompt.goToState('state20'); | |
88 | + alert('Nie wybrano żadnego znaczenia!'); | |
88 | 89 | } |
89 | 90 | } |
90 | 91 | } |
91 | 92 | if (v == 3) { |
92 | - $.prompt.removeState('state3'); | |
93 | - $.prompt.addState('state3', | |
94 | - { | |
95 | - title: 'Modyfikuj glossę', | |
96 | - html: 'Jednostka leksykalna: ' + getLexicalUnit(f.meaning) + '<br />' + | |
97 | - '<label>Glossa <input type="text" name="glossa" value="' + getGlossa(f.meaning) + '"></label><br />', | |
98 | - buttons: glossa_buttons, | |
99 | - focus: 1, | |
100 | - submit: submitGlossa | |
101 | - }, | |
102 | - 'state22'); | |
103 | - $.prompt.goToState('state3'); | |
93 | + if ((typeof f.meaning) == 'undefined') { | |
94 | + alert('Nie wybrano żadnego znaczenia!'); | |
95 | + } else { | |
96 | + $.prompt.removeState('state3'); | |
97 | + $.prompt.addState('state3', | |
98 | + { | |
99 | + title: 'Modyfikuj glossę', | |
100 | + html: 'Jednostka leksykalna: ' + getLexicalUnit(f.meaning) + '<br />' + | |
101 | + '<label>Glossa <input type="text" name="glossa" value="' + getGlossa(f.meaning) + '"></label><br />', | |
102 | + buttons: glossa_buttons, | |
103 | + focus: 1, | |
104 | + submit: submitGlossa | |
105 | + }, | |
106 | + 'state22'); | |
107 | + $.prompt.goToState('state3'); | |
108 | + } | |
104 | 109 | } |
105 | 110 | if (v == 4) { |
106 | - var i = indexOfId(lexical_units, f.meaning); | |
107 | - | |
108 | - $.prompt.removeState('state4'); | |
109 | - $.prompt.addState('state4', | |
110 | - { | |
111 | - title: 'Podepnij przykłady do ' + getLexicalUnit(f.meaning), | |
112 | - html: getExamples(f.meaning), | |
113 | - buttons: examples_assignment_buttons, | |
114 | - focus:1, | |
115 | - submit: submitExamplesAssignment | |
116 | - }, | |
117 | - 'state22'); | |
118 | - $.prompt.goToState('state4'); | |
111 | + if ((typeof f.meaning) == 'undefined') { | |
112 | + alert('Nie wybrano żadnego znaczenia!'); | |
113 | + } else { | |
114 | + var i = indexOfId(lexical_units, f.meaning); | |
115 | + | |
116 | + $.prompt.removeState('state4'); | |
117 | + $.prompt.addState('state4', | |
118 | + { | |
119 | + title: 'Podepnij przykłady do ' + getLexicalUnit(f.meaning), | |
120 | + html: getExamples(f.meaning), | |
121 | + buttons: examples_assignment_buttons, | |
122 | + focus:1, | |
123 | + submit: submitExamplesAssignment | |
124 | + }, | |
125 | + 'state22'); | |
126 | + $.prompt.goToState('state4'); | |
127 | + } | |
119 | 128 | } |
120 | 129 | if (v == 5) { |
121 | 130 | saveMeanings(); |
... | ... | @@ -317,7 +326,7 @@ function displayMeanings() { |
317 | 326 | } |
318 | 327 | }, |
319 | 328 | state20: { |
320 | - title: 'Usuwanie znaczenia', | |
329 | + // title: 'Usuwanie znaczenia', | |
321 | 330 | html: 'Nie wybrano żadnego znaczenia', |
322 | 331 | buttons: { "Ok": 1 }, |
323 | 332 | focus: 1, |
... | ... | @@ -863,6 +872,12 @@ function frameClick(clicked_id) { |
863 | 872 | deselect(); |
864 | 873 | highlighted_id = ""; |
865 | 874 | semantics_selected_id = ""; |
875 | + $('#assign_role').attr('disabled', "True"); | |
876 | + $('#add_preference').attr('disabled', "True"); | |
877 | + $('#delete').attr('disabled', "True"); | |
878 | + $('#multi_lus').attr('disabled', "True"); | |
879 | + $('#change_lus').attr('disabled', "True"); | |
880 | + $('#change_opinion').attr('disabled', "True"); | |
866 | 881 | return; |
867 | 882 | } |
868 | 883 | |
... | ... |