diff --git a/src/view/modal_templates.py b/src/view/modal_templates.py index 59da9dd..104320e 100644 --- a/src/view/modal_templates.py +++ b/src/view/modal_templates.py @@ -23,12 +23,21 @@ def modal_template(content, title, msg, delete_msg=None): h("footer", {}, footer)] -def question(question, current_value): +def _question(question, current_value, input_element): + props = {"value": current_value} + if input_element == "input": + props["type"] = "text" + return [ h("span", {}, question), h("label", {}, [ - h("input#modal-question", {"props": {"type": "text", "value": current_value}}, "")])] - + h("{}#modal-question".format(input_element), {"props": props}, "")])] + +def big_question(question, current_value): + return _question(question, current_value, "textarea") + +def question(question, current_value): + return _question(question, current_value, "input") def generic_list_editor(title, element_list_getter): content = [h("p", {}, title)] diff --git a/src/view/modals.py b/src/view/modals.py index 4c197ed..c5271ff 100644 --- a/src/view/modals.py +++ b/src/view/modals.py @@ -20,7 +20,7 @@ def edit_translation(translation, parent, cluster_idx, num_clusters, cls): # first line: transalation itself content.extend([ split_line2("Prevedek:", - h("input#etv", {"props": {"type": "text", "value": translation.translation}}, "")), + h("textarea#etv", {"props": {"value": translation.translation}}, "")), split_line2("Razlaga:", h("input#ete", {"props": {"type": "text", "value": translation.explanation}}, ""))]) @@ -98,7 +98,7 @@ def edit_sense_definition(sense): def edit_comment(comment): - return modal_template(question("Edit comment", comment), "Comment", (message.EditComment,), (message.DeleteComment,)) + return modal_template(big_question("Edit comment", comment), "Comment", (message.EditComment,), (message.DeleteComment,)) def do_chosen_examples(example_list, entry):