fix definitions

This commit is contained in:
matic_t 2020-10-30 05:55:11 -07:00
parent b2e277d8eb
commit 920ce87cfc

View File

@ -185,8 +185,13 @@ 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):
text = "{}: {}".format(idx + 1, sense.definition["indicator"])
text = "{}: {}".format(idx + 1, definition)
id_ = "choose-example-{}".format(idx)
props = {"type": "radio", "name": "choose-example"}
@ -215,7 +220,12 @@ def ske_list(search_term, data, page_num, senses, ske_kinds):
ske_list_hidden = True
else:
list_contents.append(h("span.error", {}, "Something went wrong in SKE: {}".format(data)))
definitions = []
for sense in senses:
for x in sense.definitions:
if x["type"] == "indicator":
definitions.append(x.value)
break
contents = [
h("div.flex.four", {}, [
h("select#ske-select.fourth", {}, [
@ -240,6 +250,6 @@ def ske_list(search_term, data, page_num, senses, ske_kinds):
h("div.flex.three", {}, [
h("span.third", {}, "Vstavi v:"),
h("select#ske-sense-select.two-third", {}, [ h("option", {}, "{} {}".format(
idx + 1, sense.definition["indicator"])) for idx, sense in enumerate(senses)])])]
idx + 1, definition)) for idx, definition in enumerate(definitions)])])]
return modal_template(contents, "SKE", (message.SkeInsert, data))