fixed id=null and moving collocations between senses

This commit is contained in:
matic_t
2020-12-05 06:08:53 -08:00
parent 920ce87cfc
commit 596a0a372a
3 changed files with 16 additions and 14 deletions

View File

@@ -185,12 +185,14 @@ def move_examples_to_sense(example_list, entry):
sense_of_first_example = example_senses[0]
options = [h("p", {}, "Choose sense for examples")]
definition = ""
for x in sense.definitions:
if x["type"] == "indicator":
definition = x.value
break
for idx, sense in enumerate(entry.senses):
definition = sense.definitions[0].value
for x in sense.definitions:
if x["type"] == "indicator":
definition = x.value
break
text = "{}: {}".format(idx + 1, definition)
id_ = "choose-example-{}".format(idx)
@@ -201,7 +203,6 @@ def move_examples_to_sense(example_list, entry):
options.append(h("input#{}.checkable-input".format(id_), {"props": props}, []))
options.append(h("label.checkable", {"attrs": {"for": id_}}, text))
options.append(h("br", {}, []))
return modal_template(options, "Examples picker", (message.MoveExamplesToSense, example_list))