forked from rDrama/rDrama
Merge branch 'master' of https://github.com/Aevann1/Drama
commit
dbee54930f
|
@ -48,9 +48,9 @@ app.config["SESSION_COOKIE_SAMESITE"] = "Lax"
|
|||
app.config["PERMANENT_SESSION_LIFETIME"] = 60 * 60 * 24 * 365
|
||||
app.config["SESSION_REFRESH_EACH_REQUEST"] = True
|
||||
|
||||
app.config["SLOGAN"] = environ.get("SLOGAN").strip()
|
||||
app.config["DEFAULT_COLOR"] = environ.get("DEFAULT_COLOR").strip()
|
||||
app.config["DEFAULT_THEME"] = environ.get("DEFAULT_THEME").strip() + "_" + environ.get("DEFAULT_COLOR").strip()
|
||||
app.config["SLOGAN"] = environ.get("SLOGAN", "").strip()
|
||||
app.config["DEFAULT_COLOR"] = environ.get("DEFAULT_COLOR", "ff0000").strip()
|
||||
app.config["DEFAULT_THEME"] = environ.get("DEFAULT_THEME", "light").strip() + "_" + environ.get("DEFAULT_COLOR", "ff0000").strip()
|
||||
|
||||
app.config["FORCE_HTTPS"] = int(environ.get("FORCE_HTTPS", 1)) if ("localhost" not in app.config["SERVER_NAME"] and "127.0.0.1" not in app.config["SERVER_NAME"]) else 0
|
||||
|
||||
|
@ -107,7 +107,7 @@ app.config["RATELIMIT_HEADERS_ENABLED"]=True
|
|||
limiter = Limiter(
|
||||
app,
|
||||
key_func=get_ipaddr,
|
||||
default_limits=["100/minute"],
|
||||
#default_limits=["100/minute"],
|
||||
headers_enabled=True,
|
||||
strategy="fixed-window"
|
||||
)
|
||||
|
|
|
@ -20,6 +20,13 @@ if site_name == "Drama":
|
|||
"description": "Let OP know how much their post sucks ass. Flies will swarm their idiotic post. (flies only work on posts lol!!)",
|
||||
"icon": "fas fa-poop",
|
||||
"color": "text-black-50"
|
||||
},
|
||||
"gold": {
|
||||
"kind": "gold",
|
||||
"title": "Gold",
|
||||
"description": "A positive award because we need a positive award. Puts annoying sparkles in the post.",
|
||||
"icon": "fas fa-sparkles",
|
||||
"color": "text-warning"
|
||||
}
|
||||
}
|
||||
else:
|
||||
|
|
|
@ -172,6 +172,8 @@ class Comment(Base, Age_times, Scores, Stndrd, Fuzzing):
|
|||
|
||||
return data
|
||||
|
||||
def award_count(self, kind) -> int:
|
||||
return len([x for x in self.awards if x.kind == kind])
|
||||
|
||||
@property
|
||||
def json_core(self):
|
||||
|
|
|
@ -29,7 +29,8 @@ ACTIONS = {
|
|||
|
||||
ALLOW_MULTIPLE = (
|
||||
"ban",
|
||||
"shit"
|
||||
"shit",
|
||||
"gold"
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -15,8 +15,6 @@
|
|||
|
||||
{% if (c.is_banned or c.deleted_utc > 0 or c.is_blocking or c.is_blocked) and not (v and v.admin_level>0) and not (v and v.id==c.author_id) %}
|
||||
|
||||
|
||||
|
||||
<div id="comment-{{c.id}}" class="comment">
|
||||
|
||||
|
||||
|
|
|
@ -190,9 +190,43 @@
|
|||
</script>
|
||||
{% endif %}
|
||||
|
||||
<script src="/assets/js/sparkle.min.js" type="text/javascript"></script>
|
||||
|
||||
{% if p.award_count("gold") %}
|
||||
{% set sparkles = 10*p.award_count("gold") if p.award_count("gold") <= 5 else 50 %}
|
||||
<style>
|
||||
#post-body {
|
||||
z-index: 50;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
document.querySelector("#post-body").sparkle({
|
||||
count: {{ sparkles }},
|
||||
minAge: 500,
|
||||
maxAge: 1000,
|
||||
position: "afterend",
|
||||
starsource: `
|
||||
<svg
|
||||
width="100%"
|
||||
height="100%"
|
||||
viewBox="0 0 15 15"
|
||||
version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg" x
|
||||
mlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xml:space="preserve"
|
||||
xmlns:serif="http://www.serif.com/"
|
||||
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<path d="M1.125,4.95l4.462,0l1.913,-3.825l0.637,3.825l5.738,0l-4.463,3.188l0.638,5.737l-3.187,-3.825l-4.463,3.825l1.913,-5.737l-3.188,-3.188Z"
|
||||
style="fill:#aaad00;">
|
||||
</path>
|
||||
</svg>`,
|
||||
});
|
||||
</script>
|
||||
{% endif %}
|
||||
|
||||
<div class="row mb-3">
|
||||
|
||||
<div class="col-12">
|
||||
<div id="post-root" class="col-12">
|
||||
|
||||
<div id="post-{{p.id}}" class="card border-0 mt-3{% if p.is_suspended %} banned{% endif %}{% if p.stickied %} stickied{% endif %}{% if voted==1 %} upvoted{% elif voted==-1 %} downvoted{% endif %}">
|
||||
<div class="{% if p.deleted_utc > 0 %}deleted {% endif %}d-flex flex-row-reverse flex-nowrap justify-content-end">
|
||||
|
@ -278,7 +312,9 @@
|
|||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{{p.realbody(v) | safe}}
|
||||
<div id="post-text" style="z-index: 50">
|
||||
{{p.realbody(v) | safe}}
|
||||
</div>
|
||||
|
||||
{% if p.domain == "twitter.com" and (v and v.theme.split("_")[0] in ["light", "coffee", "4chan"]) %}
|
||||
{% include "embeds/twitterlight.html" %}
|
||||
|
|
Loading…
Reference in New Issue