now a generic list implemented generically :)
This commit is contained in:
@@ -21,7 +21,7 @@ def one_question_modal(title, msg, question, current_value, prop):
|
||||
return modal_template(content, title, msg, prop)
|
||||
|
||||
|
||||
def list_adder(title, element_list_getter, add_click_message):
|
||||
def generic_list_editor(title, element_list_getter, add_click_message):
|
||||
content = [h("span", {}, title)]
|
||||
for slabel in element_list_getter():
|
||||
content.append(h("label", {}, [
|
||||
|
||||
@@ -63,7 +63,7 @@ def edit_sense_label(sense):
|
||||
|
||||
def edit_example_translation(example):
|
||||
etl_getter = lambda: example.copy().translations
|
||||
content = list_adder("Edit example translations", etl_getter, message.msg(message.AddExampleTranslation, example))
|
||||
content = generic_list_editor("Edit example translations", etl_getter, message.msg(message.AddExampleTranslation, example))
|
||||
return modal_template(content, "Example Translations", message.EditExampleTranslation, example)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user