no more "-- " in labels/tags

This commit is contained in:
Ozbolt Menegatti 2019-11-20 19:15:05 +01:00
parent be4c8d0bf1
commit 9f16aa999b
2 changed files with 6 additions and 3 deletions

2
src/view/utils.py Normal file
View File

@ -0,0 +1,2 @@
def clean_label(label):
return label.replace("-- ", "")

View File

@ -1,6 +1,7 @@
from lib.snabbdom import h, patch
from message import *
import random
from view.utils import *
from export import export_to_xml
@ -57,7 +58,7 @@ class View:
if len(entry.labels) == 0:
view_buttons.append(buttons[1])
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))
if entry.comment == "":
@ -80,7 +81,7 @@ class View:
h("div.sense-num", {}, str(senseNum + 1)),
h("div.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("div", {}, View.view_translations(sense.translations, sense)),
h("div", {}, examples)])])
@ -112,7 +113,7 @@ class View:
if 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])
elements.append(tags)