fix definitions
This commit is contained in:
parent
b2e277d8eb
commit
920ce87cfc
|
@ -185,8 +185,13 @@ def move_examples_to_sense(example_list, entry):
|
||||||
sense_of_first_example = example_senses[0]
|
sense_of_first_example = example_senses[0]
|
||||||
|
|
||||||
options = [h("p", {}, "Choose sense for examples")]
|
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):
|
for idx, sense in enumerate(entry.senses):
|
||||||
text = "{}: {}".format(idx + 1, sense.definition["indicator"])
|
text = "{}: {}".format(idx + 1, definition)
|
||||||
id_ = "choose-example-{}".format(idx)
|
id_ = "choose-example-{}".format(idx)
|
||||||
|
|
||||||
props = {"type": "radio", "name": "choose-example"}
|
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
|
ske_list_hidden = True
|
||||||
else:
|
else:
|
||||||
list_contents.append(h("span.error", {}, "Something went wrong in SKE: {}".format(data)))
|
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 = [
|
contents = [
|
||||||
h("div.flex.four", {}, [
|
h("div.flex.four", {}, [
|
||||||
h("select#ske-select.fourth", {}, [
|
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("div.flex.three", {}, [
|
||||||
h("span.third", {}, "Vstavi v:"),
|
h("span.third", {}, "Vstavi v:"),
|
||||||
h("select#ske-sense-select.two-third", {}, [ h("option", {}, "{} {}".format(
|
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))
|
return modal_template(contents, "SKE", (message.SkeInsert, data))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user