forked from rDrama/rDrama
tell ppl who receive the chud award the phrase they'll have to say
parent
f14b759849
commit
34744fb741
|
@ -122,9 +122,11 @@ function pick(kind, price, coins, marseybux) {
|
||||||
|
|
||||||
if (kind == "agendaposter") {
|
if (kind == "agendaposter") {
|
||||||
document.getElementById('phrase_section').classList.remove("d-none")
|
document.getElementById('phrase_section').classList.remove("d-none")
|
||||||
|
document.getElementById('note_section').classList.add("d-none")
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
document.getElementById('phrase_section').classList.add("d-none")
|
document.getElementById('phrase_section').classList.add("d-none")
|
||||||
|
document.getElementById('note_section').classList.remove("d-none")
|
||||||
}
|
}
|
||||||
|
|
||||||
if (kind == "flairlock") {
|
if (kind == "flairlock") {
|
||||||
|
@ -171,16 +173,13 @@ function buy(mb) {
|
||||||
function giveaward(t) {
|
function giveaward(t) {
|
||||||
const kind = document.getElementById('kind').value;
|
const kind = document.getElementById('kind').value;
|
||||||
|
|
||||||
const values = {
|
const note_id = (kind == "agendaposter" ? "agendaposter_phrase" : "note")
|
||||||
"kind": kind,
|
|
||||||
"note": document.getElementById('note').value
|
|
||||||
}
|
|
||||||
|
|
||||||
if (kind == "agendaposter")
|
|
||||||
values["agendaposter_phrase"] = document.getElementById('agendaposter_phrase').value
|
|
||||||
|
|
||||||
postToast(t, t.dataset.action,
|
postToast(t, t.dataset.action,
|
||||||
values,
|
{
|
||||||
|
"kind": kind,
|
||||||
|
"note": document.getElementById(note_id).value
|
||||||
|
},
|
||||||
() => {
|
() => {
|
||||||
let owned = document.getElementById(`${kind}-owned`)
|
let owned = document.getElementById(`${kind}-owned`)
|
||||||
let ownednum = Number(owned.textContent) - 1;
|
let ownednum = Number(owned.textContent) - 1;
|
||||||
|
|
|
@ -300,21 +300,17 @@ def award_thing(v, thing_type, id):
|
||||||
abort(409, f"{safe_username} is under the effect of a conflicting award: Marsey award!")
|
abort(409, f"{safe_username} is under the effect of a conflicting award: Marsey award!")
|
||||||
|
|
||||||
if author.agendaposter == 1:
|
if author.agendaposter == 1:
|
||||||
abort(409, f"{safe_username} is perma-chudded!")
|
abort(409, f"{safe_username} is already chudded permanently!")
|
||||||
|
|
||||||
if author.agendaposter and time.time() < author.agendaposter: author.agendaposter += 86400
|
if author.agendaposter and time.time() < author.agendaposter: author.agendaposter += 86400
|
||||||
else: author.agendaposter = int(time.time()) + 86400
|
else: author.agendaposter = int(time.time()) + 86400
|
||||||
|
|
||||||
agendaposter_phrase = request.values.get("agendaposter_phrase").lower()
|
if not note: abort(400, "Missing phrase!")
|
||||||
if not agendaposter_phrase: abort(400, "Missing phrase!")
|
|
||||||
|
|
||||||
agendaposter_phrase = agendaposter_phrase.strip()
|
if len(note) > 50:
|
||||||
if not agendaposter_phrase: abort(400, "Missing phrase!")
|
|
||||||
|
|
||||||
if len(agendaposter_phrase) > 50:
|
|
||||||
abort(400, "Max length for phrase is 50 characters!")
|
abort(400, "Max length for phrase is 50 characters!")
|
||||||
|
|
||||||
author.agendaposter_phrase = agendaposter_phrase
|
author.agendaposter_phrase = note
|
||||||
|
|
||||||
badge_grant(user=author, badge_id=28)
|
badge_grant(user=author, badge_id=28)
|
||||||
elif kind == "flairlock":
|
elif kind == "flairlock":
|
||||||
|
|
|
@ -54,8 +54,10 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<label id="notelabel" for="note" class="pt-4">Note (optional):</label>
|
<div id="note_section">
|
||||||
<textarea autocomplete="off" id="note" maxlength="200" class="form-control" placeholder="Note to include in award notification..."></textarea>
|
<label id="notelabel" for="note" class="pt-4">Note (optional):</label>
|
||||||
|
<textarea autocomplete="off" id="note" maxlength="200" class="form-control" placeholder="Note to include in award notification..."></textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
<input autocomplete="off" id="giveaward" class="awardbtn btn btn-primary mt-3 fl-r" type="submit" data-nonce="{{g.nonce}}" data-onclick="giveaward(this)" value="Give Award" data-bs-dismiss="modal" disabled>
|
<input autocomplete="off" id="giveaward" class="awardbtn btn btn-primary mt-3 fl-r" type="submit" data-nonce="{{g.nonce}}" data-onclick="giveaward(this)" value="Give Award" data-bs-dismiss="modal" disabled>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue