|
|
|
@ -49,8 +49,9 @@ class View:
|
|
|
|
|
clk = lambda cls: {"on": {"click": msg(cls)}}
|
|
|
|
|
buttons = [
|
|
|
|
|
h("button.normal", clk(ShowVariantsEdit()), "Variants"),
|
|
|
|
|
h("button.success", clk(ShowRelatedEntriesEdit()), "Povezano"),
|
|
|
|
|
h("button.success", clk(ShowEntryLabelsEdit()), "Labels"),
|
|
|
|
|
h("button.warning", clk(ShowCommentEdit()), "Comment")]
|
|
|
|
|
h("button.normal", clk(ShowCommentEdit()), "Comment")]
|
|
|
|
|
|
|
|
|
|
view_buttons = []
|
|
|
|
|
view_table = []
|
|
|
|
@ -60,16 +61,21 @@ class View:
|
|
|
|
|
else:
|
|
|
|
|
view_table.append((buttons[0], ", ".join(entry.variants)))
|
|
|
|
|
|
|
|
|
|
if len(entry.labels) == 0:
|
|
|
|
|
if len(entry.related_entries) == 0:
|
|
|
|
|
view_buttons.append(buttons[1])
|
|
|
|
|
else:
|
|
|
|
|
view_table.append((buttons[1], ", ".join(entry.related_entries)))
|
|
|
|
|
|
|
|
|
|
if len(entry.labels) == 0:
|
|
|
|
|
view_buttons.append(buttons[2])
|
|
|
|
|
else:
|
|
|
|
|
labels = ", ".join([clean_label(val) for _, val in entry.labels])
|
|
|
|
|
view_table.append((buttons[1], labels))
|
|
|
|
|
view_table.append((buttons[2], labels))
|
|
|
|
|
|
|
|
|
|
if entry.comment == "":
|
|
|
|
|
view_buttons.append(buttons[2])
|
|
|
|
|
view_buttons.append(buttons[3])
|
|
|
|
|
else:
|
|
|
|
|
view_table.append((buttons[2], entry.comment))
|
|
|
|
|
view_table.append((buttons[3], entry.comment))
|
|
|
|
|
|
|
|
|
|
table_rows = [
|
|
|
|
|
h("tr", {}, [ h("td", {}, btn), h("td", {}, content)])
|
|
|
|
|