master
Aevann1 2022-01-17 22:29:06 +02:00
parent 0af78212f2
commit a8d5522382
4 changed files with 32 additions and 18 deletions

View File

@ -149,6 +149,7 @@ if SITE == 'rdrama.net':
JOAN_ID = 28
MOOSE_ID = 1904
AEVANN_ID = 1
Q_ID = 1480
LAWLZ_ID = 3833
LLM_ID = 253
DAD_ID = 2513
@ -176,6 +177,7 @@ elif SITE == "pcmemes.net":
JOAN_ID = 0
MOOSE_ID = 0
AEVANN_ID = 1
Q_ID = 0
LAWLZ_ID = 0
LLM_ID = 0
DAD_ID = 0
@ -203,6 +205,7 @@ else:
JOAN_ID = 0
MOOSE_ID = 0
AEVANN_ID = 0
Q_ID = 0
LAWLZ_ID = 0
LLM_ID = 0
DAD_ID = 0
@ -288,8 +291,8 @@ BADGES = {
'description': 'Contributed at least $100'
},
26: {
'name': 'Rightoid Agendaposter',
'description': 'Forced to use the agendaposter theme'
'name': 'Rightoid',
'description': 'Forced to use the rightoid theme'
},
27: {
'name': 'Lolcow',
@ -656,8 +659,8 @@ AWARDS = {
},
"agendaposter": {
"kind": "agendaposter",
"title": "Rightoid Agendaposter",
"description": "Forces the agendaposter theme on the recipient for 24 hours.",
"title": "Rightoid",
"description": "Forces the rightoid theme on the recipient for 24 hours.",
"icon": "fas fa-snooze",
"color": "text-purple",
"price": 2500

View File

@ -84,7 +84,7 @@ def shop(v):
@auth_required
def buy(v, award):
if award == 'benefactor' and not request.values.get("mb"):
return {"error": "You can only buy this award with marseybux."}, 403
return {"error": "You can only buy the Benefactor award with marseybux."}, 403
AWARDS = deepcopy(AWARDS2)

View File

@ -219,8 +219,8 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words='
else: cutoff = now - 86400
posts = posts.filter(Submission.created_utc >= cutoff)
if sort != "hot": posts = posts.filter_by(is_banned=False, private=False, deleted_utc = 0)
else: posts = posts.filter_by(is_banned=False, stickied=None, private=False, deleted_utc = 0)
if sort == "hot" or v.id == Q_ID: posts = posts.filter_by(is_banned=False, stickied=None, private=False, deleted_utc = 0)
else: posts = posts.filter_by(is_banned=False, private=False, deleted_utc = 0)
if v and v.admin_level == 0:
blocking = [x[0] for x in g.db.query(
@ -247,7 +247,7 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words='
if not (v and v.shadowbanned):
posts = posts.join(User, User.id == Submission.author_id).filter(User.shadowbanned == None)
if sort == "hot":
if sort == "hot" or v.id == Q_ID:
ti = int(time.time()) + 3600
posts = posts.order_by(-1000000*(Submission.realupvotes + 1 + Submission.comment_count/5)/(func.power(((ti - Submission.created_utc)/1000), 1.23)))
elif sort == "new":
@ -272,7 +272,7 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words='
posts = posts[:size]
if sort == "hot" and page == 1:
if (sort == "hot" or v.id == Q_ID) and page == 1:
pins = g.db.query(Submission).filter(Submission.stickied != None, Submission.is_banned == False)
if v and v.admin_level == 0:
blocking = [x[0] for x in g.db.query(UserBlock.target_id).filter_by(user_id=v.id).all()]

View File

@ -1,4 +1,4 @@
<script src="/static/assets/js/award_modal.js?a=202"></script>
<script src="/static/assets/js/award_modal.js?a=208"></script>
<div class="modal fade" id="awardModal" tabindex="-1" role="dialog" aria-labelledby="awardModalTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-scrollable modal-dialog-centered awardmodal" role="document">
<div class="modal-content">
@ -13,14 +13,10 @@
<input autocomplete="off" type="hidden" name="formkey", value="{{v.formkey}}">
<div class="card-columns award-columns awards-wrapper">
{% for award in v.user_awards %}
{% if award.owned %}
<a role="button" id="{{award.kind}}" class="card" onclick="bruh('{{award.kind}}')">
{% else %}
<a role="button" id="{{award.kind}}" class="card disabled">
{% endif %}
<a role="button" id="{{award.kind}}" class="card" onclick="bruh('{{award.kind}}')">
<i class="{{award.icon}} {{award.color}}"></i>
<div class="pt-2" style="font-weight: bold; font-size: 14px; color:#E1E1E1">{{award.title}}</div>
<div class="text-muted">{{award.owned}} owned</div>
<div class="text-muted"><span id="{{award.kind}}-owned">{{award.owned}}</span> owned</div>
</a>
{% endfor %}
</div>
@ -28,14 +24,25 @@
<input autocomplete="off" id="kind" name="kind" value="" hidden>
<textarea autocomplete="off" id="note" maxlength="200" name="note" class="form-control" placeholder="Note to include in award notification..."></textarea>
<input autocomplete="off" id="giveaward" class="btn btn-primary mt-3" style="float:right" type="submit" value="Give Award" disabled>
<button id="buy1" class="btn btn-primary mt-3 mx-3" type="button" disabled style="float:right" onclick="buy(true)">Buy with Marseybux</button>
<button id="buy2" class="btn btn-primary mt-3" type="button" disabled style="float:right" onclick="buy()">Buy with coins</button>
<pre>
</pre>
</form>
</div>
</div>
</div>
<div class="toast" id="toast-post-success2" style="position: fixed; bottom: 1.5rem; margin: 0 auto; left: 0; right: 0; width: 275px; z-index: 1000" role="alert" aria-live="assertive" aria-atomic="true" data-bs-animation="true" data-bs-autohide="true" data-bs-delay="5000">
<div class="toast-body bg-success text-center text-white">
<i class="fas fa-comment-alt-smile mr-2"></i><span id="toast-post-success-text2">Action successful!</span>
</div>
</div>
<div class="toast" id="toast-post-error2" style="position: fixed; bottom: 1.5rem; margin: 0 auto; left: 0; right: 0; width: 275px; z-index: 1000" role="alert" aria-live="assertive" aria-atomic="true" data-bs-animation="true" data-bs-autohide="true" data-bs-delay="5000">
<div class="toast-body bg-danger text-center text-white">
<i class="fas fa-exclamation-circle mr-2"></i><span id="toast-post-error-text2">Error, please try again later.</span>
</div>
</div>
</div>
<style>
@ -79,4 +86,8 @@
.awardmodal {
max-width: 90% !important;
}
toast {
z-index: 7000 !important;
}
</style>