|
|
@ -4,7 +4,7 @@ from model.translation import TAGS
|
|
|
|
from view.modal_templates import *
|
|
|
|
from view.modal_templates import *
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def edit_translation(translation, cluster_idx, num_clusters, cls, prop):
|
|
|
|
def edit_translation(translation, cluster_idx, num_clusters, cls):
|
|
|
|
def split_line2(left, right):
|
|
|
|
def split_line2(left, right):
|
|
|
|
return h("div.flex.two", {}, [
|
|
|
|
return h("div.flex.two", {}, [
|
|
|
|
h("span.third.span-left-of-input", {}, left), h("span.two-third", {}, right)])
|
|
|
|
h("span.third.span-left-of-input", {}, left), h("span.two-third", {}, right)])
|
|
|
@ -46,7 +46,7 @@ def edit_translation(translation, cluster_idx, num_clusters, cls, prop):
|
|
|
|
for tag in TAGS.keys():
|
|
|
|
for tag in TAGS.keys():
|
|
|
|
content.append(dropdown_right(tag))
|
|
|
|
content.append(dropdown_right(tag))
|
|
|
|
|
|
|
|
|
|
|
|
return modal_template(content, "Translation", cls, prop)
|
|
|
|
return modal_template(content, "Translation", cls)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def edit_sense_label(sense):
|
|
|
|
def edit_sense_label(sense):
|
|
|
@ -58,7 +58,7 @@ def edit_sense_label(sense):
|
|
|
|
|
|
|
|
|
|
|
|
content.append(h("button", {"on": {"click": message.msg(message.AddSenseLabel(sense))}}, "+"))
|
|
|
|
content.append(h("button", {"on": {"click": message.msg(message.AddSenseLabel(sense))}}, "+"))
|
|
|
|
|
|
|
|
|
|
|
|
return modal_template(content, "Sense", message.EditSenseLabel, sense)
|
|
|
|
return modal_template(content, "Sense", message.EditSenseLabel(sense))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def edit_example_translation(example):
|
|
|
|
def edit_example_translation(example):
|
|
|
@ -67,17 +67,17 @@ def edit_example_translation(example):
|
|
|
|
return modal_template(content, "Example Translations", message.EditExampleTranslation(example))
|
|
|
|
return modal_template(content, "Example Translations", message.EditExampleTranslation(example))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def add_sense(sense):
|
|
|
|
def add_sense():
|
|
|
|
return one_question_modal("Add sense", message.AddSense, "Add sense with a label", "", sense)
|
|
|
|
return modal_template(question("Add sense with a label", ""), "Add sense", message.AddSense())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def edit_sense_definition(sense):
|
|
|
|
def edit_sense_definition(sense):
|
|
|
|
return one_question_modal("Sense definition", message.EditSenseDefinition, "Edit sense definition", sense.definition, sense)
|
|
|
|
return modal_template(question("Edit sense definition", sense.definition), "Sense definition", message.EditSenseDefinition(sense))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def edit_comment(comment):
|
|
|
|
def edit_comment(comment):
|
|
|
|
return one_question_modal("Comment", message.EditComment, "Edit comment", comment, None)
|
|
|
|
return modal_template(question("Edit comment", comment), "Comment", message.EditComment())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def edit_example(example):
|
|
|
|
def edit_example(example):
|
|
|
|
return one_question_modal("Example", message.EditExample, "Edit example", example.example, example)
|
|
|
|
return modal_template(question("Edit exmample", example.example), "Example", message.EditExample(example))
|
|
|
|