|
|
|
@ -59,14 +59,14 @@ def edit_example(example):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def do_chosen_examples(example_list, entry):
|
|
|
|
|
options = []
|
|
|
|
|
options = [h("p", {}, "Choose sense for examples")]
|
|
|
|
|
for idx, sense in enumerate(entry.senses):
|
|
|
|
|
text = "{}: {}".format(idx, sense.definition["indicator"])
|
|
|
|
|
options.append(h("option", {}, text))
|
|
|
|
|
id_ = "choose-example-{}".format(idx)
|
|
|
|
|
|
|
|
|
|
content = [
|
|
|
|
|
h("span", {}, "Choose sense for examples"),
|
|
|
|
|
h("label", {}, [
|
|
|
|
|
h("select#chosen-examples-select", {}, options)])]
|
|
|
|
|
|
|
|
|
|
return modal_template(content, "Examples picker", message.DoChosenExamples(example_list))
|
|
|
|
|
options.append(h("input#{}.checkable-input".format(id_),
|
|
|
|
|
{"props": {"type": "radio", "name": "choose-example"}}, []))
|
|
|
|
|
options.append(h("label.checkable", {"attrs": {"for": id_}}, text))
|
|
|
|
|
options.append(h("br", {}, []))
|
|
|
|
|
|
|
|
|
|
return modal_template(options, "Examples picker", message.DoChosenExamples(example_list))
|
|
|
|
|