deduplicate polls
parent
62d077576f
commit
ef5c3c89ee
|
@ -372,18 +372,16 @@ class Comment(Base):
|
|||
for c in self.options:
|
||||
if c.exclusive:
|
||||
body += f'''<div class="custom-control"><input name="option-{self.id}" autocomplete="off" class="custom-control-input" type="radio" id="{c.id}" onchange="choice_vote('{c.id}','{self.id}','comment')"'''
|
||||
if c.voted(v): body += " checked "
|
||||
body += f'''><label class="custom-control-label" for="{c.id}">{c.body_html}<span class="presult-{self.id}'''
|
||||
body += f'"> - <a href="/votes/comment/option/{c.id}"><span id="option-{c.id}">{c.upvotes}</span> votes</a></span></label></div>'
|
||||
else:
|
||||
body += f'<div class="custom-control"><input type="checkbox" class="custom-control-input" id="{c.id}" name="option"'
|
||||
if c.voted(v): body += " checked"
|
||||
if v:
|
||||
if self.post.sub in ('furry','vampire','racist','femboy') and not (v.house and v.house.lower().startswith(sub)): body += ' disabled '
|
||||
body += f''' onchange="poll_vote('{c.id}', 'comment')"'''
|
||||
else: body += f''' onchange="poll_vote_no_v('{c.id}', '{self.id}')"'''
|
||||
body += f'''><label class="custom-control-label" for="{c.id}">{c.body_html}<span class="presult-{self.id}'''
|
||||
body += f'"> - <a href="/votes/comment/option/{c.id}"><span id="option-{c.id}">{c.upvotes}</span> votes</a></span></label></div>'
|
||||
|
||||
if c.voted(v): body += " checked"
|
||||
if v:
|
||||
if self.post.sub in ('furry','vampire','racist','femboy') and not (v.house and v.house.lower().startswith(sub)): body += ' disabled '
|
||||
body += f''' onchange="poll_vote('{c.id}', 'comment')"'''
|
||||
else: body += f''' onchange="poll_vote_no_v('{c.id}', '{self.id}')"'''
|
||||
body += f'''><label class="custom-control-label" for="{c.id}">{c.body_html}<span class="presult-{self.id}'''
|
||||
body += f'"> - <a href="/votes/comment/option/{c.id}"><span id="option-{c.id}">{c.upvotes}</span> votes</a></span></label></div>'
|
||||
|
||||
if self.author.sig_html and (self.author_id == MOOSE_ID or (not self.ghost and not (v and (v.sigs_disabled or v.poor)))):
|
||||
body += f"<hr>{self.author.sig_html}"
|
||||
|
|
|
@ -376,18 +376,16 @@ class Submission(Base):
|
|||
|
||||
elif o.exclusive == 1:
|
||||
body += f'''<div class="custom-control"><input name="option-{self.id}" autocomplete="off" class="custom-control-input" type="radio" id="{o.id}" onchange="choice_vote('{o.id}','{self.id}','post')"'''
|
||||
if o.voted(v): body += " checked "
|
||||
body += f'''><label class="custom-control-label" for="{o.id}">{o.body_html}<span class="presult-{self.id}'''
|
||||
body += f'"> - <a href="/votes/post/option/{o.id}"><span id="option-{o.id}">{o.upvotes}</span> votes</a></span></label></div>'
|
||||
else:
|
||||
body += f'<div class="custom-control"><input type="checkbox" class="custom-control-input" id="{o.id}" name="option"'
|
||||
if o.voted(v): body += " checked"
|
||||
if v:
|
||||
if self.sub in ('furry','vampire','racist','femboy') and not (v.house and v.house.lower().startswith(sub)): body += ' disabled '
|
||||
body += f''' onchange="poll_vote('{o.id}', 'post')"'''
|
||||
else: body += f''' onchange="poll_vote_no_v('{o.id}', '{self.id}')"'''
|
||||
body += f'''><label class="custom-control-label" for="{o.id}">{o.body_html}<span class="presult-{self.id}'''
|
||||
body += f'"> - <a href="/votes/post/option/{o.id}"><span id="option-{o.id}">{o.upvotes}</span> votes</a></span></label></div>'
|
||||
|
||||
if o.voted(v): body += " checked"
|
||||
if v:
|
||||
if self.sub in ('furry','vampire','racist','femboy') and not (v.house and v.house.lower().startswith(sub)): body += ' disabled '
|
||||
body += f''' onchange="poll_vote('{o.id}', 'post')"'''
|
||||
else: body += f''' onchange="poll_vote_no_v('{o.id}', '{self.id}')"'''
|
||||
body += f'''><label class="custom-control-label" for="{o.id}">{o.body_html}<span class="presult-{self.id}'''
|
||||
body += f'"> - <a href="/votes/post/option/{o.id}"><span id="option-{o.id}">{o.upvotes}</span> votes</a></span></label></div>'
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue