now a generic list implemented generically :)

This commit is contained in:
2019-11-16 14:59:23 +01:00
parent d8291a15cf
commit 14eb9d1df7
4 changed files with 15 additions and 8 deletions

View File

@@ -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", {}, [

View File

@@ -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)