From a13a4a5695f995de6670d9dc77839239ad61aaa1 Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Thu, 7 Mar 2019 15:23:37 -0600 Subject: [PATCH] display results of polls closed when reaching end_date, and polls where the current user cannot vote --- src/presenters/postDisplayer.py | 2 +- src/views/dialogs/postDisplay.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/presenters/postDisplayer.py b/src/presenters/postDisplayer.py index 1e23bbe..01c00e9 100644 --- a/src/presenters/postDisplayer.py +++ b/src/presenters/postDisplayer.py @@ -657,7 +657,7 @@ class displayPollPresenter(base.basePresenter): title = _("Poll from {user1_nom}").format(**user) self.send_message("set_title", value=title) self.send_message("set", control="question", value=self.poll["question"]) - if len(self.poll["answer_ids"]) > 0 or ("is_closed" in self.poll and self.poll["is_closed"] == True) or load_results == True: + if len(self.poll["answer_ids"]) > 0 or ("is_closed" in self.poll and self.poll["is_closed"] == True) or load_results == True or ("can_vote" in self.poll and self.poll["can_vote"] == False): options = [] for i in self.poll["answers"]: options.append((i["text"], i["votes"], i["rate"])) diff --git a/src/views/dialogs/postDisplay.py b/src/views/dialogs/postDisplay.py index ad9c772..0ed1c62 100644 --- a/src/views/dialogs/postDisplay.py +++ b/src/views/dialogs/postDisplay.py @@ -345,7 +345,7 @@ class displayPoll(widgetUtils.BaseDialog): for i in options: sizer2 = wx.StaticBoxSizer(parent=sizer.GetStaticBox(), orient=wx.HORIZONTAL, label=i[0]) staticcontrol = wx.StaticText(sizer2.GetStaticBox(), wx.NewId(), i[0]) - control = wx.TextCtrl(sizer2.GetStaticBox(), wx.NewId(), _("{votes} votes ({rate}% rate)").format(votes=i[1], rate=i[2]), style=wx.TE_READONLY|wx.TE_MULTILINE) + control = wx.TextCtrl(sizer2.GetStaticBox(), wx.NewId(), _("{votes} ({rate}%)").format(votes=i[1], rate=i[2]), style=wx.TE_READONLY|wx.TE_MULTILINE) sizer2.Add(staticcontrol, 0, wx.ALL, 5) sizer2.Add(control, 0, wx.ALL, 5) sizer.Add(sizer2, 0, wx.ALL, 5)