Example translation editing
This commit is contained in:
@@ -32,6 +32,30 @@ class AddSenseLabel(NoReset):
|
||||
def update_model(self, model):
|
||||
# just adding to the copy to show in the modal
|
||||
self.sense.copy().labels.append("")
|
||||
|
||||
|
||||
class AddExampleTranslation(NoReset):
|
||||
def __init__(self, _, prop):
|
||||
assert(type(prop) is Example)
|
||||
self.example = prop
|
||||
|
||||
def update_model(self, model):
|
||||
# just adding to the copy to show in the modal
|
||||
self.example.copy().translations.append("")
|
||||
|
||||
|
||||
class EditExampleTranslation(Message):
|
||||
def __init__(self, _, prop):
|
||||
assert(type(prop) is Example)
|
||||
self.example = prop
|
||||
|
||||
def update_model(self, model):
|
||||
self.example.translations = []
|
||||
for input_el in document.getElementsByClassName("example-translation-edit-input"):
|
||||
new_example_translation = input_el.value
|
||||
if new_example_translation != "":
|
||||
self.example.translations.append(new_example_translation)
|
||||
|
||||
|
||||
|
||||
class AddSense(SimpleEditMessage):
|
||||
|
||||
Reference in New Issue
Block a user