forked from MarseyWorld/MarseyWorld
master
parent
f577b460cc
commit
5871c6106e
|
@ -178,14 +178,14 @@ def revert_actions(v, username):
|
|||
user.is_banned = 0
|
||||
user.unban_utc = 0
|
||||
user.ban_evade = 0
|
||||
send_repeatable_notification(user.id, "Your account has been unbanned!")
|
||||
send_repeatable_notification(user.id, f"@{v.username} has unbanned you!")
|
||||
g.db.add(user)
|
||||
for u in user.alts:
|
||||
u.shadowbanned = None
|
||||
u.is_banned = 0
|
||||
u.unban_utc = 0
|
||||
u.ban_evade = 0
|
||||
send_repeatable_notification(u.id, "Your account has been unbanned!")
|
||||
send_repeatable_notification(u.id, f"@{v.username} has unbanned you!")
|
||||
g.db.add(u)
|
||||
|
||||
g.db.commit()
|
||||
|
@ -307,17 +307,17 @@ def monthly(v):
|
|||
elif u.patron == 6: procoins = 125000
|
||||
u.procoins += procoins
|
||||
g.db.add(u)
|
||||
send_repeatable_notification(u.id, f"You were given {procoins} Marseybux for the month of {month}! You can use them to buy awards in the [shop](/shop).")
|
||||
send_repeatable_notification(u.id, f"@{v.username} has given you {procoins} Marseybux for the month of {month}! You can use them to buy awards in the [shop](/shop).")
|
||||
elif u.patron == 5:
|
||||
procoins = 50000
|
||||
u.procoins += procoins
|
||||
g.db.add(u)
|
||||
send_repeatable_notification(u.id, f"You were given {procoins} Marseybux for the month of {month}! You can use them to buy awards in the [shop](/shop).")
|
||||
send_repeatable_notification(u.id, f"@{v.username} has given you {procoins} Marseybux for the month of {month}! You can use them to buy awards in the [shop](/shop).")
|
||||
elif u.patron == 1 and u.admin_level > 0:
|
||||
procoins = 2500
|
||||
u.procoins += procoins
|
||||
g.db.add(u)
|
||||
send_repeatable_notification(u.id, f"You were given {procoins} Marseybux for the month of {month}! You can use them to buy awards in the [shop](/shop).")
|
||||
send_repeatable_notification(u.id, f"@{v.username} has given you {procoins} Marseybux for the month of {month}! You can use them to buy awards in the [shop](/shop).")
|
||||
else: print(u.username)
|
||||
|
||||
if request.host == 'pcmemes.net':
|
||||
|
@ -821,7 +821,7 @@ def agendaposter(user_id, v):
|
|||
send_notification(user.id, f"@AutoJanny has given you the following profile badge:\n\n![]({badge.path})\n\n{badge.name}")
|
||||
|
||||
|
||||
send_repeatable_notification(user.id, f"You have been marked by an admin as an agendaposter ({note}).")
|
||||
send_repeatable_notification(user.id, f"@{v.username} has marked you as an agendaposter ({note}).")
|
||||
|
||||
g.db.commit()
|
||||
|
||||
|
@ -852,7 +852,7 @@ def unagendaposter(user_id, v):
|
|||
badge = user.has_badge(28)
|
||||
if badge: g.db.delete(badge)
|
||||
|
||||
send_repeatable_notification(user.id, "You have been unmarked by an admin as an agendaposter.")
|
||||
send_repeatable_notification(user.id, f"@{v.username} has unmarked you as an agendaposter.")
|
||||
|
||||
g.db.commit()
|
||||
return {"message": "Chud theme disabled!"}
|
||||
|
@ -1096,7 +1096,7 @@ def unban_user(user_id, v):
|
|||
user.unban_utc = 0
|
||||
user.ban_evade = 0
|
||||
user.ban_reason = None
|
||||
send_repeatable_notification(user.id, "Your account has been unbanned!")
|
||||
send_repeatable_notification(user.id, f"@{v.username} has unbanned you!")
|
||||
g.db.add(user)
|
||||
|
||||
for x in user.alts:
|
||||
|
@ -1104,7 +1104,7 @@ def unban_user(user_id, v):
|
|||
x.unban_utc = 0
|
||||
x.ban_evade = 0
|
||||
x.ban_reason = None
|
||||
send_repeatable_notification(x.id, "Your account has been unbanned!")
|
||||
send_repeatable_notification(x.id, f"@{v.username} has unbanned you!")
|
||||
g.db.add(x)
|
||||
|
||||
ma=ModAction(
|
||||
|
|
|
@ -691,7 +691,7 @@ def admin_userawards_post(v):
|
|||
g.db.add(award)
|
||||
|
||||
if v.id != u.id:
|
||||
text = "You were given the following awards:\n\n"
|
||||
text = f"@{v.username} has given the following awards:\n\n"
|
||||
for key, value in notify_awards.items():
|
||||
text += f" - **{value}** {AWARDS[key]['title']} {'Awards' if value != 1 else 'Award'}\n"
|
||||
send_repeatable_notification(u.id, text)
|
||||
|
|
|
@ -131,7 +131,7 @@ def admin_app_approve(v, aid):
|
|||
|
||||
g.db.add(new_auth)
|
||||
|
||||
send_repeatable_notification(user.id, f"Your application `{app.app_name}` has been approved. Here's your access token: `{access_token}`\nPlease check the guide [here](/api) if you don't know what to do next.")
|
||||
send_repeatable_notification(user.id, f"@{v.username} has approved your application `{app.app_name}`. Here's your access token: `{access_token}`\nPlease check the guide [here](/api) if you don't know what to do next.")
|
||||
|
||||
ma = ModAction(
|
||||
kind="approve_app",
|
||||
|
@ -154,7 +154,7 @@ def admin_app_revoke(v, aid):
|
|||
if app:
|
||||
for auth in g.db.query(ClientAuth).filter_by(oauth_client=app.id).all(): g.db.delete(auth)
|
||||
|
||||
send_repeatable_notification(app.author.id, f"Your application `{app.app_name}` has been revoked.")
|
||||
send_repeatable_notification(app.author.id, f"@{v.username} has revoked your application `{app.app_name}`.")
|
||||
|
||||
g.db.delete(app)
|
||||
|
||||
|
@ -180,7 +180,7 @@ def admin_app_reject(v, aid):
|
|||
if app:
|
||||
for auth in g.db.query(ClientAuth).filter_by(oauth_client=app.id).all(): g.db.delete(auth)
|
||||
|
||||
send_repeatable_notification(app.author.id, f"Your application `{app.app_name}` has been rejected.")
|
||||
send_repeatable_notification(app.author.id, f"@{v.username} has rejected your application `{app.app_name}`.")
|
||||
|
||||
g.db.delete(app)
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ def exile_post(v, pid):
|
|||
exile = Exile(user_id=u.id, sub=sub)
|
||||
g.db.add(exile)
|
||||
|
||||
send_notification(u.id, f"You have been exiled from /s/{sub} for [{p.title}]({p.sl})")
|
||||
send_notification(u.id, f"@{v.username} has exiled you from /s/{sub} for [{p.title}]({p.sl})")
|
||||
|
||||
g.db.commit()
|
||||
|
||||
|
@ -55,7 +55,7 @@ def unexile_post(v, pid):
|
|||
exile = g.db.query(Exile).filter_by(user_id=u.id, sub=sub).one_or_none()
|
||||
g.db.delete(exile)
|
||||
|
||||
send_notification(u.id, f"Your exile from /s/{sub} has been revoked!")
|
||||
send_notification(u.id, f"@{v.username} has revoked your exile from /s/{sub}")
|
||||
|
||||
g.db.commit()
|
||||
|
||||
|
@ -82,7 +82,7 @@ def exile_comment(v, cid):
|
|||
exile = Exile(user_id=u.id, sub=sub)
|
||||
g.db.add(exile)
|
||||
|
||||
send_notification(u.id, f"You have been exiled from /s/{sub} for [{c.permalink}]({c.sl})")
|
||||
send_notification(u.id, f"@{v.username} has exiled you from /s/{sub} for [{c.permalink}]({c.sl})")
|
||||
|
||||
g.db.commit()
|
||||
|
||||
|
@ -109,7 +109,7 @@ def unexile_comment(v, cid):
|
|||
exile = g.db.query(Exile).filter_by(user_id=u.id, sub=sub).one_or_none()
|
||||
g.db.delete(exile)
|
||||
|
||||
send_notification(u.id, f"Your exile from /s/{sub} has been revoked!")
|
||||
send_notification(u.id, f"@{v.username} has revoked your exile from /s/{sub}")
|
||||
|
||||
g.db.commit()
|
||||
|
||||
|
@ -212,7 +212,7 @@ def add_mod(v, sub):
|
|||
mod = Mod(user_id=user.id, sub=sub)
|
||||
g.db.add(mod)
|
||||
|
||||
send_repeatable_notification(user.id, f"You have been added as a mod to /s/{sub}")
|
||||
send_repeatable_notification(user.id, f"@{v.username} has added you as a mod to /s/{sub}")
|
||||
|
||||
g.db.commit()
|
||||
|
||||
|
@ -246,7 +246,7 @@ def remove_mod(v, sub):
|
|||
|
||||
g.db.delete(mod)
|
||||
|
||||
send_repeatable_notification(user.id, f"You have been removed as a mod from /s/{sub}")
|
||||
send_repeatable_notification(user.id, f"@{v.username} has removed you as a mod from /s/{sub}")
|
||||
|
||||
g.db.commit()
|
||||
|
||||
|
|
|
@ -226,8 +226,11 @@
|
|||
document.getElementById('post-title').value = localStorage.getItem("post_title")
|
||||
document.getElementById('post-text').value = localStorage.getItem("post_text")
|
||||
document.getElementById('post-url').value = localStorage.getItem("post_url")
|
||||
let sub = document.getElementById('sub')
|
||||
if (sub) sub.value = localStorage.getItem("sub")
|
||||
|
||||
{% if request.path == '/submit' %}
|
||||
let sub = document.getElementById('sub')
|
||||
if (sub) sub.value = localStorage.getItem("sub")
|
||||
{% endif %}
|
||||
|
||||
function checkForRequired() {
|
||||
|
||||
|
|
|
@ -170,11 +170,11 @@
|
|||
{% if v and v.id != u.id %}
|
||||
{% if not u.fish %}<a id="button-unsub" class="btn btn-secondary {% if not is_following %}d-none{% endif %}" role="button" onclick="post_toast2(this,'/unfollow/{{u.username}}','button-unsub','button-sub')">Unfollow</a>{% endif %}
|
||||
<a id="button-sub" class="btn btn-primary {% if is_following or u.is_nofollow or u.is_blocked %}d-none{% endif %}" role="button" onclick="post_toast2(this,'/follow/{{u.username}}','button-unsub','button-sub')">Follow</a>
|
||||
<a class="btn btn-primary" role="button" onclick="toggleElement('profile-toggleable', 'message', 'input-message')">Message</a>
|
||||
<a class="btn btn-primary" role="button" onclick="toggleElement('message', 'input-message')">Message</a>
|
||||
|
||||
<a class="btn btn-primary" role="button" onclick="post_toast(this,'/@{{u.username}}/suicide')">Get them help</a>
|
||||
<a class="btn btn-primary" role="button" onclick="toggleElement('profile-toggleable', 'coin-transfer', 'coin-transfer-amount')">Gift coins</a>
|
||||
<a class="btn btn-primary" role="button" onclick="toggleElement('profile-toggleable', 'bux-transfer', 'bux-transfer-amount')">Gift Marseybux</a>
|
||||
<a class="btn btn-primary" role="button" onclick="toggleElement('coin-transfer', 'coin-transfer-amount')">Gift coins</a>
|
||||
<a class="btn btn-primary" role="button" onclick="toggleElement('bux-transfer', 'bux-transfer-amount')">Gift Marseybux</a>
|
||||
|
||||
{% if v.admin_level > 2 %}
|
||||
<a id="admin" class="{% if u.admin_level > 1 %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2(this,'/@{{u.username}}/make_admin','admin','unadmin')">Make admin</a>
|
||||
|
@ -189,7 +189,7 @@
|
|||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<form class="d-none profile-toggleable" id="message" action="/@{{u.username}}/message" onsubmit="submitFormAjax(event)">
|
||||
<form class="d-none toggleable" id="message" action="/@{{u.username}}/message" onsubmit="submitFormAjax(event)">
|
||||
<input autocomplete="off" type="hidden" name="formkey" value="{{v.formkey}}">
|
||||
<pre></pre>
|
||||
<textarea autocomplete="off" id="input-message" form="message" name="message" rows="3" minlength="1" maxlength="10000" class="form-control b2" oninput="markdown('input-message', 'message-preview')" required></textarea>
|
||||
|
@ -207,13 +207,13 @@
|
|||
|
||||
<div id="message-preview" class="preview mt-2"></div>
|
||||
|
||||
<div class="d-none mt-3 profile-toggleable" id="coin-transfer">
|
||||
<div class="d-none mt-3 toggleable" id="coin-transfer">
|
||||
<input autocomplete="off" id="coin-transfer-amount" class="form-control" name="amount" type="number" oninput="updateTax()">
|
||||
<div>{{u.username}} will receive <span id="coins-transfer-taxed">0</span> coins</div>
|
||||
<button class="btn btn-primary mt-3" onclick="transferCoins()">Gift</button>
|
||||
</div>
|
||||
|
||||
<div class="d-none mt-3 profile-toggleable" id="bux-transfer">
|
||||
<div class="d-none mt-3 toggleable" id="bux-transfer">
|
||||
<input autocomplete="off" id="bux-transfer-amount" class="form-control" name="amount" type="number" oninput="updateBux()">
|
||||
<div>{{u.username}} will receive <span id="bux-transfer-taxed">0</span> marseybux</div>
|
||||
<button class="btn btn-primary mt-3" onclick="transferBux()">Gift</button>
|
||||
|
@ -481,10 +481,10 @@
|
|||
{% if v and v.id != u.id %}
|
||||
{% if not u.fish %}<a id="button-unsub2" class="btn btn-secondary {% if not is_following %}d-none{% endif %}" role="button" onclick="post_toast2(this,'/unfollow/{{u.username}}','button-unsub2','button-sub2')">Unfollow</a>{% endif %}
|
||||
<a id="button-sub2" class="btn btn-primary {% if is_following or u.is_nofollow or u.is_blocked %}d-none{% endif %}" role="button" onclick="post_toast2(this,'/follow/{{u.username}}','button-unsub2','button-sub2')">Follow</a>
|
||||
<a class="btn btn-primary" role="button" onclick="toggleElement('profile-toggleable-mobile', 'message-mobile', 'input-message-mobile')">Message</a>
|
||||
<a class="btn btn-primary" role="button" onclick="toggleElement('message-mobile', 'input-message-mobile')">Message</a>
|
||||
<a class="btn btn-primary" role="button" onclick="post_toast(this,'/@{{u.username}}/suicide')">Get them help</a>
|
||||
<a class="btn btn-primary" role="button" onclick="toggleElement('profile-toggleable-mobile', 'coin-transfer-mobile', 'coin-transfer-amount-mobile')">Gift coins</a>
|
||||
<a class="btn btn-primary" role="button" onclick="toggleElement('profile-toggleable', 'bux-transfer-mobile', 'bux-transfer-amount-mobile')">Gift Marseybux</a>
|
||||
<a class="btn btn-primary" role="button" onclick="toggleElement('coin-transfer-mobile', 'coin-transfer-amount-mobile')">Gift coins</a>
|
||||
<a class="btn btn-primary" role="button" onclick="toggleElement('bux-transfer-mobile', 'bux-transfer-amount-mobile')">Gift Marseybux</a>
|
||||
|
||||
{% if v.admin_level > 2 %}
|
||||
<a id="admin2" class="{% if u.admin_level > 1 %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2(this,'/@{{u.username}}/make_admin','admin2','unadmin2')">Make admin</a>
|
||||
|
@ -499,7 +499,7 @@
|
|||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<form class="d-none profile-toggleable-mobile" id='message-mobile' action="/@{{u.username}}/message" onsubmit="submitFormAjax(event)">
|
||||
<form class="d-none toggleable" id='message-mobile' action="/@{{u.username}}/message" onsubmit="submitFormAjax(event)">
|
||||
<pre></pre>
|
||||
<input autocomplete="off" type="hidden" name="formkey" value="{{v.formkey}}">
|
||||
<textarea autocomplete="off" id="input-message-mobile" form="message-mobile" name="message" rows="3" minlength="1" maxlength="10000" class="form-control" oninput="markdown('input-message-mobile', 'message-preview-mobile')" required></textarea>
|
||||
|
@ -517,13 +517,13 @@
|
|||
|
||||
<div id="message-preview-mobile" class="preview my-3"></div>
|
||||
|
||||
<div class="d-none mt-3 profile-toggleable-mobile" id="coin-transfer-mobile">
|
||||
<div class="d-none mt-3 toggleable" id="coin-transfer-mobile">
|
||||
<input autocomplete="off" id="coin-transfer-amount-mobile" class="form-control" name="amount" type="number" oninput="updateTax(true)">
|
||||
<div>{{u.username}} will receive <span id="coins-transfer-taxed-mobile">0</span> coins</div>
|
||||
<button class="btn btn-primary mt-2 mb-3" onclick="transferCoins(true)">Gift</button>
|
||||
</div>
|
||||
|
||||
<div class="d-none mt-3 profile-toggleable-mobile" id="bux-transfer-mobile">
|
||||
<div class="d-none mt-3 toggleable" id="bux-transfer-mobile">
|
||||
<input autocomplete="off" id="bux-transfer-amount-mobile" class="form-control" name="amount" type="number" oninput="updateBux(true)">
|
||||
<div>{{u.username}} will receive <span id="bux-transfer-taxed-mobile">0</span> marseybux</div>
|
||||
<button class="btn btn-primary mt-2 mb-3" onclick="transferBux(true)">Gift</button>
|
||||
|
@ -737,7 +737,7 @@
|
|||
|
||||
{% if v %}
|
||||
<div id='tax' class="d-none">{% if v.patron or u.patron or v.alts_patron or u.alts_patron %}0{% else %}0.03{% endif %}</div>
|
||||
<script src="/static/assets/js/userpage_v.js?a=242"></script>
|
||||
<script src="/static/assets/js/userpage_v.js?a=243"></script>
|
||||
<div id="username" class="d-none">{{u.username}}</div>
|
||||
{% endif %}
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@
|
|||
|
||||
{% if v %}
|
||||
<div id='tax' class="d-none">{% if v.patron or u.patron %}0{% else %}0.03{% endif %}</div>
|
||||
<script src="/static/assets/js/userpage_v.js?a=242"></script>
|
||||
<script src="/static/assets/js/userpage_v.js?a=243"></script>
|
||||
<div id="username" class="d-none">{{u.username}}</div>
|
||||
{% endif %}
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
|
||||
{% if v %}
|
||||
<div id='tax' class="d-none">{% if v.patron or u.patron %}0{% else %}0.03{% endif %}</div>
|
||||
<script src="/static/assets/js/userpage_v.js?a=242"></script>
|
||||
<script src="/static/assets/js/userpage_v.js?a=243"></script>
|
||||
<div id="username" class="d-none">{{u.username}}</div>
|
||||
{% endif %}
|
||||
|
||||
|
|
Loading…
Reference in New Issue