forked from rDrama/rDrama
allow betting with mbux
parent
7e8017fb9d
commit
a1838f3e77
|
@ -100,8 +100,6 @@ function bet_vote(t, oid) {
|
|||
const scoretext = document.getElementById('option-' + oid);
|
||||
const score = Number(scoretext.textContent);
|
||||
scoretext.textContent = score + 1;
|
||||
|
||||
document.getElementById("user-coins-amount").innerText = parseInt(document.getElementById("user-coins-amount").innerText) - 200;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
@ -298,7 +298,7 @@ class Submission(Base):
|
|||
option_body += f'''><label class="custom-control-label" for="{o.id}">{o.body_html}<span class="presult-{self.id}'''
|
||||
option_body += f'"> - <a href="/votes/post/option/{o.id}"><span id="option-{o.id}">{o.upvotes}</span> bets</a>'
|
||||
if not self.total_bet_voted(v):
|
||||
option_body += f'''<span class="cost"> (cost of entry: {POLL_BET_COINS} coins)</span>'''
|
||||
option_body += f'''<span class="cost"> (cost of entry: {POLL_BET_COINS} coins or marseybux)</span>'''
|
||||
option_body += "</label>"
|
||||
|
||||
if o.exclusive == 3:
|
||||
|
|
|
@ -25,8 +25,8 @@ def vote_option(option_id, v):
|
|||
if option.exclusive == 2:
|
||||
if option.post.total_bet_voted(v):
|
||||
abort(403, "You can't participate in a closed bet!")
|
||||
if not v.charge_account('coins', POLL_BET_COINS):
|
||||
abort(400, f"You don't have {POLL_BET_COINS} coins!")
|
||||
if not v.charge_account('combined', POLL_BET_COINS):
|
||||
abort(400, f"You don't have {POLL_BET_COINS} coins or marseybux!")
|
||||
g.db.add(v)
|
||||
autojanny = get_account(AUTOJANNY_ID)
|
||||
autojanny.pay_account('coins', POLL_BET_COINS)
|
||||
|
|
Loading…
Reference in New Issue