From 62d077576ff561873a62a0c27722133c211a735c Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Tue, 6 Sep 2022 00:54:05 +0200 Subject: [PATCH] change poll- and choice- and -bet to -option --- files/assets/js/comments+submission_listing.js | 8 ++++---- files/assets/js/marked.js | 2 +- files/classes/comment.py | 6 +++--- files/classes/submission.py | 10 +++++----- files/templates/formatting.html | 8 ++++---- files/templates/util/assetcache.html | 4 ++-- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/files/assets/js/comments+submission_listing.js b/files/assets/js/comments+submission_listing.js index 10d78a63d..144166eb6 100644 --- a/files/assets/js/comments+submission_listing.js +++ b/files/assets/js/comments+submission_listing.js @@ -83,7 +83,7 @@ function post(url) { function poll_vote(cid, kind) { var type = document.getElementById(cid).checked; - var scoretext = document.getElementById('poll-' + cid); + var scoretext = document.getElementById('option-' + cid); var score = Number(scoretext.textContent); if (type == true) scoretext.textContent = score + 1; else scoretext.textContent = score - 1; @@ -94,12 +94,12 @@ function choice_vote(cid, parentid, kind) { let curr = document.getElementById(`current-${parentid}`) if (curr && curr.value) { - var scoretext = document.getElementById('choice-' + curr.value); + var scoretext = document.getElementById('option-' + curr.value); var score = Number(scoretext.textContent); scoretext.textContent = score - 1; } - var scoretext = document.getElementById('choice-' + cid); + var scoretext = document.getElementById('option-' + cid); var score = Number(scoretext.textContent); scoretext.textContent = score + 1; @@ -114,7 +114,7 @@ function bet_vote(cid) { for(let el of document.getElementsByClassName('cost')) { el.classList.add('d-none') } - var scoretext = document.getElementById('bet-' + cid); + var scoretext = document.getElementById('option-' + cid); var score = Number(scoretext.textContent); scoretext.textContent = score + 1; post(`/vote/post/option/${cid}`); diff --git a/files/assets/js/marked.js b/files/assets/js/marked.js index 790bef3e3..81bc98660 100644 --- a/files/assets/js/marked.js +++ b/files/assets/js/marked.js @@ -90,7 +90,7 @@ function markdown(t) { var option = options[i][0]; var option2 = option.replace(/&&/g, '').replace(/\n/g, '') input = input.replace(option, ''); - input += `
`; + input += `
`; } } diff --git a/files/classes/comment.py b/files/classes/comment.py index d44db0c50..b65e88f82 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -371,10 +371,10 @@ class Comment(Base): for c in self.options: if c.exclusive: - body += f'''
' + body += f'"> - {c.upvotes} votes' else: body += f'
' + body += f'"> - {c.upvotes} votes' 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"
{self.author.sig_html}" diff --git a/files/classes/submission.py b/files/classes/submission.py index 0eaaa71c6..d8a85b799 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -361,12 +361,12 @@ class Submission(Base): for o in self.options: if o.exclusive == 2: - body += f'''
= 200) or self.total_bet_voted(v): body += " disabled " body += f'''>" @@ -375,10 +375,10 @@ class Submission(Base): body += "
" elif o.exclusive == 1: - body += f'''
' + body += f'"> - {o.upvotes} votes' else: body += f'
' + body += f'"> - {o.upvotes} votes' diff --git a/files/templates/formatting.html b/files/templates/formatting.html index b60806df7..a46aa9c48 100644 --- a/files/templates/formatting.html +++ b/files/templates/formatting.html @@ -149,11 +149,11 @@ Text 2
- +
- +
@@ -168,11 +168,11 @@ Text 2
- +
- +
diff --git a/files/templates/util/assetcache.html b/files/templates/util/assetcache.html index 93a5f63f1..936f9c9da 100644 --- a/files/templates/util/assetcache.html +++ b/files/templates/util/assetcache.html @@ -18,14 +18,14 @@ set CACHE_VER = { 'js/award_modal.js': 4000, 'js/bootstrap.js': 4000, 'js/category_modal.js': 4000, - 'js/comments+submission_listing.js': 4002, + 'js/comments+submission_listing.js': 4006, 'js/comments_admin.js': 4000, 'js/comments_v.js': 4000, 'js/submission_listing.js': 4000, 'js/emoji_modal.js': 4001, 'js/formatting.js': 4000, 'js/lottery.js': 4000, - 'js/marked.js': 4000, + 'js/marked.js': 4006, 'js/search.js': 4000, 'js/submit.js': 4000, 'js/userpage.js': 4000,