Commit ba47f911910b40d1928fa2a6e2013afc836e85a2
1 parent
70b4d3ad
drobne poprawki do wyboru homonimu do odsyłacza
Showing
2 changed files
with
13 additions
and
6 deletions
dictionary/ajax_lexeme_view.py
... | ... | @@ -493,11 +493,8 @@ def cr_homonyms(request, entry, cr_type): |
493 | 493 | cr_type = CrossReferenceType.objects.get(pk=cr_type) |
494 | 494 | pos = cr_type.to_pos |
495 | 495 | lexemes = Lexeme.objects.filter(entry=entry, part_of_speech=pos) |
496 | - if pos.lexical_class_id == 'subst': | |
497 | - labels = (u'Nr hom.', u'Rodzaj', u'Wzór') | |
498 | - make_row = lambda lexeme, lip_data: ( | |
499 | - lexeme.homonym_number, lip_data['genders'], lip_data['patterns']) | |
500 | - elif pos.lexical_class_id == 'v': | |
496 | + aspect = LexemeAttribute.objects.get(name=u'aspekt') | |
497 | + if pos in aspect.parts_of_speech.all(): | |
501 | 498 | labels = (u'Nr hom.', u'Aspekt', u'Wzór') |
502 | 499 | aspect = LexemeAttribute.objects.get(name=u'aspekt') |
503 | 500 | make_row = lambda lexeme, lip_data: ( |
... | ... | @@ -505,6 +502,10 @@ def cr_homonyms(request, entry, cr_type): |
505 | 502 | lexeme.attribute_value(aspect).value |
506 | 503 | if lexeme.attribute_value(aspect) else '', |
507 | 504 | lip_data['patterns']) |
505 | + elif pos.lexical_class_id == 'subst': | |
506 | + labels = (u'Nr hom.', u'Rodzaj', u'Wzór') | |
507 | + make_row = lambda lexeme, lip_data: ( | |
508 | + lexeme.homonym_number, lip_data['genders'], lip_data['patterns']) | |
508 | 509 | else: |
509 | 510 | labels = (u'Nr hom.', u'Wzór') |
510 | 511 | make_row = lambda lexeme, lip_data: ( |
... | ... |
dictionary/templates/lexeme_edit_form.html
1 | +{% load dictionary_extras %} | |
1 | 2 | <form action="" method="post" id="lexeme-edit-form"> |
2 | 3 | <table id="vocab-list"> |
3 | 4 | <tr> |
... | ... | @@ -135,7 +136,12 @@ |
135 | 136 | <span class="type">{{ cr.type.desc }}</span> |
136 | 137 | <span class="entry">{{ cr.to_lexeme.entry }}</span> |
137 | 138 | <span class="hom">#{{ cr.to_lexeme.homonym_number }}</span> |
138 | - <span class="gender">{{ cr.to_lexeme.lip_data.genders }}</span> | |
139 | + <span class="gender"> | |
140 | + {% with cr.to_lexeme.part_of_speech.lexical_class_id as lc %} | |
141 | + {{ cr.to_lexeme.lip_data.genders }} | |
142 | + {{ cr.to_lexeme|attribute:"aspekt" }} | |
143 | + {% endwith %} | |
144 | + </span> | |
139 | 145 | </li> |
140 | 146 | {% endfor %} |
141 | 147 | </ul> |
... | ... |