no more "-- " in labels/tags
This commit is contained in:
parent
be4c8d0bf1
commit
9f16aa999b
2
src/view/utils.py
Normal file
2
src/view/utils.py
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
def clean_label(label):
|
||||||
|
return label.replace("-- ", "")
|
|
@ -1,6 +1,7 @@
|
||||||
from lib.snabbdom import h, patch
|
from lib.snabbdom import h, patch
|
||||||
from message import *
|
from message import *
|
||||||
import random
|
import random
|
||||||
|
from view.utils import *
|
||||||
|
|
||||||
from export import export_to_xml
|
from export import export_to_xml
|
||||||
|
|
||||||
|
@ -57,7 +58,7 @@ class View:
|
||||||
if len(entry.labels) == 0:
|
if len(entry.labels) == 0:
|
||||||
view_buttons.append(buttons[1])
|
view_buttons.append(buttons[1])
|
||||||
else:
|
else:
|
||||||
labels = ", ".join([val for _, val in entry.labels])
|
labels = ", ".join([clean_label(val) for _, val in entry.labels])
|
||||||
view_table.append((buttons[1], labels))
|
view_table.append((buttons[1], labels))
|
||||||
|
|
||||||
if entry.comment == "":
|
if entry.comment == "":
|
||||||
|
@ -80,7 +81,7 @@ class View:
|
||||||
h("div.sense-num", {}, str(senseNum + 1)),
|
h("div.sense-num", {}, str(senseNum + 1)),
|
||||||
h("div.sense", {}, [
|
h("div.sense", {}, [
|
||||||
h("span.sense-label-list", { "on": { "click": msg(ShowSenseLabelEdit(sense)) }}, [
|
h("span.sense-label-list", { "on": { "click": msg(ShowSenseLabelEdit(sense)) }}, [
|
||||||
h("span.sense-label", {}, slabel) for _, slabel in sense.labels ]),
|
h("span.sense-label", {}, clean_label(slabel)) for _, slabel in sense.labels ]),
|
||||||
h("span.sense-definition", { "on": { "click": msg(ShowSenseDefinitionEdit(sense)) }}, sense.definition),
|
h("span.sense-definition", { "on": { "click": msg(ShowSenseDefinitionEdit(sense)) }}, sense.definition),
|
||||||
h("div", {}, View.view_translations(sense.translations, sense)),
|
h("div", {}, View.view_translations(sense.translations, sense)),
|
||||||
h("div", {}, examples)])])
|
h("div", {}, examples)])])
|
||||||
|
@ -112,7 +113,7 @@ class View:
|
||||||
|
|
||||||
if translation.tags:
|
if translation.tags:
|
||||||
tags = h("div.translation-tags", {}, [
|
tags = h("div.translation-tags", {}, [
|
||||||
h("span", {"attr": {"title": key}}, value)
|
h("span", {"attr": {"title": key}}, clean_label(value))
|
||||||
for key, value in translation.tags])
|
for key, value in translation.tags])
|
||||||
elements.append(tags)
|
elements.append(tags)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user