Merge pull request 'Fixed display for explanation - v4.1' (#14) from mt-definition-list-ui into master

Reviewed-on: #14
This commit is contained in:
matic_t 2020-12-05 14:48:38 +00:00
commit b843920119

View File

@ -45,19 +45,13 @@ class Sense(Data):
if explanation is None and x["type"] == "explanation": if explanation is None and x["type"] == "explanation":
explanation = x.value explanation = x.value
if indicator:
definition = indicator
if explanation:
definition += ", " + explanation
else:
definition = explanation
result = h("div.elm-div", {}, [ result = h("div.elm-div", {}, [
h("div.sense-num", {"on": {"click": M.msg(M.ShowSenseMenu, self)}}, str(sense_num + 1)), h("div.sense-num", {"on": {"click": M.msg(M.ShowSenseMenu, self)}}, str(sense_num + 1)),
h("div.sense", {}, [ h("div.sense", {}, [
h("span.sense-label-list", { "on": { "click": M.msg(M.ShowSenseLabelEdit, self) }}, [ h("span.sense-label-list", { "on": { "click": M.msg(M.ShowSenseLabelEdit, self) }}, [
h("span.sense-label", {}, clean_label(slabel)) for _, slabel in self.labels ]), h("span.sense-label", {}, clean_label(slabel)) for _, slabel in self.labels ]),
h("span.sense-definition", { "on": { "click": M.msg(M.ShowSenseDefinitionEdit, self) }}, definition), h("span.sense-definition", { "on": { "click": M.msg(M.ShowSenseDefinitionEdit, self) }}, indicator),
h("div", {}, "Razlaga: " + explanation) if explanation else None,
h("div", {}, View.view_translations(self.translations, self, model)), h("div", {}, View.view_translations(self.translations, self, model)),
h("div", {}, examples)])]) h("div", {}, examples)])])
return result return result