diff --git a/files/helpers/const.py b/files/helpers/const.py index bae461b0f..350384c42 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -370,21 +370,21 @@ AWARDS = { "price": 300 }, "wholesome": { - "kind": "wholesome", - "title": "Wholesome", - "description": "Summons a wholesome marsey on the post.", - "icon": "fas fa-smile-beam", - "color": "text-yellow", - "price": 300 - }, + "kind": "wholesome", + "title": "Wholesome", + "description": "Summons a wholesome marsey on the post.", + "icon": "fas fa-smile-beam", + "color": "text-yellow", + "price": 300 + }, "tilt": { - "kind": "tilt", - "title": "Tilt", - "description": "Tilts the post or comment", - "icon": "fas fa-car-tilt", - "color": "text-blue", - "price": 300 - }, + "kind": "tilt", + "title": "Tilt", + "description": "Tilts the post or comment", + "icon": "fas fa-car-tilt", + "color": "text-blue", + "price": 300 + }, "ghosts": { "kind": "ghosts", "title": "Ghosts", @@ -394,21 +394,21 @@ AWARDS = { "price": 500 }, "rehab": { - "kind": "rehab", - "title": "Rehab", - "description": "Prevents the user from gambling for 24 hours in a last ditch effort to save them from themself.", - "icon": "fas fa-dice-six", - "color": "text-black", - "price": 777 - }, + "kind": "rehab", + "title": "Rehab", + "description": "Prevents the user from gambling for 24 hours in a last ditch effort to save them from themself.", + "icon": "fas fa-dice-six", + "color": "text-black", + "price": 777 + }, "progressivestack": { - "kind": "progressivestack", - "title": "Progressive Stack", - "description": "Makes votes on the recipient's posts and comments weigh double in the ranking algorithm for 6 hours.", - "icon": "fas fa-bullhorn", - "color": "text-red", - "price": 1000 - }, + "kind": "progressivestack", + "title": "Progressive Stack", + "description": "Makes votes on the recipient's posts and comments weigh double in the ranking algorithm for 6 hours.", + "icon": "fas fa-bullhorn", + "color": "text-red", + "price": 1000 + }, "pin": { "kind": "pin", "title": "1-Hour Pin", @@ -482,13 +482,13 @@ AWARDS = { "price": 3500 }, "benefactor": { - "kind": "benefactor", - "title": "Benefactor", - "description": "Grants one month of paypig status and 2500 marseybux to the recipient. Cannot be used on yourself.", - "icon": "fas fa-gift", - "color": "text-blue", - "price": 4000 - }, + "kind": "benefactor", + "title": "Benefactor", + "description": "Grants one month of paypig status and 2500 marseybux to the recipient. Cannot be used on yourself.", + "icon": "fas fa-gift", + "color": "text-blue", + "price": 4000 + }, "grass": { "kind": "grass", "title": "Grass", diff --git a/files/helpers/get.py b/files/helpers/get.py index 7d4902f40..0d2fbed44 100644 --- a/files/helpers/get.py +++ b/files/helpers/get.py @@ -194,9 +194,10 @@ def get_comment(i, v=None, graceful=False): UserBlock.user_id == v.id, UserBlock.target_id == comment.author_id ), - and_(UserBlock.user_id == comment.author_id, - UserBlock.target_id == v.id - ) + and_( + UserBlock.user_id == comment.author_id, + UserBlock.target_id == v.id + ) ) ).one_or_none() diff --git a/files/routes/awards.py b/files/routes/awards.py index 013ee611f..b8f03f4d7 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -43,21 +43,21 @@ AWARDS3 = { "price": 300 }, "wholesome": { - "kind": "wholesome", - "title": "Wholesome", - "description": "Summons a wholesome marsey on the post.", - "icon": "fas fa-smile-beam", - "color": "text-yellow", - "price": 300 - }, + "kind": "wholesome", + "title": "Wholesome", + "description": "Summons a wholesome marsey on the post.", + "icon": "fas fa-smile-beam", + "color": "text-yellow", + "price": 300 + }, "tilt": { - "kind": "tilt", - "title": "Tilt", - "description": "Tilts the post by 1 degree (up to 4)", - "icon": "fas fa-car-tilt", - "color": "text-blue", - "price": 300 - }, + "kind": "tilt", + "title": "Tilt", + "description": "Tilts the post by 1 degree (up to 4)", + "icon": "fas fa-car-tilt", + "color": "text-blue", + "price": 300 + }, } @app.get("/shop") @@ -203,12 +203,10 @@ def award_post(pid, v): return {"error": "That award doesn't exist."}, 404 post_award = g.db.query(AwardRelationship).filter( - and_( - AwardRelationship.kind == kind, - AwardRelationship.user_id == v.id, - AwardRelationship.submission_id == None, - AwardRelationship.comment_id == None - ) + AwardRelationship.kind == kind, + AwardRelationship.user_id == v.id, + AwardRelationship.submission_id == None, + AwardRelationship.comment_id == None ).first() if not post_award: @@ -439,12 +437,10 @@ def award_comment(cid, v): return {"error": "That award doesn't exist."}, 404 comment_award = g.db.query(AwardRelationship).filter( - and_( - AwardRelationship.kind == kind, - AwardRelationship.user_id == v.id, - AwardRelationship.submission_id == None, - AwardRelationship.comment_id == None - ) + AwardRelationship.kind == kind, + AwardRelationship.user_id == v.id, + AwardRelationship.submission_id == None, + AwardRelationship.comment_id == None ).first() if not comment_award: diff --git a/files/routes/posts.py b/files/routes/posts.py index 805db2886..340af2ee0 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -52,6 +52,20 @@ def ghost_price(v): return int(500*discount) + +def submit_ghost(v,db): + ghost = db.query(AwardRelationship.id).filter( + AwardRelationship.kind == 'ghosts', + AwardRelationship.user_id == v.id, + AwardRelationship.submission_id == None, + AwardRelationship.comment_id == None + ).first() + + if ghost: ghost = 42069 + else: ghost = ghost_price(v) + return ghost + + @app.post("/toggle_club/") @auth_required def toggle_club(pid, v): @@ -112,7 +126,7 @@ def submit_get(v, sub=None): if request.path.startswith('/s/') and not sub: abort(404) - return render_template("submit.html", SUBS=() if SITE_NAME == 'Drama' else tuple(x[0] for x in g.db.query(Sub.name).order_by(Sub.name).all()), v=v, sub=sub, price=ghost_price(v)) + return render_template("submit.html", SUBS=() if SITE_NAME == 'Drama' else tuple(x[0] for x in g.db.query(Sub.name).order_by(Sub.name).all()), v=v, sub=sub, ghost=submit_ghost(v,g.db)) @app.get("/post/") @app.get("/post//") @@ -847,7 +861,7 @@ def submit_post(v, sub=None): def error(error): print(sub, flush=True) if request.headers.get("Authorization") or request.headers.get("xhr"): error(error) - return render_template("submit.html", SUBS=() if SITE_NAME == 'Drama' else tuple(x[0] for x in g.db.query(Sub.name).order_by(Sub.name).all()), v=v, error=error, title=title, url=url, body=body, price=ghost_price(v)), 400 + return render_template("submit.html", SUBS=() if SITE_NAME == 'Drama' else tuple(x[0] for x in g.db.query(Sub.name).order_by(Sub.name).all()), v=v, error=error, title=title, url=url, body=body, price=submit_ghost(v,g.db)), 400 if v.is_suspended: error( "You can't perform this action while banned.") @@ -1079,19 +1093,6 @@ def submit_post(v, sub=None): if embed and len(embed) > 1500: embed = None - ghost = False - if request.values.get('ghost'): - - price = ghost_price(v) - - if v.coins >= price: - v.coins -= price - ghost = True - elif v.procoins >= price: - v.procoins -= price - ghost = True - - new_post = Submission( private=bool(request.values.get("private","")), club=club, @@ -1106,12 +1107,33 @@ def submit_post(v, sub=None): title=title[:500], title_html=title_html, sub=sub, - ghost=ghost + ghost=False ) g.db.add(new_post) g.db.flush() + if request.values.get('ghost'): + + ghost_award = g.db.query(AwardRelationship).filter( + AwardRelationship.kind == 'ghosts', + AwardRelationship.user_id == v.id, + AwardRelationship.submission_id == None, + AwardRelationship.comment_id == None + ).first() + + if ghost_award: + ghost_award.submission_id = new_post.id + new_post.ghost = True + else: + price = ghost_price(v) + if v.coins >= price: + v.coins -= price + new_post.ghost = True + elif v.procoins >= price: + v.procoins -= price + new_post.ghost = True + if v and v.admin_level > 2: for option in bet_options: bet_option = Comment(author_id=AUTOBETTER_ID, diff --git a/files/templates/comments.html b/files/templates/comments.html index 0f69cc58c..4edda0398 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -545,37 +545,37 @@ {% endif %} {% if v.id != c.author_id and not c.ghost %} - Unblock user + Unblock user - Block user + Block user {% endif %} {% if c.post %} {% set url = "" %} {% if v.admin_level > 1%} - {% set url = "sticky_comment" %} + {% set url = "sticky_comment" %} {% elif v.id == c.post.author_id %} - {% set url = "pin_comment" %} + {% set url = "pin_comment" %} {% elif c.post.sub and v.mods(c.post.sub) %} - {% set url = "mod_pin" %} + {% set url = "mod_pin" %} {% endif %} {% if url != "" %} - - - + + + {% endif %} {% endif %} {% if v.admin_level > 1 %} {% if "/reported/" in request.path %} - - + + {% else %} - - + + {% endif %} {% endif %} diff --git a/files/templates/search_comments.html b/files/templates/search_comments.html index 75b7ef87a..c417a0c76 100644 --- a/files/templates/search_comments.html +++ b/files/templates/search_comments.html @@ -1,23 +1,23 @@ {% extends "search.html" %} {% block listing_template %} -
- {% include "comments.html" %} -
+
+ {% include "comments.html" %} +
- {% if error %} -
-
-
- - - - -

{{error}}

-
-
-
- {% endif %} + {% if error %} +
+
+
+ + + + +

{{error}}

+
+
+
+ {% endif %} {% endblock %} {% block listinglength %} diff --git a/files/templates/sidebar_2Much4You.html b/files/templates/sidebar_2Much4You.html index 14d3d899a..9ba8c1fca 100644 --- a/files/templates/sidebar_2Much4You.html +++ b/files/templates/sidebar_2Much4You.html @@ -1,26 +1,26 @@ \ No newline at end of file diff --git a/files/templates/sidebar_Drama.html b/files/templates/sidebar_Drama.html index 831c281d7..dd040e0f4 100644 --- a/files/templates/sidebar_Drama.html +++ b/files/templates/sidebar_Drama.html @@ -1,76 +1,76 @@ \ No newline at end of file diff --git a/files/templates/sidebar_PCM.html b/files/templates/sidebar_PCM.html index f1f88681d..b6e3b527a 100644 --- a/files/templates/sidebar_PCM.html +++ b/files/templates/sidebar_PCM.html @@ -1,5 +1,5 @@ \ No newline at end of file diff --git a/files/templates/sidebar_Ruqqus.html b/files/templates/sidebar_Ruqqus.html index a8818617c..b9fff5ae0 100644 --- a/files/templates/sidebar_Ruqqus.html +++ b/files/templates/sidebar_Ruqqus.html @@ -1,26 +1,26 @@ \ No newline at end of file diff --git a/files/templates/sub/create_sub.html b/files/templates/sub/create_sub.html index fc71d4c0b..f79a01c99 100644 --- a/files/templates/sub/create_sub.html +++ b/files/templates/sub/create_sub.html @@ -9,53 +9,53 @@
 
 
-    
+	
 
-
+
-
+
-
+
-

Create a sub

+

Create a sub

-

Create a sub

+

Create a sub

-
+
- + - + - - Names must be 3-20 characters + + Names must be 3-20 characters -
+
- -
+
-
-
+
+
diff --git a/files/templates/submission.html b/files/templates/submission.html index fbe5141de..e8e9476b7 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -50,7 +50,7 @@ } @keyframes moveY { - from { top: 0; } to { top: 98%; } + from { top: 0; } to { top: 98%; } } .seal1 { diff --git a/files/templates/submit.html b/files/templates/submit.html index 8559667ab..194376f67 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -183,8 +183,12 @@ {% endif %}
- - + + {% if ghost == 42069 %} + + {% else %} + + {% endif %}
diff --git a/files/templates/terms.html b/files/templates/terms.html
index b2f648e07..d7747eb8b 100644
--- a/files/templates/terms.html
+++ b/files/templates/terms.html
@@ -13,37 +13,37 @@
 
Terms of use
-
-

By using Drama you agree to abstain from posting or submitting to any of the following. Additionally, you warrant that anything posted or submitted by you complies with this code of conduct.

+
+

By using Drama you agree to abstain from posting or submitting to any of the following. Additionally, you warrant that anything posted or submitted by you complies with this code of conduct.

-
- -

Legal

- -

Copyright: You may not post anything copyrighted by another party or material not properly licensed to you.

- -

United States Law: You may not post anything not legal to publish within or export from the United States of America.

- -

Safety

- -

Harrasment: You may not post anything that harasses or encourages of others either online or offline.

- -

Personal Information: Posting or publishing personal or confidential information is stricly prohibited.

- -

Solicitation: You may not post anything that solicits transactions

- -

Malicious material: Anything that is digitally malicious is strictly prohibited from being posted.

- -

Impersonation: You many not post anything that impersonates other Drama users, moderators, or administrations.

- -

Spam: Spam material is strictly prohibited from being posted on Drama.

- -

Sexuality

- -

Sexual or sexually suggestive material: Any sexual or sexually suggestive material must be marked "+18"

- -

Content involving minors: Drama has zero tolerance for sexual or sexually suggestive material involving minors. Any material that violates this rule will result in a permanent ban.

- -
+
+ +

Legal

+ +

Copyright: You may not post anything copyrighted by another party or material not properly licensed to you.

+ +

United States Law: You may not post anything not legal to publish within or export from the United States of America.

+ +

Safety

+ +

Harrasment: You may not post anything that harasses or encourages of others either online or offline.

+ +

Personal Information: Posting or publishing personal or confidential information is stricly prohibited.

+ +

Solicitation: You may not post anything that solicits transactions

+ +

Malicious material: Anything that is digitally malicious is strictly prohibited from being posted.

+ +

Impersonation: You many not post anything that impersonates other Drama users, moderators, or administrations.

+ +

Spam: Spam material is strictly prohibited from being posted on Drama.

+ +

Sexuality

+ +

Sexual or sexually suggestive material: Any sexual or sexually suggestive material must be marked "+18"

+ +

Content involving minors: Drama has zero tolerance for sexual or sexually suggestive material involving minors. Any material that violates this rule will result in a permanent ban.

+ +
{% endblock %} \ No newline at end of file