This commit is contained in:
Aevann1 2022-01-28 04:54:50 +02:00
parent 997e8743ee
commit d2e8c1b817
6 changed files with 25 additions and 23 deletions

View file

@ -522,4 +522,6 @@ NOTIFIED_USERS = {
'landlet': LLM_ID,
'dong': DONGER_ID,
'kippy': KIPPY_ID,
}
}
FORTUNE_REPLIES = ('<b style="color:#6023f8">Your fortune: Outlook good</b>','<b style="color:#d302a7">Your fortune: Godly Luck</b>','<b style="color:#e7890c">Your fortune: Good Luck</b>','<b style="color:#7fec11">Your fortune: Bad Luck</b>','<b style="color:#43fd3b">Your fortune: Good news will come to you by mail</b>','<b style="color:#9d05da">Your fortune: Very Bad Luck</b>','<b style="color:#f51c6a">Your fortune: Reply hazy, try again</b>','<b style="color:#00cbb0">Your fortune: キタ━━━━━━(゚∀゚)━━━━━━ !!!!</b>','<b style="color:#2a56fb">Your fortune: Better not tell you now</b>','<b style="color:#0893e1">Your fortune: You will meet a dark handsome stranger</b>','<b style="color:#16f174">Your fortune:  ´_ゝ`)フーン</b>','<b style="color:#fd4d32">Your fortune: Excellent Luck</b>','<b style="color:#bac200">Your fortune: Average Luck</b>')

View file

@ -238,6 +238,10 @@ def api_comment(v):
if v.agendaposter and not v.marseyawarded: body = torture_ap(body, v.username)
if '#fortune' in body:
body = body.replace('#fortune', '')
body += '\n\n<p>' + random.choice(FORTUNE_REPLIES) + '</p>'
body_html = sanitize(body, comment=True)
if v.marseyawarded and len(list(re.finditer('>[^<\s+]|[^>\s+]<', body_html, flags=re.A))): return {"error":"You can only type marseys!"}, 403
@ -431,11 +435,6 @@ def api_comment(v):
g.db.add(n)
if request.host == "rdrama.net" and random.random() < 0.001:
body = "zoz"

View file

@ -970,3 +970,17 @@ def settings_title_change(v):
g.db.commit()
return redirect(f"{SITE_FULL}/settings/profile")
@app.get("/settings")
@auth_required
def settings(v):
return redirect(f"{SITE_FULL}/settings/profile")
@app.get("/settings/profile")
@auth_required
def settings_profile(v):
if v.flairchanged: ti = datetime.utcfromtimestamp(v.flairchanged).strftime('%Y-%m-%d %H:%M:%S')
else: ti = ''
return render_template("settings_profile.html", v=v, ti=ti)

View file

@ -354,17 +354,6 @@ def images(path):
def robots_txt():
return send_file("assets/robots.txt")
@app.get("/settings")
@auth_required
def settings(v):
return redirect(f"{SITE_FULL}/settings/profile")
@app.get("/settings/profile")
@auth_required
def settings_profile(v):
return render_template("settings_profile.html", v=v)
@app.get("/badges")
@auth_required

View file

@ -1,3 +1,5 @@
<script data-cfasync="false" src="/static/assets/js/emoji_modal.js?a=234"></script>
<div id="form" class="d-none"></div>
<div class="modal fade" id="emojiModal" tabindex="-1" role="dialog" aria-labelledby="emojiModalTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-scrollable modal-dialog-centered p-2 py-5 emoji-modal" role="document">
@ -86,8 +88,6 @@
</div>
</div>
<script src="/static/assets/js/emoji_modal.js?a=234"></script>
<style>
a.emojitab {
padding: 0.5rem 0.7rem !important;

View file

@ -409,7 +409,6 @@
</div>
</div>
{% if not v.flairchanged %}
<div class="body d-lg-flex border-bottom">
<label class="text-black w-lg-25">Flair</label>
@ -418,18 +417,17 @@
<form id="profile-settings" action="/settings/title_change" method="post">
<input autocomplete="off" type="hidden" name="formkey" value="{{v.formkey}}">
<input autocomplete="off" id="customtitlebody" type="text" name="title" class="form-control" placeholder='Enter a flair here' value="{% if v.customtitleplain %}{{v.customtitleplain}}{% endif %}">
<input {% if v.flairchanged %}disabled{% endif %} autocomplete="off" id="customtitlebody" type="text" name="title" class="form-control" placeholder='Enter a flair here' value="{% if v.flairchanged %}Your flair has been locked until {{ti}}{% elif v.customtitleplain %}{{v.customtitleplain}}{% endif %}">
<div class="d-flex mt-2">
<a class="format" role="button"><i class="btn btn-secondary format d-inline-block m-0 fas fa-smile-beam" onclick="loadEmojis('customtitlebody')" aria-hidden="true" data-bs-toggle="modal" data-bs-target="#emojiModal" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="Add Emoji"></i></a>
&nbsp;&nbsp;&nbsp;
<small>Limit of 100 characters</small>
<input autocomplete="off" class="btn btn-primary ml-auto" id="titleSave" type="submit" value="Change Flair">
<input {% if v.flairchanged %}disabled{% endif %} autocomplete="off" class="btn btn-primary ml-auto" id="titleSave" type="submit" value="Change Flair">
</div>
</form>
</div>
</div>
{% endif %}
<div class="body d-lg-flex border-bottom">