Commit 8858009d084840d768c832dfba9525812da5a508

Authored by Katarzyna Krasnowska
1 parent a320225e

fixes: no switching to inactive tab in entries, no ext. link for new synset in sel. preferences

entries/static/entries/js/entries.js
... ... @@ -212,6 +212,7 @@ function unbind_click(selector) {
212 212 }
213 213  
214 214 function show_syntax(subentries) {
  215 + $('#syntax-no-examples').hide();
215 216 var schemata_dom = subentries2dom(subentries);
216 217 $('#syntax-schemata').append($(schemata_dom));
217 218  
... ... @@ -346,6 +347,7 @@ function restrict_syntax_examples() {
346 347 }
347 348  
348 349 function show_semantics(frames, subentries) {
  350 + $('#semantics-no-examples').hide();
349 351 var schemata_dom = subentries2dom(subentries);
350 352 $('#semantics-schemata').append($(schemata_dom));
351 353 var frames_dom = frames2dom(frames);
... ... @@ -816,6 +818,22 @@ function get_entry(entry_id) {
816 818 show_syntax(response.subentries);
817 819 show_semantics(response.frames, response.subentries);
818 820 show_unmatched_examples();
  821 +
  822 + // if current tab is empty, switch to an active tab
  823 + var active_tab = $('#entryTabs').find('.nav-link.active').attr('id');
  824 + if (active_tab === 'semantics-tab' && $('.frame').length === 0) {
  825 + // current tab is semantics -> show syntax
  826 + $('#syntax-tab').tab('show');
  827 + } else if (active_tab === 'examples-tab') {
  828 + if ($('.frame').length > 0) {
  829 + // current tab is examples, semantics nonempty -> show semantics
  830 + $('#semantics-tab').tab('show');
  831 + } else {
  832 + // current tab is examples, semantics empty -> show syntax
  833 + $('#syntax-tab').tab('show');
  834 + }
  835 + }
  836 +
819 837 // tooltips with meaning gloss
820 838 activate_tooltips($('.frame'));
821 839 // tooltips with phrase descriptions
... ...
entries/views.py
... ... @@ -399,8 +399,9 @@ def get_prefs_list(argument):
399 399 ) + sorted(
400 400 ({
401 401 'str' : str(s),
402   - 'url' : 'http://plwordnet21.clarin-pl.eu/synset/{}'.format(s.id),
403   - 'info' : get_synset_def(s),
  402 + # can be a new synset
  403 + 'url' : None if s.id < 0 else 'http://plwordnet21.clarin-pl.eu/synset/{}'.format(s.id),
  404 + 'info' : s.lexical_units.all()[0].gloss if s.id < 0 else get_synset_def(s),
404 405 } for s in argument.synsets.all()),
405 406 key=lambda x: x['str']
406 407 ) + sorted(
... ...
locale/en/LC_MESSAGES/django.mo
No preview for this file type
locale/en/LC_MESSAGES/django.po
... ... @@ -204,7 +204,7 @@ msgstr &quot;Number of frames&quot;
204 204  
205 205 #: entries/forms.py:195
206 206 msgid "Typ frazy występujący w haśle."
207   -msgstr ""
  207 +msgstr "Phrase type occurring in the entry."
208 208  
209 209 #: entries/forms.py:196
210 210 msgid "Ukryj niepasujące schematy"
... ... @@ -276,7 +276,7 @@ msgstr &quot;Predicative control&quot;
276 276  
277 277 #: entries/forms.py:451
278 278 msgid "Typ frazy występujący na pozycji."
279   -msgstr ""
  279 +msgstr "Phrase type occurring on the position."
280 280  
281 281 #: entries/forms.py:488
282 282 msgid "Frazeologizm"
... ... @@ -390,7 +390,7 @@ msgstr &quot;phraseologism&quot;
390 390  
391 391 #: entries/forms.py:785
392 392 msgid "Realizacja składniowa frazy."
393   -msgstr ""
  393 +msgstr "Syntactic realisation of the phrase."
394 394  
395 395 #: entries/forms.py:789
396 396 msgid "Fraza składowa frazeologizmu porównawczego."
... ... @@ -932,7 +932,7 @@ msgid &quot;&quot;
932 932 "%(a1)s czasownika wymagającego bezokolicznika, którego własności są tożsame "
933 933 "z narzucanymi przez czasownik w bezokoliczniku, w tym brak podmiotu"
934 934 msgstr ""
935   -"%(a1)s of a verb requiring and infinitive, with properties identical to "
  935 +"%(a1)s of a verb requiring an infinitive, with properties identical to "
936 936 "those imposed by the infinitive, including no subject"
937 937  
938 938 #. Translators: fraza, posesywna, odpowiadająca
... ... @@ -2003,7 +2003,7 @@ msgstr &quot;with realisation of the &lt;i&gt;{}&lt;/i&gt; argument.&quot;
2003 2003  
2004 2004 #: entries/views.py:388
2005 2005 msgid "hiperonimy:"
2006   -msgstr "hipernyms"
  2006 +msgstr "hypernyms"
2007 2007  
2008 2008 #: phrase_expansions/templates/phrase_expansions.html:6
2009 2009 msgid "Rozwinięcia fraz"
... ...