diff --git a/files/assets/css/main.css b/files/assets/css/main.css index c62b5ba17..db9cf8421 100644 --- a/files/assets/css/main.css +++ b/files/assets/css/main.css @@ -2694,6 +2694,11 @@ pre { .text-small { font-size: 12px !important; } +@media (max-width: 767.98px) { + .text-small-mobile { + font-size: 12px !important; + } +} .text-small-extra { font-size: 10.1px !important; } diff --git a/files/assets/js/emoji_modal.js b/files/assets/js/emoji_modal.js index 3a3658398..2143076a2 100644 --- a/files/assets/js/emoji_modal.js +++ b/files/assets/js/emoji_modal.js @@ -29,8 +29,8 @@ const EMOJIS_STRINGS = [ "marseydead": {"author":"anton-d", "tags":"murdered dead killed reaction victim die rip"}, "marseyparty": {"author":"anton-d", "tags":"excite excitement celebrate happy celebrating"}, "marseyrain": {"author":"anton-d", "tags":"cloud upset reaction disappointed storm depressed sad"}, - "marseyagree": {"author":"unknown", "tags":"concur nodding nod reaction affirmative yes yeah uh huh animated judgment"}, - "marseydisagree": {"author":"unknown", "tags":"nah uh nod nuh uh reaction wrong no way no negative animated judgment"}, + "marseyagree": {"author":"mom", "tags":"concur nodding nod reaction affirmative yes yeah uh huh animated judgment"}, + "marseydisagree": {"author":"mom", "tags":"nah uh nod nuh uh reaction wrong no way no negative animated judgment"}, "marseyjam": {"author":"tejanx", "tags":"animated bopping excited trippy excitement tejanx dancing rainbow rave happy dance"}, "marseygasp": {"author":"gigavaccinator", "tags":"wow woah what how why whoa reaction appalled"}, "marseytwerking": {"author":"john", "tags":"tailspin animated butt backside dancing spin booty ass dance"}, @@ -48,7 +48,7 @@ const EMOJIS_STRINGS = [ "marseygigaretard": {"author":"chapose", "tags":"idiot neurodivergent dumb stupid drooling moron puddle"}, "marseysneed": {"author":"unknown", "tags":"feed farmer reaction chuck simpsons"}, "marseybaited": {"author":"dramarama", "tags":"laser pointer trolled gullible reaction animated"}, - "marseyeyeroll": {"author":"unknown", "tags":"rolleyes rolling eyes mock animated reaction roll eyes duh"}, + "marseyeyeroll": {"author":"mom", "tags":"rolleyes rolling eyes mock animated reaction roll eyes duh"}, "marseydepressed": {"author":"kellere31", "tags":"smoke kms doomer cigarette despair reaction depression suicide suicidal smoking hopeless sad"}, "marseypat": {"author":"unknown", "tags":"petting reaction animated cute patting"}, "marseyking": {"author":"soren", "tags":"based queen prince reaction crown princess"}, @@ -261,7 +261,7 @@ const EMOJIS_STRINGS = [ "marseybong": {"author":"altaccountumbreon", "tags":"england walkers britain english chips british bad teeth crisps"}, "marseybooba": {"author":"unknown", "tags":"awooga tits titties boobs eyes animated tiddies"}, "marseyboomer": {"author":"unknown", "tags":"sipping shades sunglasses old yup vape"}, - "marseybountyhunter": {"author":"unknown", "tags":"abortion leather vest cowboy gunslinger texas revolver"}, + "marseybountyhunter": {"author":"mom", "tags":"abortion leather vest cowboy gunslinger texas revolver"}, "marseybowl": {"author":"unknown", "tags":"marijuana weed dude weed lmao ganja drugs reaction pot pipe"}, "marseybrainlet": {"author":"john", "tags":"idiot imbecile smoothbrain crushed head retard caved in head sped dumb stupid drooling moron"}, "marseybrap": {"author":"threeletteragent", "tags":"brap sniff smell huff gas fart animated"}, @@ -287,7 +287,7 @@ const EMOJIS_STRINGS = [ "marseycapypat": {"author":"dramarama", "tags":"petting capybara aevann animated patting"}, "marseycapywalking": {"author":"dramarama", "tags":"capybara animated aevann"}, "marseycarp": {"author":"frozenchosen", "tags":"beard mohawk reaction carpathianflorist monster"}, - "marseycarp2": {"author":"unknown", "tags":"harm cutting selfharm cutter reaction carpathianflorist self animated"}, + "marseycarp2": {"author":"mom", "tags":"harm cutting selfharm cutter reaction carpathianflorist self animated"}, "marseycarp3": {"author":"chapose", "tags":"reaction fish carpathianflorist catfish"}, "marseycarpcrying": {"author":"chapose", "tags":"tear reaction carpathianflorist fish sob tears sad"}, "marseycarppat": {"author":"unknown", "tags":"petting carpathianflorist fish animated patting"}, @@ -315,8 +315,8 @@ const EMOJIS_STRINGS = [ "marseyclapping": {"author":"unknown", "tags":"good job animated good work reaction great job well done applaud applause great work nice celebrate approve judgment"}, "marseycleonpeterson": {"author":"chiobu", "tags":"wtf scary art"}, "marseyclown": {"author":"unknown", "tags":"makeup joker"}, - "marseyclown2": {"author":"unknown", "tags":"joker"}, - "marseyclown3": {"author":"unknown", "tags":"unicycle animated"}, + "marseyclown2": {"author":"mom", "tags":"joker"}, + "marseyclown3": {"author":"mom", "tags":"unicycle animated"}, "marseycoal": {"author":"dramamine", "tags":"christmas naughty santa cigarette present gift holiday doom"}, "marseycoin": {"author":"dramarama", "tags":"dramacoin money dc spinning rich payment gold dinero animated dollars"}, "marseycolossal": {"author":"chiobu", "tags":"halloween skin holiday scary mouths"}, @@ -331,20 +331,20 @@ const EMOJIS_STRINGS = [ "marseycoonass": {"author":"chapodestroyer", "tags":"student lsu university louisana state"}, "marseycop": {"author":"sylveon", "tags":"acab thin blue line chauvin police officer"}, "marseycopeseethedilate": {"author":"altaccountumbreon", "tags":"dilate seethe coping seething reaction angry mad dilating cope malding"}, - "marseycorn": {"author":"unknown", "tags":"iowa vegetable"}, - "marseycountryclub": {"author":"unknown", "tags":"golfer elite rich golfing cc elitist preppy"}, + "marseycorn": {"author":"mom", "tags":"iowa vegetable"}, + "marseycountryclub": {"author":"mom", "tags":"golfer elite rich golfing cc elitist preppy"}, "marseycow": {"author":"chiobu", "tags":"cow fursona skin animal costume furry heifer fursuit"}, "marseycowboy": {"author":"unknown", "tags":"western pardner reaction hat tootin yeehaw rootin"}, "marseycreepy": {"author":"chapose", "tags":"pervert pedophile weird reaction chomo creeper sketchy molester"}, "marseycrucified": {"author":"jesus", "tags":"christ crucifix cross christian"}, "marseycrusader": {"author":"dramarama", "tags":"knight deusvult templar crusades catholic"}, - "marseycrying": {"author":"unknown", "tags":"tear cried despair weeping reaction depression sob tears sadness depressed animated sad"}, + "marseycrying": {"author":"mom", "tags":"tear cried despair weeping reaction depression sob tears sadness depressed animated sad"}, "marseycthulhu": {"author":"feynmandidnothingwrong", "tags":"horror halloween lovecraftian holiday eldritch evil scary monster"}, "marseycuck": {"author":"chapose", "tags":"soyboy funko redditor neckbeard loser"}, "marseycumjar1": {"author":"drama_enthusiast", "tags":"semen jizz sperm spunk bukkake"}, "marseycumjar2": {"author":"drama_enthusiast", "tags":"semen jizz sperm spunk bukkake"}, "marseycumjar3": {"author":"drama_enthusiast", "tags":"semen jizz sperm spunk bukkake"}, - "marseycut": {"author":"unknown", "tags":"cutting selfharm emo self harm cutter reaction depressed"}, + "marseycut": {"author":"mom", "tags":"cutting selfharm emo self harm cutter reaction depressed"}, "marseycwc": {"author":"dramamine", "tags":"sonichu chan chris chan chandler sweater chrischan medallion striped chris"}, "marseydab": {"author":"dramarama", "tags":"reaction haters"}, "marseydaemon": {"author":"unknown", "tags":"pitchfork hell halloween demon satan devil scary holiday"}, @@ -417,7 +417,7 @@ const EMOJIS_STRINGS = [ "marseyfug": {"author":"unknown", "tags":"benis mustache snallygaster meme"}, "marseyfunko": {"author":"john", "tags":"action figure doll funko toy soy"}, "marseyfurry": {"author":"altaccountumbreon", "tags":"fursona furry fursuit kitsune"}, - "marseygandalf": {"author":"unknown", "tags":"lord of the rings magic lotr mage wizard warlock"}, + "marseygandalf": {"author":"mom", "tags":"lord of the rings magic lotr mage wizard warlock"}, "marseygarfield": {"author":"soren", "tags":"mondays lasagna"}, "marseyghost": {"author":"cantwakeupjpg", "tags":"spooky halloween costume holiday scary sheet"}, "marseygift": {"author":"unknown", "tags":"present christmas wrapping paper holiday"}, @@ -428,7 +428,7 @@ const EMOJIS_STRINGS = [ "marseyglaceon": {"author":"sylveon", "tags":"trick or treat pokemon halloween eevee costume holiday"}, "marseyglaceonpat": {"author":"sylveon", "tags":"trick or treat pokemon petting halloween eevee reaction costume holiday animated patting"}, "marseyglam": {"author":"unknown", "tags":"rocker pretty glamorous beautiful"}, - "marseyglancing": {"author":"unknown", "tags":"eyes animated nervous paranoid"}, + "marseyglancing": {"author":"mom", "tags":"eyes animated nervous paranoid"}, "marseyglow2": {"author":"threeletteragent", "tags":"fbi mossad feds agent glownigger reaction glowie fed atf cia nsa"}, "marseyglowaward": {"author":"unknown", "tags":"medal fbi ribbon animated glownigger retard glowie fed atf cia nsa"}, "marseygodel": {"author":"feynmandidnothingwrong", "tags":"old philosophy glasses history"}, @@ -449,7 +449,7 @@ const EMOJIS_STRINGS = [ "marseyhappening": {"author":"dramamine", "tags":"ronpaul happening it ron paul itshappening animated"}, "marseyhappy": {"author":"unknown", "tags":"pleased contented reaction contentment satisfied"}, "marseyhappytears": {"author":"dramarama", "tags":"tears of joy crying"}, - "marseyhead": {"author":"unknown", "tags":"blood spurting headless horror halloween animated"}, + "marseyhead": {"author":"mom", "tags":"blood spurting headless horror halloween animated"}, "marseyhealthy": {"author":"altaccountumbreon", "tags":"burger king fat fast food crown unhealthy junk food american"}, "marseyheathcliff": {"author":"soren", "tags":"heathecliff"}, "marseyheavymetal": {"author":"feynmandidnothingwrong", "tags":"rocker musician rock guitar"}, @@ -480,7 +480,7 @@ const EMOJIS_STRINGS = [ "marseyjesus": {"author":"dramarama", "tags":"christian"}, "marseyjiangshi": {"author":"dramarama", "tags":"ghost chinese halloween holiday china scary"}, "marseyjohnson": {"author":"feynmandidnothingwrong", "tags":"wig history"}, - "marseyjoint": {"author":"unknown", "tags":"smoke weed marijuana reefer drugs smoking 420 pot"}, + "marseyjoint": {"author":"mom", "tags":"smoke weed marijuana reefer drugs smoking 420 pot"}, "marseyjolteon": {"author":"sylveon", "tags":"trick or treat pokemon halloween eevee costume holiday"}, "marseyjolteonpat": {"author":"chiobu", "tags":"trick or treat pokemon petting halloween eevee reaction costume holiday animated patting"}, "marseyjones": {"author":"dramamine", "tags":"tinfoil animated alex gay frogs conspiracy"}, @@ -574,7 +574,7 @@ const EMOJIS_STRINGS = [ "marseynoyouglow": {"author":"unknown", "tags":"fbi no u animated feds glowies glowniggers atf cia nsa"}, "marseynpc": {"author":"unknown", "tags":"sheeple"}, "marseynpc2": {"author":"chapose", "tags":"reaction idiot sheep"}, - "marseynun": {"author":"unknown", "tags":"habit catholic"}, + "marseynun": {"author":"mom", "tags":"habit catholic"}, "marseynut": {"author":"unknown", "tags":"orgasm ahegao cum reaction coom"}, "marseynyan": {"author":"chiobu", "tags":"space animated meme poptart"}, "marseyobese": {"author":"chiobu", "tags":"fat chonker bbw chonk chunky pig lorg"}, @@ -589,7 +589,7 @@ const EMOJIS_STRINGS = [ "marseyowow": {"author":"chapose", "tags":"reaction excited owo"}, "marseypaint": {"author":"crabby_cummy", "tags":"low effort art"}, "marseypainter": {"author":"saveusuncleted", "tags":"palet reaction pallet paintbrush paints artist pallette"}, - "marseypanda": {"author":"unknown", "tags":"red panda bear happy redpanda"}, + "marseypanda": {"author":"mom", "tags":"red panda bear happy redpanda"}, "marseypanda2": {"author":"chiobu", "tags":"panda bear fursona skin animal costume furry fursuit"}, "marseypanties": {"author":"unknown", "tags":"reaction underwear panty pantsu"}, "marseyparty1": {"author":"chiobu", "tags":"trippy animated happy dance"}, @@ -599,7 +599,7 @@ const EMOJIS_STRINGS = [ "marseypeacekeeper": {"author":"above______below", "tags":"united nations un rifle helmet gun"}, "marseypearlclutch": {"author":"dramamine", "tags":"sensitive reaction snowflake puritanical gasp sjw"}, "marseypearlclutch2": {"author":"altaccountumbreon", "tags":"sensitive reaction snowflake puritanical gasp sjw"}, - "marseypedo": {"author":"unknown", "tags":"libertarian borpa male feminist discord pedophile groomer chomo lolbert toucher"}, + "marseypedo": {"author":"mom", "tags":"libertarian borpa male feminist discord pedophile groomer chomo lolbert toucher"}, "marseypedobear": {"author":"chiobu", "tags":"groomer molest nonce"}, "marseypenguin": {"author":"grizzly", "tags":"bird linux puffin"}, "marseypepe": {"author":"unknown", "tags":"ok rightoid mellokind frog reaction"}, @@ -641,7 +641,7 @@ const EMOJIS_STRINGS = [ "marseyprotestno": {"author":"chapose", "tags":"sign protester refuse reaction deny reject"}, "marseyprotestyes": {"author":"chapose", "tags":"agree sign protester reaction approve"}, "marseypsycho": {"author":"seal_ion", "tags":"reaction schizo crazy"}, - "marseypuke": {"author":"unknown", "tags":"hurl throw up gross animated illness vomit nauseated reaction upchuck nauseous sickening yuck barf ralph judgment"}, + "marseypuke": {"author":"mom", "tags":"hurl throw up gross animated illness vomit nauseated reaction upchuck nauseous sickening yuck barf ralph judgment"}, "marseypumpkin": {"author":"dramamine", "tags":"jackolantern carving halloween holiday jack o lantern"}, "marseypumpkin2": {"author":"unknown", "tags":"jackolantern carving halloween holiday jack o lantern"}, "marseypumpkin3": {"author":"unknown", "tags":"witch jackolantern carving halloween holiday jack o lantern"}, @@ -649,12 +649,12 @@ const EMOJIS_STRINGS = [ "marseypumpkincloak": {"author":"unknown", "tags":"costume halloween holiday"}, "marseypumpking": {"author":"dramarama", "tags":"jackolantern jack o lantern halloween holiday"}, "marseypumpkinglow": {"author":"chiobu", "tags":"halloween drama holiday jack o lantern animated"}, - "marseypunching": {"author":"unknown", "tags":"battle squaring up hit square up boxer fight throwdown reaction boxing fistfight fighting"}, + "marseypunching": {"author":"mom", "tags":"battle squaring up hit square up boxer fight throwdown reaction boxing fistfight fighting"}, "marseypunisher": {"author":"unknown", "tags":"thin blue line rightoid police cops"}, "marseyqoomer": {"author":"geese_suck", "tags":"shaman viking qanon jan6 capitol january6"}, "marseyquadmagyar": {"author":"fartbinn", "tags":"bow and arrow hungary hungarian archery bowman quadnarca"}, - "marseyqueen": {"author":"unknown", "tags":"england bong english british elizabeth"}, - "marseyqueenlizard": {"author":"unknown", "tags":"england bong english british reptilian elizabeth"}, + "marseyqueen": {"author":"mom", "tags":"england bong english british elizabeth"}, + "marseyqueenlizard": {"author":"mom", "tags":"england bong english british reptilian elizabeth"}, "marseyracist": {"author":"altaccountumbreon", "tags":"racing vroom racecar bigot reaction"}, "marseyracistgrandpa": {"author":"altaccountumbreon", "tags":"thanksgiving fuck nigger holiday"}, "marseyradioactive": {"author":"above______below", "tags":"nuclear waste chernobyl radiation geiger"}, @@ -662,7 +662,7 @@ const EMOJIS_STRINGS = [ "marseyraging": {"author":"dramamine", "tags":"rage angry mad fury animated"}, "marseyramen": {"author":"chiobu", "tags":"eating noodles food bowl animated soup"}, "marseyrare": {"author":"unknown", "tags":"kangaroo wtf"}, - "marseyrasta": {"author":"unknown", "tags":"marijuana weed dude weed lmao ganja drugs pot reggae joint jamaican"}, + "marseyrasta": {"author":"mom", "tags":"marijuana weed dude weed lmao ganja drugs pot reggae joint jamaican"}, "marseyrat": {"author":"chapose", "tags":"rodent black"}, "marseyrave": {"author":"dramarama", "tags":"dead animated party death sandstorm darude crab dance"}, "marseyreading": {"author":"unknown", "tags":"study homework learn nerd novel reaction book"}, @@ -723,7 +723,7 @@ const EMOJIS_STRINGS = [ "marseyskeletor": {"author":"soren", "tags":"skeleton mask heman 80s man halloween he man cartooon he holiday"}, "marseysmirk": {"author":"unknown", "tags":"reaction snicker trolling lol"}, "marseysmoothbrain": {"author":"chapose", "tags":"idiot big brain brainlet retard reaction fool dumbass moron"}, - "marseysmudge": {"author":"unknown", "tags":"diogenesjr diogenesjunior meme"}, + "marseysmudge": {"author":"mom", "tags":"diogenesjr diogenesjunior meme"}, "marseysmug": {"author":"kellere31", "tags":"reaction superior haha"}, "marseysmug2": {"author":"dramarama", "tags":"snicker scoff mock reaction guffaw ridicule judgment"}, "marseysmug3": {"author":"dramarama", "tags":"reaction yikes judgment oof cringe"}, @@ -740,7 +740,7 @@ const EMOJIS_STRINGS = [ "marseyspider": {"author":"drama_enthusiast", "tags":"insect halloween arachnid holiday bug"}, "marseyspider2": {"author":"skabadabadoo", "tags":"insect halloween spiderweb arachnid holiday bug"}, "marseyspirit": {"author":"unknown", "tags":"ghost halloween holiday"}, - "marseyspit": {"author":"unknown", "tags":"surprising reaction shocking water surprised shocked"}, + "marseyspit": {"author":"mom", "tags":"surprising reaction shocking water surprised shocked"}, "marseyspooky": {"author":"dramarama", "tags":"art horror halloween holiday evil scary monster lovecraftian eldritch"}, "marseyspookysmile": {"author":"unknown", "tags":"horror halloween holiday evil scary monster"}, "marseysrdine": {"author":"saveusuncleted", "tags":"fisherman reaction fish canned fishing"}, @@ -820,7 +820,7 @@ const EMOJIS_STRINGS = [ "marseywheredrama2": {"author":"chiobu", "tags":"seriouspost animated agendapost"}, "marseywhirlyhat": {"author":"unknown", "tags":"idiot retard hat dumb sped slow stupid special kid"}, "marseywinner": {"author":"dramamine", "tags":"reaction trophy gold prize first place"}, - "marseywise": {"author":"unknown", "tags":"hood cloak wizard pipe"}, + "marseywise": {"author":"mom", "tags":"hood cloak wizard pipe"}, "marseywitch": {"author":"fartbinn", "tags":"spooky halloween magick holiday evil scary"}, "marseywitch2": {"author":"unknown", "tags":"tranny troomer penny wvp feminist halloween bardfinn groomer magick troid steve monster"}, "marseywitch3": {"author":"unknown", "tags":"flying broomstick wave halloween wizard holiday"}, diff --git a/files/assets/js/sort_table.js b/files/assets/js/sort_table.js new file mode 100644 index 000000000..8d3605b33 --- /dev/null +++ b/files/assets/js/sort_table.js @@ -0,0 +1,36 @@ +function sort_table(n) { + var table, rows, switching, i, x, y, shouldSwitch, dir, switchcount = 0; + table = document.getElementById("sortable_table"); + switching = true; + dir = "asc"; + while (switching) { + switching = false; + rows = table.rows; + for (i = 1; i < (rows.length - 1); i++) { + shouldSwitch = false; + x = rows[i].getElementsByTagName("TD")[n]; + y = rows[i + 1].getElementsByTagName("TD")[n]; + if (dir == "asc") { + if (x.innerHTML.toLowerCase() > y.innerHTML.toLowerCase()) { + shouldSwitch = true; + break; + } + } else if (dir == "desc") { + if (x.innerHTML.toLowerCase() < y.innerHTML.toLowerCase()) { + shouldSwitch = true; + break; + } + } + } + if (shouldSwitch) { + rows[i].parentNode.insertBefore(rows[i + 1], rows[i]); + switching = true; + switchcount ++; + } else { + if (switchcount == 0 && dir == "asc") { + dir = "desc"; + switching = true; + } + } + } +} \ No newline at end of file diff --git a/files/routes/admin.py b/files/routes/admin.py index b053a1bbe..c8ceb54f7 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -27,6 +27,33 @@ if SITE_NAME == 'PCM': cc = "splash mountain" else: cc = "country club" month = datetime.now().strftime('%B') +@app.post("/@/make_admin") +@limiter.limit("1/second") +@admin_level_required(3) +@validate_formkey +def make_admin(v, username): + if request.host == 'rdrama.net': abort(403) + user = get_user(username) + if not user: abort(404) + user.admin_level = 2 + g.db.add(user) + g.db.commit() + return {"message": "User has been made admin!"} + + +@app.post("/@/remove_admin") +@limiter.limit("1/second") +@admin_level_required(3) +@validate_formkey +def remove_admin(v, username): + if request.host == 'rdrama.net': abort(403) + user = get_user(username) + if not user: abort(404) + user.admin_level = 0 + g.db.add(user) + g.db.commit() + return {"message": "Admin removed!"} + @app.get("/admin/grassed") @admin_level_required(2) @@ -258,12 +285,11 @@ def shadowbanned(v): users = [x for x in g.db.query(User).filter(User.shadowbanned != None).all()] if not v or v.oldsite: template = '' else: template = 'CHRISTMAS/' - return render_template(f"{template}shadowbanned.html", v=v, users=users) + return render_template(f"{template}admin/shadowbanned.html", v=v, users=users) -@app.get("/admin/agendaposters") -@auth_required +@app.get("/agendaposters") +@auth_desired def agendaposters(v): - if not (v and v.admin_level > 1): abort(404) users = [x for x in g.db.query(User).filter_by(agendaposter = True).all()] if not v or v.oldsite: template = '' else: template = 'CHRISTMAS/' @@ -404,8 +430,9 @@ def badge_grant_post(v): g.db.add(new_badge) - text = f"@{v.username} has given you the following profile badge:\n\n![]({new_badge.path})\n\n{new_badge.name}" - send_notification(user.id, text) + if v.id != user.id: + text = f"@{v.username} has given you the following profile badge:\n\n![]({new_badge.path})\n\n{new_badge.name}" + send_notification(user.id, text) g.db.commit() return render_template(f"{template}admin/badge_grant.html", v=v, badge_types=BADGES, msg="Badge granted!") diff --git a/files/routes/awards.py b/files/routes/awards.py index e3b011c50..6f6c17d97 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -213,12 +213,11 @@ def award_post(pid, v): post_award.submission_id = post.id g.db.add(post_award) - msg = f"@{v.username} has given your [post]({post.permalink}) the {AWARDS[kind]['title']} Award!" - - note = request.values.get("note", "").strip() - if note: msg += f"\n\n> {note}" - - send_repeatable_notification(post.author.id, msg) + if v.id != post.author.id: + msg = f"@{v.username} has given your [post]({post.permalink}) the {AWARDS[kind]['title']} Award!" + note = request.values.get("note", "").strip() + if note: msg += f"\n\n> {note}" + send_repeatable_notification(post.author.id, msg) author = post.author if kind == "ban": @@ -379,12 +378,12 @@ def award_comment(cid, v): comment_award.comment_id = c.id g.db.add(comment_award) - msg = f"@{v.username} has given your [comment]({c.permalink}) the {AWARDS[kind]['title']} Award!" + if v.id != c.author.id: + msg = f"@{v.username} has given your [comment]({c.permalink}) the {AWARDS[kind]['title']} Award!" + note = request.values.get("note", "").strip() + if note: msg += f"\n\n> {note}" + send_repeatable_notification(c.author.id, msg) - note = request.values.get("note", "").strip() - if note: msg += f"\n\n> {note}" - - send_repeatable_notification(c.author.id, msg) author = c.author if kind == "ban": @@ -554,12 +553,11 @@ def admin_userawards_post(v): g.db.add(award) - text = "You were 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) + if v.id != u.id: + text = "You were 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) note = "" diff --git a/files/routes/login.py b/files/routes/login.py index fd48dca31..723adab04 100644 --- a/files/routes/login.py +++ b/files/routes/login.py @@ -389,8 +389,6 @@ def get_reset(): user_id = request.values.get("id") - if user_id == PW_ID: abort(403) - timestamp = int(request.values.get("time",0)) token = request.values.get("token") @@ -426,8 +424,6 @@ def post_reset(v): user_id = request.values.get("user_id") - if user_id == PW_ID: abort(403) - timestamp = int(request.values.get("time")) token = request.values.get("token") diff --git a/files/routes/settings.py b/files/routes/settings.py index 88e95b197..44e9d45fd 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -580,8 +580,6 @@ def verifiedcolor(v): @validate_formkey def settings_security_post(v): if request.values.get("new_password"): - if v.id == PW_ID: abort(403) - if request.values.get("new_password") != request.values.get("cnf_password"): return render_template("settings_security.html", v=v, error="Passwords do not match.") @@ -633,8 +631,6 @@ def settings_security_post(v): return render_template("settings_security.html", v=v, error="Check your email and click the verification link to complete the email change.") if request.values.get("2fa_token"): - if v.id == PW_ID: abort(403) - if not v.verifyPass(request.values.get('password')): return render_template("settings_security.html", v=v, error="Invalid password or token.") diff --git a/files/routes/static.py b/files/routes/static.py index af2c058c1..1cb6a7870 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -41,7 +41,8 @@ def participation_stats(v): day = now - 86400 - data = {"valid_users": g.db.query(User.id).count(), + data = {"marseys": len(marseys), + "valid_users": g.db.query(User.id).count(), "private_users": g.db.query(User.id).filter_by(is_private=True).count(), "banned_users": g.db.query(User.id).filter(User.is_banned > 0).count(), "verified_email_users": g.db.query(User.id).filter_by(is_activated=True).count(), @@ -102,10 +103,10 @@ def cached_chart(days): if days > 31: file = "/weekly_chart.png" - day_cutoffs = [today_cutoff - 86400 * 7 * i for i in range(31)][1:] + day_cutoffs = [today_cutoff - 86400 * 7 * i for i in range(35)][1:] else: file = "/daily_chart.png" - day_cutoffs = [today_cutoff - 86400 * i for i in range(31)][1:] + day_cutoffs = [today_cutoff - 86400 * i for i in range(35)][1:] day_cutoffs.insert(0, calendar.timegm(now)) diff --git a/files/templates/admin/alt_votes.html b/files/templates/admin/alt_votes.html index 0c6cbc472..79a1ed723 100644 --- a/files/templates/admin/alt_votes.html +++ b/files/templates/admin/alt_votes.html @@ -27,7 +27,7 @@ -
+
diff --git a/files/templates/admin/banned_domains.html b/files/templates/admin/banned_domains.html index bac049522..ce584bf51 100644 --- a/files/templates/admin/banned_domains.html +++ b/files/templates/admin/banned_domains.html @@ -10,7 +10,7 @@ -
+
diff --git a/files/templates/admin/content_stats.html b/files/templates/admin/content_stats.html index 2299101a3..9e964fe4b 100644 --- a/files/templates/admin/content_stats.html +++ b/files/templates/admin/content_stats.html @@ -7,7 +7,7 @@ {% block content %}

-
Domain
+
diff --git a/files/templates/shadowbanned.html b/files/templates/admin/shadowbanned.html similarity index 69% rename from files/templates/shadowbanned.html rename to files/templates/admin/shadowbanned.html index 005f57722..5e5787cde 100644 --- a/files/templates/shadowbanned.html +++ b/files/templates/admin/shadowbanned.html @@ -1,18 +1,20 @@ {% extends "settings2.html" %} {% block content %} -
Statistic
+ + +
- - + + {% for user in users %} - + {% endfor %} diff --git a/files/templates/admins.html b/files/templates/admins.html index 3b1d6ef01..92d577f23 100644 --- a/files/templates/admins.html +++ b/files/templates/admins.html @@ -3,22 +3,26 @@ {% block pagetitle %}Admins{% endblock %} {% block content %} + + +
Admins

-
#NameShadowbanned byNameShadowbanned by
{{loop.index}}@{{user.username}}'s profile picture{{user.username}}@{{user.username}}'s profile picture{{user.username}} {{user.shadowbanned}}
+
+
- - - + + + {% for user in admins %} - + diff --git a/files/templates/agendaposters.html b/files/templates/agendaposters.html index 72dfd41a0..aeea1e379 100644 --- a/files/templates/agendaposters.html +++ b/files/templates/agendaposters.html @@ -1,7 +1,7 @@ {% extends "settings2.html" %} {% block content %} -
#NameTruescoreMod actionsNameTruescoreMod actions
{{loop.index}}@{{user.username}}'s profile picture{{user.username}}{% if user.admin_level == 1 and v and v.admin_level > 1 %}{% endif %}@{{user.username}}'s profile picture{{user.username}}{% if user.admin_level == 1 and v and v.admin_level > 1 %}{% endif %} {{user.truecoins}} {{user.modaction_num}}
+
@@ -11,7 +11,7 @@ {% for user in users %} - + {% endfor %}
#
{{loop.index}}@{{user.username}}'s profile picture{{user.username}}@{{user.username}}'s profile picture{{user.username}}
diff --git a/files/templates/authforms.html b/files/templates/authforms.html index a85aa3e35..13ee53cba 100644 --- a/files/templates/authforms.html +++ b/files/templates/authforms.html @@ -15,7 +15,7 @@ {% if v %} - + {% if v.agendaposter %} - + {% endif %} diff --git a/files/templates/badges.html b/files/templates/badges.html index 2ef67c8b9..2a13b1147 100644 --- a/files/templates/badges.html +++ b/files/templates/badges.html @@ -10,7 +10,7 @@ -
+
diff --git a/files/templates/banned.html b/files/templates/banned.html index 4a5f32a34..a54b02087 100644 --- a/files/templates/banned.html +++ b/files/templates/banned.html @@ -1,7 +1,7 @@ {% extends "settings2.html" %} {% block content %} -
Name
+
@@ -13,9 +13,9 @@ {% for user in users %} - + - + {% endfor %}
#
{{loop.index}}@{{user.username}}'s profile picture{{user.username}}@{{user.username}}'s profile picture{{user.username}} {% if user.ban_reason %}{{user.ban_reason}}{% endif %}@{{user.banned_by.username}}'s profile picture{{user.banned_by.username}}@{{user.banned_by.username}}'s profile picture{{user.banned_by.username}}
diff --git a/files/templates/blocks.html b/files/templates/blocks.html index 236a1ec3e..9e19c2633 100644 --- a/files/templates/blocks.html +++ b/files/templates/blocks.html @@ -5,7 +5,7 @@ {% block content %}

Blocks


-
+
@@ -14,8 +14,8 @@ {% for user in users %} - - + + {% endfor %}
User
{{user.username}}{{targets[loop.index-1].username}}{{user.username}}{{targets[loop.index-1].username}}
diff --git a/files/templates/default.html b/files/templates/default.html index 50f166d71..1c09e3476 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -7,7 +7,7 @@ {% if v %} - + {% if v.agendaposter %} - + {% endif %} diff --git a/files/templates/emoji_modal.html b/files/templates/emoji_modal.html index 7b3e5642b..eb076e80e 100644 --- a/files/templates/emoji_modal.html +++ b/files/templates/emoji_modal.html @@ -80,7 +80,7 @@
- + - + {% if v.agendaposter %} - + {% endif %}
diff --git a/files/templates/login.html b/files/templates/login.html index a3c594501..fc8d4b1d0 100644 --- a/files/templates/login.html +++ b/files/templates/login.html @@ -18,7 +18,7 @@ {% endblock %} - + diff --git a/files/templates/login_2fa.html b/files/templates/login_2fa.html index 151009799..37aa5caa0 100644 --- a/files/templates/login_2fa.html +++ b/files/templates/login_2fa.html @@ -14,7 +14,7 @@ 2-Step Login - {{'SITE_NAME' | app_config}} - + diff --git a/files/templates/patrons.html b/files/templates/patrons.html index 60663ca2c..719bf6d00 100644 --- a/files/templates/patrons.html +++ b/files/templates/patrons.html @@ -1,7 +1,7 @@ {% extends "settings2.html" %} {% block content %} -
+
@@ -12,7 +12,7 @@ {% for u in users %} - + diff --git a/files/templates/rentoids.html b/files/templates/rentoids.html index e7d5ba12d..acc075cd5 100644 --- a/files/templates/rentoids.html +++ b/files/templates/rentoids.html @@ -3,7 +3,7 @@
Rentoids

-
#
{{loop.index}}@{{u.username}}'s profile picture{{u.username}}@{{u.username}}'s profile picture{{u.username}} Patron-{{u.patron}}
+
@@ -13,7 +13,7 @@ {% for user in users %} - + {% endfor %}
#
{{loop.index}}@{{user.username}}'s profile picture{{user.username}}@{{user.username}}'s profile picture{{user.username}}
diff --git a/files/templates/settings.html b/files/templates/settings.html index 38cd1a8a5..722a1cc10 100644 --- a/files/templates/settings.html +++ b/files/templates/settings.html @@ -34,7 +34,7 @@ - + {% if v.agendaposter %} - + {% else %} - + {% endif %} diff --git a/files/templates/sign_up.html b/files/templates/sign_up.html index c5ab9b3fc..3f6613cf9 100644 --- a/files/templates/sign_up.html +++ b/files/templates/sign_up.html @@ -31,7 +31,7 @@ {% if ref_user %}{{ref_user.username}} invites you to {{'SITE_NAME' | app_config}}{% else %}Sign up - {{'SITE_NAME' | app_config}}{% endif %} - + diff --git a/files/templates/sign_up_failed_ref.html b/files/templates/sign_up_failed_ref.html index 53f5a8d56..5dbe6ed50 100644 --- a/files/templates/sign_up_failed_ref.html +++ b/files/templates/sign_up_failed_ref.html @@ -32,7 +32,7 @@ {% if ref_user %}{{ref_user.username}} invites you to {{'SITE_NAME' | app_config}}{% else %}{{'SITE_NAME' | app_config}}{% endif %} - + diff --git a/files/templates/submit.html b/files/templates/submit.html index 60c6343ce..8ae479880 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -26,7 +26,7 @@ {% block stylesheets %} {% if v %} - + {% if v.agendaposter %} - + {% endif %} {% endblock %} diff --git a/files/templates/thiefs.html b/files/templates/thiefs.html index 18be36ba2..768ff99d4 100644 --- a/files/templates/thiefs.html +++ b/files/templates/thiefs.html @@ -3,7 +3,7 @@

 
Successful thiefs

-
+
@@ -13,7 +13,7 @@ {% for user in successful %} - + {% endfor %}
#
{{loop.index}}@{{user.username}}'s profile picture{{user.username}}@{{user.username}}'s profile picture{{user.username}}
@@ -21,7 +21,7 @@

 
Evicted thiefs

-
+
@@ -31,7 +31,7 @@ {% for user in failed2 %} - + {% endfor %}
#
{{loop.index}}@{{user.username}}'s profile picture{{user.username}}@{{user.username}}'s profile picture{{user.username}}
@@ -39,7 +39,7 @@

 
Jailed thiefs

-
+
@@ -49,7 +49,7 @@ {% for user in failed %} - + {% endfor %}
#
{{loop.index}}@{{user.username}}'s profile picture{{user.username}}@{{user.username}}'s profile picture{{user.username}}
diff --git a/files/templates/userpage.html b/files/templates/userpage.html index 35b0170c7..67be90191 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -53,7 +53,7 @@ {% if u.unban_utc %}
{{u.unban_string}}
{% endif %} {% endif %}
-

{{u.username}}

+

{{u.username}}

{% if u.username != u.original_username %} @@ -352,7 +352,7 @@ {% if u.unban_utc %}
{{u.unban_string}}
{% endif %} {% endif %} {% if u.verified %} {% endif %} -

{{u.username}}

+

{{u.username}}

{% if u.username != u.original_username %} diff --git a/files/templates/userpage_blocked.html b/files/templates/userpage_blocked.html index 7ef98a17a..cdd9ea337 100644 --- a/files/templates/userpage_blocked.html +++ b/files/templates/userpage_blocked.html @@ -6,7 +6,7 @@ {% endblock %} {% block title %} -<span {% if u.patron %}class="patron" style="background-color:#{{u.namecolor}};"{% endif %}>{{u.username}}</span> +<span {% if u.patron %}class="patron" style="background-color:#{{u.namecolor}}"{% endif %}>{{u.username}}</span> {% endblock %} diff --git a/files/templates/userpage_blocking.html b/files/templates/userpage_blocking.html index 0d6d9f5ba..9c2c3dc3a 100644 --- a/files/templates/userpage_blocking.html +++ b/files/templates/userpage_blocking.html @@ -6,7 +6,7 @@ {% endblock %} {% block title %} -<span {% if u.patron %}class="patron" style="background-color:#{{u.namecolor}};"{% endif %}>{{u.username}}</span> +<span {% if u.patron %}class="patron" style="background-color:#{{u.namecolor}}"{% endif %}>{{u.username}}</span> {% endblock %} diff --git a/files/templates/viewers.html b/files/templates/viewers.html index 40a810bfa..5fb11ff2b 100644 --- a/files/templates/viewers.html +++ b/files/templates/viewers.html @@ -3,7 +3,7 @@

 
Users who viewed your profile

-
+
@@ -12,7 +12,7 @@ {% for view in viewers %} - + {% endfor %} diff --git a/files/templates/voters.html b/files/templates/voters.html index 8db287868..4ae5e9c49 100644 --- a/files/templates/voters.html +++ b/files/templates/voters.html @@ -6,7 +6,7 @@
{{name2}}

-
Name
@{{view.viewer.username}}'s profile picture{{view.viewer.username}}@{{view.viewer.username}}'s profile picture{{view.viewer.username}} {{view.last_view_string}}
+
@@ -18,7 +18,7 @@ {% for user in users %} - + {% endfor %} diff --git a/files/templates/votes.html b/files/templates/votes.html index 99ea86fba..d8c0988cc 100644 --- a/files/templates/votes.html +++ b/files/templates/votes.html @@ -19,20 +19,20 @@

Downvotes: {{downs | length}}

Upvotes

-
#
{{loop.index}}@{{user[0].username}}'s profile picture{{user[0].username}}@{{user[0].username}}'s profile picture{{user[0].username}} {{user[1]}}
+
{% for vote in ups %} - + {% endfor %}
User
@{{vote.user.username}}'s profile picture{{vote.user.username}}
@{{vote.user.username}}'s profile picture{{vote.user.username}}

Downvotes

-
+
{% for vote in downs %} - + {% endfor %}
User
@{{vote.user.username}}'s profile picture{{vote.user.username}}
@{{vote.user.username}}'s profile picture{{vote.user.username}}