This commit is contained in:
Aevann1 2021-12-04 01:34:03 +02:00
parent 0131ea4740
commit e94937dc69
6 changed files with 41 additions and 10 deletions

View file

@ -392,7 +392,15 @@ class Comment(Base):
@lazy
def ordered_flags(self): return self.flags.order_by(CommentFlag.id).all()
def options_html(self, v):
html = ""
for o in self.options:
html += f'<div class="custom-control"><input type="checkbox" class="custom-control-input" id="{o.id}" name="option"'
if o.poll_voted(v): html += " checked"
html += f''' onchange="poll_vote('{o.id}', '{self.id}')"><label class="custom-control-label" for="{o.id}">{o.body_html}<span class="presult-{self.id}'''
if not self.total_poll_voted(v): html += ' d-none'
html += f'"> - <a href="/votes?link=t3_{o.id}"><span id="poll-{o.id}">{o.upvotes}</span> votes</a></span></label></div><pre></pre>'
return html
class Notification(Base):