Unified searching for translation location and cluster nums back in example translations
This commit is contained in:
@@ -3,27 +3,20 @@ import message
|
||||
from view.modal_templates import *
|
||||
|
||||
|
||||
def edit_translation(translation, cluster_info, cls):
|
||||
def split_line2(left, right, display):
|
||||
style = {"style": {"display": "initial" if display else "none"}}
|
||||
return h("div.flex.two", style, [
|
||||
def edit_translation(translation, cluster_idx, num_clusters, cls):
|
||||
def split_line2(left, right):
|
||||
return h("div.flex.two", {}, [
|
||||
h("span.third.span-left-of-input", {}, left), h("span.two-third", {}, right)])
|
||||
|
||||
# first line: transalation itself
|
||||
content = [split_line2("Prevedek:",
|
||||
h("input#etv", {"props": {"type": "text", "value": translation.translation}}, ""), True),
|
||||
h("input#etv", {"props": {"type": "text", "value": translation.translation}}, "")),
|
||||
split_line2("Razlaga:",
|
||||
h("input#ete", {"props": {"type": "text", "value": translation.explanation}}, ""), True)]
|
||||
h("input#ete", {"props": {"type": "text", "value": translation.explanation}}, ""))]
|
||||
|
||||
if cluster_info is None:
|
||||
cluster_idx, num_clusters, show_cluster_options = 0, 1, False
|
||||
else:
|
||||
cluster_idx, num_clusters = cluster_info
|
||||
show_cluster_options = True
|
||||
|
||||
# cluster number
|
||||
options = [h("option", {"props": {"selected": idx == cluster_idx}}, str(idx + 1)) for idx in range(num_clusters + 1)]
|
||||
content.append(split_line2("Stevilka gruce:", h("select#cluster-num", {}, options), show_cluster_options))
|
||||
content.append(split_line2("Stevilka gruce:", h("select#cluster-num", {}, options)))
|
||||
|
||||
content.append(h("h4", {}, "Tags"))
|
||||
content.extend(label_list_editor(translation.copy().tags, message.AddToLabelList(translation.copy().tags)))
|
||||
|
||||
Reference in New Issue
Block a user