sneed
This commit is contained in:
parent
e77561f0c0
commit
8a0083f2df
13 changed files with 53 additions and 23 deletions
|
@ -3969,7 +3969,7 @@ img.emoji {
|
||||||
border-color: #E53E3E !important;
|
border-color: #E53E3E !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
@-webkit-keyframes lgbt {
|
@-webkit-keyframes leaderboard {
|
||||||
0% {
|
0% {
|
||||||
color: violet;
|
color: violet;
|
||||||
}
|
}
|
||||||
|
@ -4060,9 +4060,14 @@ img.emoji {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
* [href$="/@Dw-Im-Here"], * [href$="/@Racist_FemboyV2"], * [href$="/@DudeBussyLmao"], * [href$="/@InfoWarrior"], * [href$="/@Jew"], * [href$="/@Lysis10"], * [href$="/@fuckaveann"], * [href$="/@JimieWhales"], * [href$="/@CRUSTY"], * [href$="/@Aevann"], * [href$="/@Joan_Wayne_Gacy"], * [href$="/@Sylveon"], * [href$="/@SquisheeKisses"], * [href$="/@wangpangthankyoumaam"], * [href$="/@Chapose"], * [href$="/@cumlord"], * [href$="/@Snappy"], * [href$="/@ponyblaze"], * [href$="/@iStillMissEd"], * [href$="/@Account_109_"], * [href$="/@Yall"], * [href$="/@collectijism"], * [href$="/@Need4Sneed"], * [href$="/@BrokeBackBuck"] {
|
.patron {
|
||||||
-webkit-animation: 3s ease-in-out 0s normal none infinite lgbt;
|
-webkit-animation: 3s ease-in-out 0s normal none infinite patron;
|
||||||
animation: 3s ease-in-out 0s normal none infinite lgbt;
|
animation: 3s ease-in-out 0s normal none infinite patron;
|
||||||
|
}
|
||||||
|
|
||||||
|
.leaderboard {
|
||||||
|
-webkit-animation: 3s ease-in-out 0s normal none infinite leaderboard;
|
||||||
|
animation: 3s ease-in-out 0s normal none infinite leaderboard;
|
||||||
}
|
}
|
||||||
|
|
||||||
* [href$="/@Landlord_Messiah"] {
|
* [href$="/@Landlord_Messiah"] {
|
||||||
|
@ -4096,11 +4101,6 @@ img.emoji {
|
||||||
box-shadow: none !important;
|
box-shadow: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.patron {
|
|
||||||
-webkit-animation: 3s ease-in-out 0s normal none infinite patron;
|
|
||||||
animation: 3s ease-in-out 0s normal none infinite patron;
|
|
||||||
}
|
|
||||||
|
|
||||||
.px-25 {
|
.px-25 {
|
||||||
padding-left: 0.8rem !important;
|
padding-left: 0.8rem !important;
|
||||||
padding-right: 0.8rem !important;
|
padding-right: 0.8rem !important;
|
||||||
|
|
|
@ -32,6 +32,7 @@ class User(Base, Stndrd, Age_times):
|
||||||
profileurl = Column(String, default=None)
|
profileurl = Column(String, default=None)
|
||||||
bannerurl = Column(String, default=None)
|
bannerurl = Column(String, default=None)
|
||||||
patron = Column(Boolean, default=False)
|
patron = Column(Boolean, default=False)
|
||||||
|
animatedname = Column(Boolean, default=False)
|
||||||
email = Column(String, default=None)
|
email = Column(String, default=None)
|
||||||
css = deferred(Column(String, default=None))
|
css = deferred(Column(String, default=None))
|
||||||
profilecss = deferred(Column(String, default=None))
|
profilecss = deferred(Column(String, default=None))
|
||||||
|
|
|
@ -195,6 +195,7 @@ def badge_grant_post(v):
|
||||||
|
|
||||||
if badge_id in [21,22,23,24]:
|
if badge_id in [21,22,23,24]:
|
||||||
user.patron = True
|
user.patron = True
|
||||||
|
user.animatedname = True
|
||||||
g.db.add(user)
|
g.db.add(user)
|
||||||
|
|
||||||
return redirect(user.permalink)
|
return redirect(user.permalink)
|
||||||
|
|
|
@ -50,7 +50,7 @@ def banawardcomment(comment_id, v):
|
||||||
comment.banaward = v.username
|
comment.banaward = v.username
|
||||||
g.db.add(comment)
|
g.db.add(comment)
|
||||||
|
|
||||||
return jsonify({"message": "User banned successfully!"}), 200
|
return jsonify({"message": "User banned successfully!"}), 204
|
||||||
|
|
||||||
|
|
||||||
@app.route("/api/v1/post/<pid>/comment/<cid>", methods=["GET"])
|
@app.route("/api/v1/post/<pid>/comment/<cid>", methods=["GET"])
|
||||||
|
|
|
@ -70,7 +70,7 @@ def postbanaward(post_id, v):
|
||||||
post.banaward = v.username
|
post.banaward = v.username
|
||||||
g.db.add(post)
|
g.db.add(post)
|
||||||
|
|
||||||
return jsonify({"message": "User banned successfully!"}), 200
|
return jsonify({"message": "User banned successfully!"}), 204
|
||||||
|
|
||||||
@app.route("/api/publish/<pid>", methods=["POST"])
|
@app.route("/api/publish/<pid>", methods=["POST"])
|
||||||
@is_not_banned
|
@is_not_banned
|
||||||
|
|
|
@ -7,6 +7,7 @@ from drama.helpers.discord import remove_user, set_nick
|
||||||
from drama.mail import *
|
from drama.mail import *
|
||||||
from .front import frontlist
|
from .front import frontlist
|
||||||
from drama.__main__ import app, cache
|
from drama.__main__ import app, cache
|
||||||
|
from .users import leaderboard
|
||||||
import youtube_dl
|
import youtube_dl
|
||||||
|
|
||||||
valid_username_regex = re.compile("^[a-zA-Z0-9_\-]{3,25}$")
|
valid_username_regex = re.compile("^[a-zA-Z0-9_\-]{3,25}$")
|
||||||
|
@ -63,6 +64,13 @@ def settings_profile_post(v):
|
||||||
updated = True
|
updated = True
|
||||||
v.is_private = request.values.get("private", None) == 'true'
|
v.is_private = request.values.get("private", None) == 'true'
|
||||||
|
|
||||||
|
if request.values.get("animatedname", v.animatedname) != v.animatedname:
|
||||||
|
if v.animatedname == False:
|
||||||
|
users1, users2 = leaderboard()
|
||||||
|
if v not in users1 and v not in users2: return jsonify({"error": "You must be in the leaderboard to apply animated name!"}), 403
|
||||||
|
updated = True
|
||||||
|
v.animatedname = request.values.get("animatedname", None) == 'true'
|
||||||
|
|
||||||
if request.values.get("nofollow", v.is_nofollow) != v.is_nofollow:
|
if request.values.get("nofollow", v.is_nofollow) != v.is_nofollow:
|
||||||
updated = True
|
updated = True
|
||||||
v.is_nofollow = request.values.get("nofollow", None) == 'true'
|
v.is_nofollow = request.values.get("nofollow", None) == 'true'
|
||||||
|
|
|
@ -25,7 +25,6 @@ def user_info(v, username):
|
||||||
user = get_user(username, v=v)
|
user = get_user(username, v=v)
|
||||||
return jsonify(user.json)
|
return jsonify(user.json)
|
||||||
|
|
||||||
|
|
||||||
@app.route("/leaderboard", methods=["GET"])
|
@app.route("/leaderboard", methods=["GET"])
|
||||||
@auth_desired
|
@auth_desired
|
||||||
def leaderboard(v):
|
def leaderboard(v):
|
||||||
|
@ -39,9 +38,9 @@ def leaderboard(v):
|
||||||
@cache.memoize(timeout=86400)
|
@cache.memoize(timeout=86400)
|
||||||
def leaderboard():
|
def leaderboard():
|
||||||
users = g.db.query(User).options(lazyload('*'))
|
users = g.db.query(User).options(lazyload('*'))
|
||||||
users1= sorted(users, key=lambda x: x.dramacoins, reverse=True)[:100]
|
users1= sorted(users, key=lambda x: x.dramacoins, reverse=True)[:25]
|
||||||
users2 = sorted(users1, key=lambda x: x.follower_count, reverse=True)[:10]
|
users2 = users.order_by(User.follower_count.desc()).limit(10).all()
|
||||||
return users1[:25], users2
|
return users1, users2
|
||||||
|
|
||||||
@app.get("/@<username>/css")
|
@app.get("/@<username>/css")
|
||||||
def get_css(username):
|
def get_css(username):
|
||||||
|
|
|
@ -13,9 +13,9 @@
|
||||||
{% for user in users %}
|
{% for user in users %}
|
||||||
<tr>
|
<tr>
|
||||||
<td style="font-weight:bold;">{{users.index(user)+1}}</td>
|
<td style="font-weight:bold;">{{users.index(user)+1}}</td>
|
||||||
<td><a {% if user.patron %}class="patron"{% endif %} style="color:#{{user.namecolor}}; font-weight:bold;" href="/@{{user.username}}">{{user.username}}</a></td>
|
<td><a {% if user.animatedname %}class="{% if user.patron %}patron{% else %}leaderboard{% endif %}"{% endif %} style="color:#{{user.namecolor}}; font-weight:bold;" href="/@{{user.username}}">{{user.username}}</a></td>
|
||||||
<td style="font-weight:bold;">{% if user.ban_reason %}{{user.ban_reason}}{% endif %}</td>
|
<td style="font-weight:bold;">{% if user.ban_reason %}{{user.ban_reason}}{% endif %}</td>
|
||||||
<td><a {% if user.banned_by.patron %}class="patron"{% endif %} style="color:#{{user.banned_by.namecolor}}; font-weight:bold;" href="/@{{user.banned_by.username}}">{{user.banned_by.username}}</a></td>
|
<td><a {% if user.banned_by.animatedname %}class="{% if user.banned_by.patron %}patron{% else %}leaderboard{% endif %} style="color:#{{user.banned_by.namecolor}}; font-weight:bold;" href="/@{{user.banned_by.username}}">{{user.banned_by.username}}</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
</thead>
|
</thead>
|
||||||
{% for user in users %}
|
{% for user in users %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><a {% if user.patron %}class="patron"{% endif %} style="font-weight:bold;color:#{{user.namecolor}};" href="/@{{user.username}}">{{user.username}}</a></td>
|
<td><a {% if user.animatedname %}class="{% if user.patron %}patron{% else %}leaderboard{% endif %}"{% endif %} style="font-weight:bold;color:#{{user.namecolor}};" href="/@{{user.username}}">{{user.username}}</a></td>
|
||||||
<td><a {% if targets[loop.index-1].patron %}class="patron"{% endif %} style="font-weight:bold;color:#{{targets[loop.index-1].namecolor}};" href="/@{{targets[loop.index-1].username}}">{{targets[loop.index-1].username}}</a></td>
|
<td><a {% if targets[loop.index-1].animatedname %}class="{% if targets[loop.index-1].patron %}patron{% else %}leaderboard{% endif %}"{% endif %} style="font-weight:bold;color:#{{targets[loop.index-1].namecolor}};" href="/@{{targets[loop.index-1].username}}">{{targets[loop.index-1].username}}</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -125,7 +125,7 @@
|
||||||
{% if c.is_blocking %}<i class="fas fa-user-minus text-warning" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="You're blocking this user, but you can see this comment because {{'it\'s an admin comment' if c.distinguish_level else 'you\'re an admin'}}."></i> {% endif %}
|
{% if c.is_blocking %}<i class="fas fa-user-minus text-warning" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="You're blocking this user, but you can see this comment because {{'it\'s an admin comment' if c.distinguish_level else 'you\'re an admin'}}."></i> {% endif %}
|
||||||
{% if c.is_blocked %}<i class="fas fa-user-minus text-danger" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="This user is blocking you, but you can see this comment because {{'it\'s an admin comment' if c.distinguish_level else 'you\'re an admin'}}."></i> {% endif %}
|
{% if c.is_blocked %}<i class="fas fa-user-minus text-danger" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="This user is blocking you, but you can see this comment because {{'it\'s an admin comment' if c.distinguish_level else 'you\'re an admin'}}."></i> {% endif %}
|
||||||
|
|
||||||
{% if c.author.is_deleted %}[deleted account]{% else %}<a {% if c.author.patron %}class="patron"{% endif %} style="color:#{{c.author.namecolor}}; font-size:12px; font-weight:bold;" href="/@{{c.author.username}}">{{c.author.username}}</a>{% if c.author.customtitle %} <bdi style="color: #{{c.author.titlecolor}}"> {{c.author.customtitle | safe}}</bdi>{% endif %}{% endif %}
|
{% if c.author.is_deleted %}[deleted account]{% else %}<a {% if c.author.animatedname %}class="{% if c.author.patron %}patron{% else %}leaderboard{% endif %}"{% endif %} style="color:#{{c.author.namecolor}}; font-size:12px; font-weight:bold;" href="/@{{c.author.username}}">{{c.author.username}}</a>{% if c.author.customtitle %} <bdi style="color: #{{c.author.titlecolor}}"> {{c.author.customtitle | safe}}</bdi>{% endif %}{% endif %}
|
||||||
|
|
||||||
<span id="timestamp-{{c.id}}" data-toggle="tooltip" data-placement="bottom" title="" class="time-stamp"> {{c.age_string}}</span>
|
<span id="timestamp-{{c.id}}" data-toggle="tooltip" data-placement="bottom" title="" class="time-stamp"> {{c.age_string}}</span>
|
||||||
{% if c.edited_utc %}
|
{% if c.edited_utc %}
|
||||||
|
|
|
@ -338,6 +338,27 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="d-lg-flex border-bottom">
|
||||||
|
|
||||||
|
<div class="title w-lg-25">
|
||||||
|
<label for="animatedname">Animated Username</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="body w-lg-100">
|
||||||
|
|
||||||
|
<div class="custom-control custom-switch">
|
||||||
|
<input type="checkbox" class="custom-control-input" id="animatedname" name="animatedname"{% if v.animatedname%} checked{% endif %} onchange="post_toast('/settings/profile?animatedname='+document.getElementById('animatedname').checked)">
|
||||||
|
<label class="custom-control-label" for="animatedname"></label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<span class="text-small-extra text-muted">Enable animated username (only available to users in the leaderboard and patrons)</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if not v.flairchanged %}
|
{% if not v.flairchanged %}
|
||||||
|
|
|
@ -233,7 +233,7 @@
|
||||||
{% if p.private %}<span class="badge border-warning border-1 text-small-extra">unlisted</span>{% endif %}
|
{% if p.private %}<span class="badge border-warning border-1 text-small-extra">unlisted</span>{% endif %}
|
||||||
{% if p.is_repost %}<span class="badge border-warning border-1 text-small-extra"><a class="text-warning" href="{{p.reposts.permalink}}">repost</a></span>{% endif %}
|
{% if p.is_repost %}<span class="badge border-warning border-1 text-small-extra"><a class="text-warning" href="{{p.reposts.permalink}}">repost</a></span>{% endif %}
|
||||||
{% if p.active_flags %}<a class="btn btn-primary" href="javascript:void(0)" style="padding:1px 5px;" onclick="document.getElementById('flaggers').classList.toggle('d-none')">{{p.active_flags}} Flags</a>{% endif %}
|
{% if p.active_flags %}<a class="btn btn-primary" href="javascript:void(0)" style="padding:1px 5px;" onclick="document.getElementById('flaggers').classList.toggle('d-none')">{{p.active_flags}} Flags</a>{% endif %}
|
||||||
{% if p.author.is_deleted %}[deleted account]{% else %} <a {% if p.author.patron %}class="patron"{% endif %} href="{{p.author.permalink}}" style="color: #{{p.author.namecolor}}; font-weight: bold;" class="user-name"> {{p.author.username}}</a>{% if p.author.customtitle %} <bdi style="color: #{{p.author.titlecolor}}"> {{p.author.customtitle | safe}}</bdi>{% endif %}{% endif %}
|
{% if p.author.is_deleted %}[deleted account]{% else %} <a {% if p.author.animatedname %}class="{% if p.author.patron %}patron{% else %}leaderboard{% endif %}"{% endif %} href="{{p.author.permalink}}" style="color: #{{p.author.namecolor}}; font-weight: bold;" class="user-name"> {{p.author.username}}</a>{% if p.author.customtitle %} <bdi style="color: #{{p.author.titlecolor}}"> {{p.author.customtitle | safe}}</bdi>{% endif %}{% endif %}
|
||||||
<span data-toggle="tooltip" data-placement="bottom" id="timestamp" title=""> {{p.age_string}}</span>
|
<span data-toggle="tooltip" data-placement="bottom" id="timestamp" title=""> {{p.age_string}}</span>
|
||||||
({% if p.realurl(v) %}<a href="/search/posts/?q=domain%3A{{p.domain}}&sort=new&t=all" {% if v and v.newtabexternal %}target="_blank"{% endif %}>{{p.domain}}</a>{% else %}text post{% endif %})
|
({% if p.realurl(v) %}<a href="/search/posts/?q=domain%3A{{p.domain}}&sort=new&t=all" {% if v and v.newtabexternal %}target="_blank"{% endif %}>{{p.domain}}</a>{% else %}text post{% endif %})
|
||||||
|
|
||||||
|
|
|
@ -141,7 +141,7 @@
|
||||||
{% if p.private %}<span class="text-warning"><i class="far fa-eye-slash text-small mr-1"></i>unlisted</span> {% endif %}
|
{% if p.private %}<span class="text-warning"><i class="far fa-eye-slash text-small mr-1"></i>unlisted</span> {% endif %}
|
||||||
{% if p.is_repost %}<span class="text-warning"><i class="far fa-sync text-small mr-1"></i><a class="text-warning" href="{{p.reposts.permalink}}">repost</a></span> {% endif %}
|
{% if p.is_repost %}<span class="text-warning"><i class="far fa-sync text-small mr-1"></i><a class="text-warning" href="{{p.reposts.permalink}}">repost</a></span> {% endif %}
|
||||||
{% if p.active_flags %} <a class="btn btn-primary" style="padding:1px 5px;" href="javascript:void(0)" onclick="document.getElementById('flaggers-{{p.id}}').classList.toggle('d-none')">{{p.active_flags}} Flags</a>{% endif %}
|
{% if p.active_flags %} <a class="btn btn-primary" style="padding:1px 5px;" href="javascript:void(0)" onclick="document.getElementById('flaggers-{{p.id}}').classList.toggle('d-none')">{{p.active_flags}} Flags</a>{% endif %}
|
||||||
{% if p.author.is_deleted %}[deleted account]{% else %} <a {% if p.author.patron %}class="patron"{% endif %} href="{{p.author.permalink}}" style="color: #{{p.author.namecolor}}; font-weight: bold;; font-weight: bold;" class="user-name">{{p.author.username}}</a>{% if p.author.customtitle %}<bdi style="color: #{{p.author.titlecolor}}"> {{p.author.customtitle | safe}}</bdi>{% endif %}
|
{% if p.author.is_deleted %}[deleted account]{% else %} <a {% if p.author.animatedname %}class="{% if p.author.patron %}patron{% else %}leaderboard{% endif %}"{% endif %} href="{{p.author.permalink}}" style="color: #{{p.author.namecolor}}; font-weight: bold;; font-weight: bold;" class="user-name">{{p.author.username}}</a>{% if p.author.customtitle %}<bdi style="color: #{{p.author.titlecolor}}"> {{p.author.customtitle | safe}}</bdi>{% endif %}
|
||||||
<span data-toggle="tooltip" data-placement="bottom" id="timestamp-{{p.id}}" title=""> {{p.age_string}}</span>
|
<span data-toggle="tooltip" data-placement="bottom" id="timestamp-{{p.id}}" title=""> {{p.age_string}}</span>
|
||||||
{% endif %} ({{p.domain}})
|
{% endif %} ({{p.domain}})
|
||||||
|
|
||||||
|
@ -163,7 +163,7 @@
|
||||||
{% if p.private %}<span class="badge border-warning border-1 text-small-extra">unlisted</span>{% endif %}
|
{% if p.private %}<span class="badge border-warning border-1 text-small-extra">unlisted</span>{% endif %}
|
||||||
{% if p.is_repost %} <span class="badge border-warning border-1 text-small-extra"><a class="text-warning" href="{{p.reposts.permalink}}">repost</a></span>{% endif %}
|
{% if p.is_repost %} <span class="badge border-warning border-1 text-small-extra"><a class="text-warning" href="{{p.reposts.permalink}}">repost</a></span>{% endif %}
|
||||||
{% if p.active_flags %}<a class="btn btn-primary" href="javascript:void(0)" style="padding:1px 5px;" onclick="document.getElementById('flaggers-{{p.id}}').classList.toggle('d-none')">{{p.active_flags}} Flags</a>{% endif %}
|
{% if p.active_flags %}<a class="btn btn-primary" href="javascript:void(0)" style="padding:1px 5px;" onclick="document.getElementById('flaggers-{{p.id}}').classList.toggle('d-none')">{{p.active_flags}} Flags</a>{% endif %}
|
||||||
{% if p.author.is_deleted %}[deleted account]{% else %} <a {% if p.author.patron %}class="patron"{% endif %} href="{{p.author.permalink}}" style="color: #{{p.author.namecolor}}; font-weight: bold;" class="user-name">{{p.author.username}}</a>{% if p.author.customtitle %}<bdi style="color: #{{p.author.titlecolor}}"> {{p.author.customtitle | safe}}</bdi>{% endif %}{% endif %}
|
{% if p.author.is_deleted %}[deleted account]{% else %} <a {% if p.author.animatedname %}class="{% if p.author.patron %}patron{% else %}leaderboard{% endif %}"{% endif %} href="{{p.author.permalink}}" style="color: #{{p.author.namecolor}}; font-weight: bold;" class="user-name">{{p.author.username}}</a>{% if p.author.customtitle %}<bdi style="color: #{{p.author.titlecolor}}"> {{p.author.customtitle | safe}}</bdi>{% endif %}{% endif %}
|
||||||
<span data-toggle="tooltip" data-placement="bottom" id="timestamp-{{p.id}}-2" title=""> {{p.age_string}}</span>
|
<span data-toggle="tooltip" data-placement="bottom" id="timestamp-{{p.id}}-2" title=""> {{p.age_string}}</span>
|
||||||
|
|
||||||
({% if p.realurl(v) %}<a href="/search/posts/?q=domain%3A{{p.domain}}&sort=new&t=all" target="_blank">{{p.domain}}</a>{% else %}text post{% endif %})
|
({% if p.realurl(v) %}<a href="/search/posts/?q=domain%3A{{p.domain}}&sort=new&t=all" target="_blank">{{p.domain}}</a>{% else %}text post{% endif %})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue