gfMerge branch 'frost' of https://github.com/Aevann1/Drama into frost
commit
414a7c353d
|
@ -1,25 +0,0 @@
|
|||
The providers ("we", "us", "our") of the service provided by this web site ("rDrama.net") are not responsible for any user-generated content and accounts. Content submitted express the views of their author only.<br><br>
|
||||
|
||||
You agree to not use rDrama.net to submit or link to any content which violates any laws. You are entirely responsible for the content of, and any harm resulting from, that content or your conduct.<br><br>
|
||||
|
||||
You must be at least 18 years of age to use this site.<br><br>
|
||||
|
||||
<h3>Content Policy:</h3>
|
||||
|
||||
This website follows all of <a href="https://cloudflare.com/website-terms/">Cloudflare's Terms of Service</a> policies for content regulation.<br><br>
|
||||
|
||||
Things you cannot do ever on this website under any circumstances:<br><br><ul>
|
||||
|
||||
<li>Cheese pizza</li>
|
||||
<li>Threats of violence</li>
|
||||
<li>Human trafficking</li>
|
||||
<li>Spam</li>
|
||||
<li>Doxxing Site Users</li></ul>
|
||||
|
||||
All content posted to this website is subject to protection under <a href="https://law.cornell.edu/uscode/text/47/230">Section 230</a>. All media posted to this website is done so in a transformative nature for the purpose of critique/ridicule.
|
||||
|
||||
<h3>General Moderation:</h3>
|
||||
|
||||
We reserve the right to remove anything and everything you post here at any time for any reason. Nazi shit is not tolerated here.<br><br>
|
||||
|
||||
<h5>If you do not agree with these terms, please do not register or use rDrama.net. Use of rDrama.net constitutes acceptance of these terms.</h5>
|
|
@ -11,7 +11,7 @@ services:
|
|||
- MASTER_KEY=3435tdfsdudebussylmaoxxt43
|
||||
- REDIS_URL=redis://redis
|
||||
- DOMAIN=localhost
|
||||
- SITE_NAME=Drama
|
||||
- SITE_NAME=2Much4You
|
||||
- GIPHY_KEY=3435tdfsdudebussylmaoxxt43
|
||||
- DISCORD_SERVER_ID=3435tdfsdudebussylmaoxxt43
|
||||
- DISCORD_CLIENT_ID=3435tdfsdudebussylmaoxxt43
|
||||
|
|
|
@ -19,7 +19,7 @@ from json import loads
|
|||
|
||||
f = 'files/templates/sidebar_' + environ.get("SITE_NAME").strip() + '.html'
|
||||
if not path.exists(f):
|
||||
with open(f, 'w'): pass
|
||||
with open(f, 'w', encoding="utf-8"): pass
|
||||
|
||||
app = Flask(__name__, template_folder='templates')
|
||||
app.url_map.strict_slashes = False
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
from functools import reduce
|
||||
from json.encoder import INFINITY
|
||||
import random
|
||||
from math import floor
|
||||
|
@ -13,12 +12,8 @@ def shuffle(x):
|
|||
return x
|
||||
|
||||
|
||||
def get_shuffled_deck():
|
||||
return shuffle([rank + suit for rank in ranks for suit in suits for _ in range(deck_count)])
|
||||
|
||||
|
||||
def deal_initial_cards():
|
||||
deck = get_shuffled_deck()
|
||||
deck = shuffle([rank + suit for rank in ranks for suit in suits for _ in range(deck_count)])
|
||||
p1, d1, p2, d2, *rest_of_deck = deck
|
||||
return [p1, p2], [d1, d2], rest_of_deck
|
||||
|
||||
|
@ -44,61 +39,62 @@ def format_cards(hand):
|
|||
return map(lambda x: "".join(x), hand)
|
||||
|
||||
|
||||
def format_all(player_hand, dealer_hand, deck, status, wager):
|
||||
def format_all(player_hand, dealer_hand, deck, status, wager, kind):
|
||||
formatted_player_hand = format_cards(player_hand)
|
||||
formatted_dealer_hand = format_cards(dealer_hand)
|
||||
formatted_deck = format_cards(deck)
|
||||
|
||||
return f'{"/".join(formatted_player_hand)}_{"/".join(formatted_dealer_hand)}_{"/".join(formatted_deck)}_{status}_{wager}'
|
||||
return f'{"/".join(formatted_player_hand)}_{"/".join(formatted_dealer_hand)}_{"/".join(formatted_deck)}_{status}_{wager}_{kind}'
|
||||
|
||||
|
||||
class Blackjack:
|
||||
command_word = "!blackjack"
|
||||
casino_word = "!blackjackmb"
|
||||
coins_command_word = "!blackjack"
|
||||
marseybucks_command_word = "!blackjackmb"
|
||||
|
||||
minimum_bet = 100
|
||||
maximum_bet = INFINITY
|
||||
|
||||
def __init__(self, g):
|
||||
self.db = g.db
|
||||
|
||||
def check_for_blackjack_command(self, in_text, from_user, from_comment):
|
||||
in_text = in_text.lower()
|
||||
if self.command_word in in_text:
|
||||
for word in in_text.split():
|
||||
if self.command_word in word:
|
||||
try:
|
||||
wager = word[len(self.command_word):]
|
||||
wager_value = int(wager)
|
||||
except: break
|
||||
def check_for_blackjack_commands(self, in_text, from_user, from_comment):
|
||||
for command_word in (self.coins_command_word, self.marseybucks_command_word):
|
||||
currency_prop = "coins" if command_word == self.coins_command_word else "procoins"
|
||||
currency_value = getattr(from_user, currency_prop, 0)
|
||||
|
||||
if (wager_value < self.minimum_bet): break
|
||||
elif (wager_value > self.maximum_bet): break
|
||||
elif (wager_value > from_user.coins): break
|
||||
if command_word in in_text:
|
||||
for word in in_text.split():
|
||||
if command_word in word:
|
||||
try:
|
||||
wager = word[len(command_word):]
|
||||
wager_value = int(wager)
|
||||
except: break
|
||||
|
||||
from_user.coins -= wager_value
|
||||
from_user.winnings -= wager_value
|
||||
if (wager_value < self.minimum_bet): break
|
||||
elif (wager_value > self.maximum_bet): break
|
||||
elif (wager_value <= currency_value):
|
||||
|
||||
player_hand, dealer_hand, rest_of_deck = deal_initial_cards()
|
||||
status = 'active'
|
||||
player_value = get_hand_value(player_hand)
|
||||
dealer_value = get_hand_value(dealer_hand)
|
||||
setattr(from_user, currency_prop, currency_value - wager_value)
|
||||
|
||||
if player_value == 21 and dealer_value == 21:
|
||||
status = 'push'
|
||||
self.apply_game_result(from_comment, wager, status)
|
||||
elif player_value == 21:
|
||||
status = 'blackjack'
|
||||
self.apply_game_result(from_comment, wager, status)
|
||||
elif dealer_value == 21:
|
||||
status = 'lost'
|
||||
self.apply_game_result(from_comment, wager, status)
|
||||
player_hand, dealer_hand, rest_of_deck = deal_initial_cards()
|
||||
status = 'active'
|
||||
player_value = get_hand_value(player_hand)
|
||||
dealer_value = get_hand_value(dealer_hand)
|
||||
|
||||
from_comment.blackjack_result = format_all(
|
||||
player_hand, dealer_hand, rest_of_deck, status, wager)
|
||||
if player_value == 21 and dealer_value == 21:
|
||||
status = 'push'
|
||||
self.apply_game_result(from_comment, wager, status, currency_prop)
|
||||
elif player_value == 21:
|
||||
status = 'blackjack'
|
||||
self.apply_game_result(from_comment, wager, status, currency_prop)
|
||||
elif dealer_value == 21:
|
||||
status = 'lost'
|
||||
self.apply_game_result(from_comment, wager, status, currency_prop)
|
||||
|
||||
from_comment.blackjack_result = format_all(player_hand, dealer_hand, rest_of_deck, status, wager, currency_prop)
|
||||
|
||||
def player_hit(self, from_comment):
|
||||
player_hand, dealer_hand, deck, status, wager = from_comment.blackjack_result.split(
|
||||
"_")
|
||||
player_hand, dealer_hand, deck, status, wager, kind = from_comment.blackjack_result.split("_")
|
||||
player_hand = player_hand.split("/")
|
||||
dealer_hand = dealer_hand.split("/")
|
||||
deck = deck.split("/")
|
||||
|
@ -107,17 +103,14 @@ class Blackjack:
|
|||
|
||||
if player_value == -1:
|
||||
status = 'bust'
|
||||
self.apply_game_result(from_comment, wager, status)
|
||||
self.apply_game_result(from_comment, wager, status, kind)
|
||||
|
||||
from_comment.blackjack_result = format_all(
|
||||
player_hand, dealer_hand, deck, status, wager)
|
||||
from_comment.blackjack_result = format_all(player_hand, dealer_hand, deck, status, wager, kind)
|
||||
|
||||
if (player_value == 21):
|
||||
self.player_stayed(from_comment)
|
||||
if (player_value == 21): self.player_stayed(from_comment)
|
||||
|
||||
def player_stayed(self, from_comment):
|
||||
player_hand, dealer_hand, deck, status, wager = from_comment.blackjack_result.split(
|
||||
"_")
|
||||
player_hand, dealer_hand, deck, status, wager, kind = from_comment.blackjack_result.split("_")
|
||||
player_hand = player_hand.split("/")
|
||||
player_value = get_hand_value(player_hand)
|
||||
dealer_hand = dealer_hand.split("/")
|
||||
|
@ -129,29 +122,29 @@ class Blackjack:
|
|||
dealer_hand.append(next)
|
||||
dealer_value = get_hand_value(dealer_hand)
|
||||
|
||||
if player_value > dealer_value or dealer_value == -1:
|
||||
status = 'won'
|
||||
elif dealer_value > player_value:
|
||||
status = 'lost'
|
||||
else:
|
||||
status = 'push'
|
||||
if player_value > dealer_value or dealer_value == -1: status = 'won'
|
||||
elif dealer_value > player_value: status = 'lost'
|
||||
else: status = 'push'
|
||||
|
||||
from_comment.blackjack_result = format_all(
|
||||
player_hand, dealer_hand, deck, status, wager)
|
||||
from_comment.blackjack_result = format_all(player_hand, dealer_hand, deck, status, wager, kind)
|
||||
|
||||
self.apply_game_result(from_comment, wager, status)
|
||||
self.apply_game_result(from_comment, wager, status, kind)
|
||||
|
||||
def apply_game_result(self, from_comment, wager, result):
|
||||
reward = 0
|
||||
def apply_game_result(self, from_comment, wager, result, kind):
|
||||
wager_value = int(wager)
|
||||
user = from_comment.author
|
||||
reward = -1
|
||||
|
||||
if result == 'push':
|
||||
reward = int(wager)
|
||||
elif result == 'won':
|
||||
reward = int(wager) * 2
|
||||
elif result == 'blackjack':
|
||||
reward = floor(int(wager) * (5/2))
|
||||
if result == 'push': reward = 0
|
||||
elif result == 'won': reward = wager_value
|
||||
elif result == 'blackjack': reward = floor(wager_value * 3/2)
|
||||
|
||||
if (reward > 0):
|
||||
user = from_comment.author
|
||||
user.coins += reward
|
||||
user.winnings += reward
|
||||
if (reward > -1):
|
||||
currency_value = int(getattr(user, kind, 0))
|
||||
|
||||
setattr(user, kind, currency_value + wager_value + reward)
|
||||
|
||||
user.winnings += reward
|
||||
|
||||
self.db.add(user)
|
||||
self.db.commit()
|
|
@ -11,6 +11,7 @@ from files.helpers.const import *
|
|||
from files.helpers.lazy import lazy
|
||||
from .flags import CommentFlag
|
||||
from random import randint
|
||||
from .votes import CommentVote
|
||||
|
||||
class Comment(Base):
|
||||
|
||||
|
@ -79,15 +80,19 @@ class Comment(Base):
|
|||
@lazy
|
||||
def poll_voted(self, v):
|
||||
if v:
|
||||
vote = g.db.query(CommentVote).filter_by(user_id=v.id, comment_id=self.id).one_or_none()
|
||||
if vote: return vote.vote_type
|
||||
else: return None
|
||||
else: return None
|
||||
vote = g.db.query(CommentVote.vote_type).filter_by(user_id=v.id, comment_id=self.id).one_or_none()
|
||||
if vote: return vote[0]
|
||||
return None
|
||||
|
||||
@property
|
||||
@lazy
|
||||
def options(self):
|
||||
return [x for x in self.child_comments if x.author_id == AUTOPOLLER_ID]
|
||||
return tuple(x for x in self.child_comments if x.author_id == AUTOPOLLER_ID)
|
||||
|
||||
@property
|
||||
@lazy
|
||||
def choices(self):
|
||||
return tuple(x for x in self.child_comments if x.author_id == AUTOCHOICE_ID)
|
||||
|
||||
def total_poll_voted(self, v):
|
||||
if v:
|
||||
|
@ -95,6 +100,11 @@ class Comment(Base):
|
|||
if option.poll_voted(v): return True
|
||||
return False
|
||||
|
||||
def total_choice_voted(self, v):
|
||||
if v:
|
||||
return g.db.query(CommentVote).filter(CommentVote.user_id == v.id, CommentVote.comment_id.in_(tuple(x.id for x in self.choices))).all()
|
||||
return False
|
||||
|
||||
@property
|
||||
@lazy
|
||||
def controversial(self):
|
||||
|
@ -169,16 +179,10 @@ class Comment(Base):
|
|||
years = int(months / 12)
|
||||
return f"{years}yr ago"
|
||||
|
||||
if SITE_NAME == 'Too4You':
|
||||
@property
|
||||
@lazy
|
||||
def score(self):
|
||||
return self.upvotes
|
||||
else:
|
||||
@property
|
||||
@lazy
|
||||
def score(self):
|
||||
return self.upvotes - self.downvotes
|
||||
@property
|
||||
@lazy
|
||||
def score(self):
|
||||
return self.upvotes - self.downvotes
|
||||
|
||||
@property
|
||||
@lazy
|
||||
|
@ -204,12 +208,12 @@ class Comment(Base):
|
|||
@property
|
||||
def replies(self):
|
||||
if self.replies2 != None: return [x for x in self.replies2 if not x.author.shadowbanned]
|
||||
return sorted((x for x in self.child_comments if x.author and not x.author.shadowbanned and x.author_id not in (AUTOPOLLER_ID, AUTOBETTER_ID)), key=lambda x: x.realupvotes, reverse=True)
|
||||
return sorted((x for x in self.child_comments if x.author and not x.author.shadowbanned and x.author_id not in (AUTOPOLLER_ID, AUTOBETTER_ID, AUTOCHOICE_ID)), key=lambda x: x.realupvotes, reverse=True)
|
||||
|
||||
@property
|
||||
def replies3(self):
|
||||
if self.replies2 != None: return self.replies2
|
||||
return sorted((x for x in self.child_comments if x.author_id not in (AUTOPOLLER_ID, AUTOBETTER_ID)), key=lambda x: x.realupvotes, reverse=True)
|
||||
return sorted((x for x in self.child_comments if x.author_id not in (AUTOPOLLER_ID, AUTOBETTER_ID, AUTOCHOICE_ID)), key=lambda x: x.realupvotes, reverse=True)
|
||||
|
||||
@property
|
||||
def replies2(self):
|
||||
|
@ -334,48 +338,58 @@ class Comment(Base):
|
|||
|
||||
body = self.body_html
|
||||
|
||||
if not body: return ""
|
||||
if body:
|
||||
body = censor_slurs(body, v)
|
||||
|
||||
body = censor_slurs(body, v)
|
||||
if v:
|
||||
if v.teddit: body = body.replace("old.reddit.com", "teddit.net")
|
||||
elif not v.oldreddit: body = body.replace("old.reddit.com", "reddit.com")
|
||||
|
||||
if v:
|
||||
if v.teddit: body = body.replace("old.reddit.com", "teddit.net")
|
||||
elif not v.oldreddit: body = body.replace("old.reddit.com", "reddit.com")
|
||||
if v.nitter and not '/i/spaces/' in body: body = body.replace("www.twitter.com", "nitter.net").replace("twitter.com", "nitter.net")
|
||||
|
||||
if v.nitter: body = body.replace("www.twitter.com", "nitter.net").replace("twitter.com", "nitter.net")
|
||||
if v and v.controversial:
|
||||
for i in re.finditer('(/comments/.*?)"', body):
|
||||
url = i.group(1)
|
||||
p = urlparse(url).query
|
||||
p = parse_qs(p)
|
||||
|
||||
if v and v.controversial:
|
||||
for i in re.finditer('(/comments/.*?)"', body):
|
||||
url = i.group(1)
|
||||
p = urlparse(url).query
|
||||
p = parse_qs(p)
|
||||
if 'sort' not in p: p['sort'] = ['controversial']
|
||||
|
||||
if 'sort' not in p: p['sort'] = ['controversial']
|
||||
url_noquery = url.split('?')[0]
|
||||
body = body.replace(url, f"{url_noquery}?{urlencode(p, True)}")
|
||||
|
||||
url_noquery = url.split('?')[0]
|
||||
body = body.replace(url, f"{url_noquery}?{urlencode(p, True)}")
|
||||
if v and v.shadowbanned and v.id == self.author_id and 86400 > time.time() - self.created_utc > 60:
|
||||
ti = max(int((time.time() - self.created_utc)/60), 1)
|
||||
maxupvotes = min(ti, 31)
|
||||
rand = randint(0, maxupvotes)
|
||||
if self.upvotes < rand:
|
||||
amount = randint(0, 3)
|
||||
self.upvotes += amount
|
||||
g.db.add(self)
|
||||
self.author.coins += amount
|
||||
g.db.add(self.author)
|
||||
g.db.commit()
|
||||
|
||||
if v and v.shadowbanned and v.id == self.author_id and 86400 > time.time() - self.created_utc > 60:
|
||||
ti = max(int((time.time() - self.created_utc)/60), 1)
|
||||
maxupvotes = min(ti, 31)
|
||||
rand = randint(0, maxupvotes)
|
||||
if self.upvotes < rand:
|
||||
amount = randint(0, 3)
|
||||
self.upvotes += amount
|
||||
g.db.add(self)
|
||||
self.author.coins += amount
|
||||
g.db.add(self.author)
|
||||
g.db.commit()
|
||||
|
||||
for o in self.options:
|
||||
body += f'<div class="custom-control"><input type="checkbox" class="custom-control-input" id="{o.id}" name="option"'
|
||||
if o.poll_voted(v): body += " checked"
|
||||
if v: body += f''' onchange="poll_vote('{o.id}', '{self.id}')"'''
|
||||
else: body += f''' onchange="poll_vote_no_v('{o.id}', '{self.id}')"'''
|
||||
body += f'''><label class="custom-control-label" for="{o.id}">{o.body_html}<span class="presult-{self.id}'''
|
||||
for c in self.options:
|
||||
body += f'<div class="custom-control"><input type="checkbox" class="custom-control-input" id="{c.id}" name="option"'
|
||||
if c.poll_voted(v): body += " checked"
|
||||
if v: body += f''' onchange="poll_vote('{c.id}', '{self.id}')"'''
|
||||
else: body += f''' onchange="poll_vote_no_v('{c.id}', '{self.id}')"'''
|
||||
body += f'''><label class="custom-control-label" for="{c.id}">{c.body_html}<span class="presult-{self.id}'''
|
||||
if not self.total_poll_voted(v): body += ' d-none'
|
||||
body += f'"> - <a href="/votes?link=t3_{o.id}"><span id="poll-{o.id}">{o.upvotes}</span> votes</a></span></label></div>'
|
||||
body += f'"> - <a href="/votes?link=t3_{c.id}"><span id="poll-{c.id}">{c.upvotes}</span> votes</a></span></label></div>'
|
||||
|
||||
curr = self.total_choice_voted(v)
|
||||
if curr: curr = " value=" + str(curr[0].comment_id)
|
||||
else: curr = ''
|
||||
body += f'<input class="d-none" id="current-{self.id}"{curr}>'
|
||||
|
||||
for c in self.choices:
|
||||
body += f'''<div class="custom-control"><input name="choice-{self.id}" autocomplete="off" class="custom-control-input" type="radio" id="{c.id}" onchange="choice_vote('{c.id}','{self.id}')"'''
|
||||
if c.poll_voted(v): body += " checked "
|
||||
body += f'''><label class="custom-control-label" for="{c.id}">{c.body_html}<span class="presult-{self.id}'''
|
||||
if not self.total_choice_voted(v): body += ' d-none'
|
||||
body += f'"> - <a href="/votes?link=t3_{c.id}"><span id="choice-{c.id}">{c.upvotes}</span> votes</a></span></label></div>'
|
||||
|
||||
if self.author.sig_html and not self.ghost and (self.author_id == MOOSE_ID or not (v and v.sigs_disabled)):
|
||||
body += f"<hr>{self.author.sig_html}"
|
||||
|
@ -393,7 +407,7 @@ class Comment(Base):
|
|||
|
||||
if v and not v.oldreddit: body = body.replace("old.reddit.com", "reddit.com")
|
||||
|
||||
if v and v.nitter: body = body.replace("www.twitter.com", "nitter.net").replace("twitter.com", "nitter.net")
|
||||
if v and v.nitter and not '/i/spaces/' in body: body = body.replace("www.twitter.com", "nitter.net").replace("twitter.com", "nitter.net")
|
||||
|
||||
if v and v.controversial:
|
||||
for i in re.finditer('(/comments/.*?)"', body):
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
from sqlalchemy import *
|
||||
from sqlalchemy.orm import relationship
|
||||
from files.__main__ import Base
|
||||
|
||||
class Mod(Base):
|
||||
|
||||
__tablename__ = "mods"
|
||||
user_id = Column(Integer, ForeignKey("users.id"), primary_key=True)
|
||||
sub = Column(String, ForeignKey("subs.name"), primary_key=True)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<Mod(user_id={self.user_id}, sub={self.sub})>"
|
|
@ -9,7 +9,7 @@ def shuffle(stuff):
|
|||
class Slots:
|
||||
command_word = "!slots"
|
||||
casino_word = "!slotsmb"
|
||||
if SITE == 'rdrama.net': minimum_bet = 100
|
||||
if SITE_NAME == 'Drama': minimum_bet = 100
|
||||
else: minimum_bet = 10
|
||||
maximum_bet = INFINITY
|
||||
payout_to_symbols = {
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
from sqlalchemy import *
|
||||
from sqlalchemy.orm import relationship
|
||||
from files.__main__ import Base
|
||||
|
||||
class Sub(Base):
|
||||
|
||||
__tablename__ = "subs"
|
||||
name = Column(String, primary_key=True)
|
||||
sidebar = Column(String)
|
||||
sidebar_html = Column(String)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<Sub(name={self.name})>"
|
|
@ -12,6 +12,8 @@ from files.helpers.lazy import lazy
|
|||
from .flags import Flag
|
||||
from .comment import Comment
|
||||
from flask import g
|
||||
from .sub import *
|
||||
from .votes import CommentVote
|
||||
|
||||
class Submission(Base):
|
||||
__tablename__ = "submissions"
|
||||
|
@ -56,6 +58,7 @@ class Submission(Base):
|
|||
awards = relationship("AwardRelationship", viewonly=True)
|
||||
reports = relationship("Flag", viewonly=True)
|
||||
comments = relationship("Comment", primaryjoin="Comment.parent_submission==Submission.id")
|
||||
subr = relationship("Sub", primaryjoin="foreign(Submission.sub)==remote(Sub.name)", viewonly=True)
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
@ -66,7 +69,7 @@ class Submission(Base):
|
|||
@property
|
||||
@lazy
|
||||
def comments2(self):
|
||||
return g.db.query(Comment.author_id, Comment.created_utc, Comment.id).filter(Comment.parent_submission == self.id, Comment.author_id.notin_((AUTOPOLLER_ID,AUTOBETTER_ID))).all()
|
||||
return g.db.query(Comment.author_id, Comment.created_utc, Comment.id).filter(Comment.parent_submission == self.id, Comment.author_id.notin_((AUTOPOLLER_ID,AUTOBETTER_ID, AUTOCHOICE_ID))).all()
|
||||
|
||||
@property
|
||||
@lazy
|
||||
|
@ -84,6 +87,11 @@ class Submission(Base):
|
|||
def options(self):
|
||||
return g.db.query(Comment).filter_by(parent_submission = self.id, author_id = AUTOPOLLER_ID, level=1)
|
||||
|
||||
@property
|
||||
@lazy
|
||||
def choices(self):
|
||||
return g.db.query(Comment).filter_by(parent_submission = self.id, author_id = AUTOCHOICE_ID, level=1)
|
||||
|
||||
@property
|
||||
@lazy
|
||||
def bet_options(self):
|
||||
|
@ -95,6 +103,11 @@ class Submission(Base):
|
|||
if option.poll_voted(v): return True
|
||||
return False
|
||||
|
||||
def total_choice_voted(self, v):
|
||||
if v and self.choices:
|
||||
return g.db.query(CommentVote).filter(CommentVote.user_id == v.id, CommentVote.comment_id.in_(tuple(x.id for x in self.choices))).all()
|
||||
return False
|
||||
|
||||
def total_bet_voted(self, v):
|
||||
if "closed" in self.body.lower(): return True
|
||||
if v:
|
||||
|
@ -180,16 +193,10 @@ class Submission(Base):
|
|||
return str(time.strftime("%d/%B/%Y %H:%M:%S UTC", time.gmtime(self.edited_utc)))
|
||||
|
||||
|
||||
if SITE_NAME == 'Too4You':
|
||||
@property
|
||||
@lazy
|
||||
def score(self):
|
||||
return self.upvotes
|
||||
else:
|
||||
@property
|
||||
@lazy
|
||||
def score(self):
|
||||
return self.upvotes - self.downvotes
|
||||
@property
|
||||
@lazy
|
||||
def score(self):
|
||||
return self.upvotes - self.downvotes
|
||||
|
||||
@property
|
||||
@lazy
|
||||
|
@ -346,7 +353,7 @@ class Submission(Base):
|
|||
if v.controversial: url += "&sort=controversial"
|
||||
return url
|
||||
elif self.url:
|
||||
if v and v.nitter: return self.url.replace("www.twitter.com", "nitter.net").replace("twitter.com", "nitter.net")
|
||||
if v and v.nitter and not '/i/spaces/' in self.url: return self.url.replace("www.twitter.com", "nitter.net").replace("twitter.com", "nitter.net")
|
||||
if self.url.startswith('/'): return SITE_FULL + self.url
|
||||
return self.url
|
||||
else: return ""
|
||||
|
@ -362,7 +369,7 @@ class Submission(Base):
|
|||
if v.teddit: body = body.replace("old.reddit.com", "teddit.net")
|
||||
elif not v.oldreddit: body = body.replace("old.reddit.com", "reddit.com")
|
||||
|
||||
if v.nitter: body = body.replace("www.twitter.com", "nitter.net").replace("twitter.com", "nitter.net")
|
||||
if v.nitter and not '/i/spaces/' in body: body = body.replace("www.twitter.com", "nitter.net").replace("twitter.com", "nitter.net")
|
||||
|
||||
if v and v.shadowbanned and v.id == self.author_id and 86400 > time.time() - self.created_utc > 20:
|
||||
ti = max(int((time.time() - self.created_utc)/60), 1)
|
||||
|
@ -377,15 +384,26 @@ class Submission(Base):
|
|||
g.db.add(self.author)
|
||||
g.db.commit()
|
||||
|
||||
for o in self.options:
|
||||
body += f'<div class="custom-control"><input type="checkbox" class="custom-control-input" id="{o.id}" name="option"'
|
||||
if o.poll_voted(v): body += " checked"
|
||||
if v: body += f''' onchange="poll_vote('{o.id}', '{self.id}')"'''
|
||||
else: body += f''' onchange="poll_vote_no_v('{o.id}', '{self.id}')"'''
|
||||
body += f'''><label class="custom-control-label" for="{o.id}">{o.body_html}<span class="presult-{self.id}'''
|
||||
for c in self.options:
|
||||
body += f'<div class="custom-control"><input type="checkbox" class="custom-control-input" id="{c.id}" name="option"'
|
||||
if c.poll_voted(v): body += " checked"
|
||||
if v: body += f''' onchange="poll_vote('{c.id}', '{self.id}')"'''
|
||||
else: body += f''' onchange="poll_vote_no_v('{c.id}', '{self.id}')"'''
|
||||
body += f'''><label class="custom-control-label" for="{c.id}">{c.body_html}<span class="presult-{self.id}'''
|
||||
if not self.total_poll_voted(v): body += ' d-none'
|
||||
body += f'"> - <a href="/votes?link=t3_{o.id}"><span id="poll-{o.id}">{o.upvotes}</span> votes</a></span></label></div>'
|
||||
body += f'"> - <a href="/votes?link=t3_{c.id}"><span id="poll-{c.id}">{c.upvotes}</span> votes</a></span></label></div>'
|
||||
|
||||
curr = self.total_choice_voted(v)
|
||||
if curr: curr = " value=" + str(curr[0].comment_id)
|
||||
else: curr = ''
|
||||
body += f'<input class="d-none" id="current-{self.id}"{curr}>'
|
||||
|
||||
for c in self.choices:
|
||||
body += f'''<div class="custom-control"><input name="choice-{self.id}" autocomplete="off" class="custom-control-input" type="radio" id="{c.id}" onchange="choice_vote('{c.id}','{self.id}')"'''
|
||||
if c.poll_voted(v): body += " checked "
|
||||
body += f'''><label class="custom-control-label" for="{c.id}">{c.body_html}<span class="presult-{self.id}'''
|
||||
if not self.total_choice_voted(v): body += ' d-none'
|
||||
body += f'"> - <a href="/votes?link=t3_{c.id}"><span id="choice-{c.id}">{c.upvotes}</span> votes</a></span></label></div>'
|
||||
|
||||
for c in self.bet_options:
|
||||
body += f'''<div class="custom-control mt-3"><input autocomplete="off" class="custom-control-input bet" type="radio" id="{c.id}" onchange="bet_vote('{c.id}')"'''
|
||||
|
@ -418,7 +436,7 @@ class Submission(Base):
|
|||
if v.teddit: body = body.replace("old.reddit.com", "teddit.net")
|
||||
elif not v.oldreddit: body = body.replace("old.reddit.com", "reddit.com")
|
||||
|
||||
if v.nitter: body = body.replace("www.twitter.com", "nitter.net").replace("twitter.com", "nitter.net")
|
||||
if v.nitter and not '/i/spaces/' in body: body = body.replace("www.twitter.com", "nitter.net").replace("twitter.com", "nitter.net")
|
||||
|
||||
return body
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ from .userblock import *
|
|||
from .badges import *
|
||||
from .clients import *
|
||||
from .mod_logs import *
|
||||
from .mod import *
|
||||
from files.__main__ import Base, cache
|
||||
from files.helpers.security import *
|
||||
import random
|
||||
|
@ -149,6 +150,10 @@ class User(Base):
|
|||
super().__init__(**kwargs)
|
||||
|
||||
|
||||
@lazy
|
||||
def mods(self, sub):
|
||||
return self.admin_level > 1 or g.db.query(Mod.user_id).filter_by(user_id=self.id, sub=sub).one_or_none()
|
||||
|
||||
@property
|
||||
@lazy
|
||||
def csslazy(self):
|
||||
|
@ -430,7 +435,7 @@ class User(Base):
|
|||
@lazy
|
||||
def banner_url(self):
|
||||
if self.bannerurl: return self.bannerurl
|
||||
else: return f"{SITE_FULL}/static/assets/images/{SITE_NAME}/site_preview.webp?a=1009"
|
||||
else: return f"{SITE_FULL}/static/assets/images/{SITE_NAME}/site_preview.webp?a=1011"
|
||||
|
||||
@property
|
||||
@lazy
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,7 @@
|
|||
from os import environ
|
||||
import requests
|
||||
import threading
|
||||
from .const import *
|
||||
|
||||
SERVER_ID = environ.get("DISCORD_SERVER_ID",'').strip()
|
||||
CLIENT_ID = environ.get("DISCORD_CLIENT_ID",'').strip()
|
||||
|
@ -8,18 +9,6 @@ CLIENT_SECRET = environ.get("DISCORD_CLIENT_SECRET",'').strip()
|
|||
BOT_TOKEN = environ.get("DISCORD_BOT_TOKEN",'').strip()
|
||||
AUTH = environ.get("DISCORD_AUTH",'').strip()
|
||||
|
||||
ROLES={
|
||||
"owner": "864612849199480914",
|
||||
"admin": "879459632656048180" if environ.get("DOMAIN") == "pcmemes.net" else "846509661288267776",
|
||||
"linked": "890342909390520382",
|
||||
"1": "868129042346414132",
|
||||
"2": "875569477671067688",
|
||||
"3": "869434199575236649",
|
||||
"4": "868140288013664296",
|
||||
"5": "880445545771044884",
|
||||
"8": "886781932430565418",
|
||||
}
|
||||
|
||||
def discord_wrap(f):
|
||||
|
||||
def wrapper(*args, **kwargs):
|
||||
|
|
|
@ -16,4 +16,4 @@ def post_embed(id, v):
|
|||
|
||||
@app.context_processor
|
||||
def inject_constants():
|
||||
return {"environ":environ, "SITE_NAME":SITE_NAME, "AUTOJANNY_ID":AUTOJANNY_ID, "NOTIFICATIONS_ID":NOTIFICATIONS_ID, "PUSHER_ID":PUSHER_ID, "CC":CC, "CC_TITLE":CC_TITLE, "listdir":listdir, "MOOSE_ID":MOOSE_ID, "AEVANN_ID":AEVANN_ID, "config":app.config.get, "DEFAULT_COLOR":DEFAULT_COLOR, "COLORS":COLORS}
|
||||
return {"environ":environ, "SITE":SITE, "SITE_NAME":SITE_NAME, "SITE_FULL":SITE_FULL, "AUTOJANNY_ID":AUTOJANNY_ID, "NOTIFICATIONS_ID":NOTIFICATIONS_ID, "PUSHER_ID":PUSHER_ID, "CC":CC, "CC_TITLE":CC_TITLE, "listdir":listdir, "MOOSE_ID":MOOSE_ID, "AEVANN_ID":AEVANN_ID, "config":app.config.get, "DEFAULT_COLOR":DEFAULT_COLOR, "COLORS":COLORS, "SUBS": SUBS}
|
||||
|
|
|
@ -100,6 +100,8 @@ allowed_styles = ['color', 'background-color', 'font-weight', 'transform', '-web
|
|||
|
||||
def sanitize(sanitized, noimages=False, alert=False, comment=False, edit=False):
|
||||
|
||||
if sanitized.count(':') > 100: abort(418)
|
||||
|
||||
sanitized = markdown(sanitized)
|
||||
|
||||
sanitized = sanitized.replace("\ufeff", "").replace("𒐪","").replace("<script","").replace('','')
|
||||
|
@ -112,6 +114,8 @@ def sanitize(sanitized, noimages=False, alert=False, comment=False, edit=False):
|
|||
else:
|
||||
sanitized = re.sub('(^|\s|\n|<p>)\/?((r|u)\/(\w|-){3,25})', r'\1<a href="https://old.reddit.com/\2" rel="nofollow noopener noreferrer">\2</a>', sanitized, re.A)
|
||||
|
||||
sanitized = re.sub('(^|\s|\n|<p>)\/?(s\/(\w|-){3,25})', r'\1<a href="/\2" rel="nofollow noopener noreferrer">\2</a>', sanitized, re.A)
|
||||
|
||||
for i in re.finditer('(^|\s|\n|<p>)@((\w|-){1,25})', sanitized, re.A):
|
||||
u = get_user(i.group(2), graceful=True)
|
||||
|
||||
|
@ -157,7 +161,7 @@ def sanitize(sanitized, noimages=False, alert=False, comment=False, edit=False):
|
|||
tag["data-src"] = tag["src"]
|
||||
tag["src"] = "/static/assets/images/loading.webp"
|
||||
tag['alt'] = f'![]({tag["data-src"]})'
|
||||
tag["onclick"] = f"expandDesktopImage(this.src);"
|
||||
tag["onclick"] = "expandDesktopImage(this.src);"
|
||||
tag["data-bs-toggle"] = "modal"
|
||||
tag["data-bs-target"] = "#expandImageModal"
|
||||
|
||||
|
|
|
@ -221,20 +221,19 @@ def club_ban(v, username):
|
|||
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
||||
@admin_level_required(3)
|
||||
def make_meme_admin(v, username):
|
||||
if request.host == 'pcmemes.net' or (SITE_NAME == 'Drama' and v.admin_level > 2) or (request.host != 'rdrama.net' and request.host != 'pcmemes.net'):
|
||||
user = get_user(username)
|
||||
if not user: abort(404)
|
||||
user.admin_level = 1
|
||||
g.db.add(user)
|
||||
user = get_user(username)
|
||||
if not user: abort(404)
|
||||
user.admin_level = 1
|
||||
g.db.add(user)
|
||||
|
||||
ma = ModAction(
|
||||
kind="make_meme_admin",
|
||||
user_id=v.id,
|
||||
target_user_id=user.id
|
||||
)
|
||||
g.db.add(ma)
|
||||
ma = ModAction(
|
||||
kind="make_meme_admin",
|
||||
user_id=v.id,
|
||||
target_user_id=user.id
|
||||
)
|
||||
g.db.add(ma)
|
||||
|
||||
g.db.commit()
|
||||
g.db.commit()
|
||||
return {"message": "User has been made meme admin!"}
|
||||
|
||||
|
||||
|
@ -242,20 +241,19 @@ def make_meme_admin(v, username):
|
|||
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
||||
@admin_level_required(3)
|
||||
def remove_meme_admin(v, username):
|
||||
if request.host == 'pcmemes.net' or (SITE_NAME == 'Drama' and v.admin_level > 2) or (request.host != 'rdrama.net' and request.host != 'pcmemes.net'):
|
||||
user = get_user(username)
|
||||
if not user: abort(404)
|
||||
user.admin_level = 0
|
||||
g.db.add(user)
|
||||
user = get_user(username)
|
||||
if not user: abort(404)
|
||||
user.admin_level = 0
|
||||
g.db.add(user)
|
||||
|
||||
ma = ModAction(
|
||||
kind="remove_meme_admin",
|
||||
user_id=v.id,
|
||||
target_user_id=user.id
|
||||
)
|
||||
g.db.add(ma)
|
||||
ma = ModAction(
|
||||
kind="remove_meme_admin",
|
||||
user_id=v.id,
|
||||
target_user_id=user.id
|
||||
)
|
||||
g.db.add(ma)
|
||||
|
||||
g.db.commit()
|
||||
g.db.commit()
|
||||
return {"message": "Meme admin removed!"}
|
||||
|
||||
|
||||
|
@ -263,7 +261,7 @@ def remove_meme_admin(v, username):
|
|||
@limiter.limit("1/day")
|
||||
@admin_level_required(3)
|
||||
def monthly(v):
|
||||
if request.host == 'rdrama.net' and v.id != AEVANN_ID: abort (403)
|
||||
if SITE_NAME == 'Drama' and v.id != AEVANN_ID: abort (403)
|
||||
|
||||
thing = g.db.query(AwardRelationship).order_by(AwardRelationship.id.desc()).first().id
|
||||
|
||||
|
@ -314,7 +312,7 @@ def monthly(v):
|
|||
def get_sidebar(v):
|
||||
|
||||
try:
|
||||
with open(f'files/templates/sidebar_{SITE_NAME}.html', 'r') as f: sidebar = f.read()
|
||||
with open(f'files/templates/sidebar_{SITE_NAME}.html', 'r', encoding="utf-8") as f: sidebar = f.read()
|
||||
except:
|
||||
sidebar = None
|
||||
|
||||
|
@ -328,9 +326,9 @@ def post_sidebar(v):
|
|||
|
||||
text = request.values.get('sidebar', '').strip()
|
||||
|
||||
with open(f'files/templates/sidebar_{SITE_NAME}.html', 'w+') as f: f.write(text)
|
||||
with open(f'files/templates/sidebar_{SITE_NAME}.html', 'w+', encoding="utf-8") as f: f.write(text)
|
||||
|
||||
with open(f'files/templates/sidebar_{SITE_NAME}.html', 'r') as f: sidebar = f.read()
|
||||
with open(f'files/templates/sidebar_{SITE_NAME}.html', 'r', encoding="utf-8") as f: sidebar = f.read()
|
||||
|
||||
ma = ModAction(
|
||||
kind="change_sidebar",
|
||||
|
@ -343,6 +341,41 @@ def post_sidebar(v):
|
|||
return render_template('admin/sidebar.html', v=v, sidebar=sidebar, msg='Sidebar edited successfully!')
|
||||
|
||||
|
||||
@app.get('/s/<sub>/sidebar')
|
||||
@auth_required
|
||||
def get_sub_sidebar(v, sub):
|
||||
sub = g.db.query(Sub).filter_by(name=sub).one_or_none()
|
||||
if not sub: abort(404)
|
||||
|
||||
if not v.mods(sub.name): abort(403)
|
||||
|
||||
return render_template('admin/sidebar.html', v=v, sidebar=sub.sidebar, sub=sub)
|
||||
|
||||
|
||||
@app.post('/s/<sub>/sidebar')
|
||||
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
||||
@auth_required
|
||||
def post_sub_sidebar(v, sub):
|
||||
sub = g.db.query(Sub).filter_by(name=sub).one_or_none()
|
||||
if not sub: abort(404)
|
||||
|
||||
if not v.mods(sub.name): abort(403)
|
||||
|
||||
sub.sidebar = request.values.get('sidebar', '').strip()
|
||||
sub.sidebar_html = sanitize(sub.sidebar)
|
||||
g.db.add(sub)
|
||||
|
||||
ma = ModAction(
|
||||
kind="change_sidebar",
|
||||
user_id=v.id
|
||||
)
|
||||
g.db.add(ma)
|
||||
|
||||
g.db.commit()
|
||||
|
||||
return render_template('admin/sidebar.html', v=v, sidebar=sub.sidebar, msg='Sidebar edited successfully!', sub=sub)
|
||||
|
||||
|
||||
@app.get("/admin/shadowbanned")
|
||||
@auth_required
|
||||
def shadowbanned(v):
|
||||
|
|
|
@ -57,7 +57,7 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None, sub=None):
|
|||
|
||||
if not pid:
|
||||
if comment.parent_submission: pid = comment.parent_submission
|
||||
elif request.host == "rdrama.net": pid = 6489
|
||||
elif SITE_NAME == 'Drama': pid = 6489
|
||||
elif request.host == 'pcmemes.net': pid = 2487
|
||||
else: pid = 1
|
||||
|
||||
|
@ -102,7 +102,7 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None, sub=None):
|
|||
|
||||
comments=comments.filter(
|
||||
Comment.parent_submission == post.id,
|
||||
Comment.author_id.notin_((AUTOPOLLER_ID, AUTOBETTER_ID))
|
||||
Comment.author_id.notin_((AUTOPOLLER_ID, AUTOBETTER_ID, AUTOCHOICE_ID))
|
||||
).join(
|
||||
votes,
|
||||
votes.c.comment_id == Comment.id,
|
||||
|
@ -131,7 +131,7 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None, sub=None):
|
|||
else:
|
||||
if post.is_banned and not (v and (v.admin_level > 1 or post.author_id == v.id)): template = "submission_banned.html"
|
||||
else: template = "submission.html"
|
||||
return render_template(template, v=v, p=post, sort=sort, comment_info=comment_info, render_replies=True, sub=post.sub)
|
||||
return render_template(template, v=v, p=post, sort=sort, comment_info=comment_info, render_replies=True, sub=post.subr)
|
||||
|
||||
@app.post("/comment")
|
||||
@limiter.limit("1/second;20/minute;200/hour;1000/day")
|
||||
|
@ -165,7 +165,7 @@ def api_comment(v):
|
|||
body = request.values.get("body", "").strip()[:10000]
|
||||
|
||||
if v.admin_level == 3 and parent_post.id == 37749:
|
||||
with open(f"snappy_{SITE_NAME}.txt", "a") as f:
|
||||
with open(f"snappy_{SITE_NAME}.txt", "a", encoding="utf-8") as f:
|
||||
f.write('\n{[para]}\n' + body)
|
||||
|
||||
if v.marseyawarded and parent_post.id not in (37696,37697,37749,37833,37838):
|
||||
|
@ -186,6 +186,11 @@ def api_comment(v):
|
|||
options.append(i.group(1))
|
||||
body = body.replace(i.group(0), "")
|
||||
|
||||
choices = []
|
||||
for i in re.finditer('\s*##([^\$\n]+)##\s*', body, re.A):
|
||||
choices.append(i.group(1))
|
||||
body = body.replace(i.group(0), "")
|
||||
|
||||
if request.files.get("file") and request.headers.get("cf-ipcountry") != "T1":
|
||||
file=request.files["file"]
|
||||
if file.content_type.startswith('image/'):
|
||||
|
@ -353,6 +358,17 @@ def api_comment(v):
|
|||
|
||||
g.db.add(c_option)
|
||||
|
||||
for choice in choices:
|
||||
c_choice = Comment(author_id=AUTOCHOICE_ID,
|
||||
parent_submission=parent_submission,
|
||||
parent_comment_id=c.id,
|
||||
level=level+1,
|
||||
body_html=filter_emojis_only(choice),
|
||||
upvotes=0,
|
||||
is_bot=True
|
||||
)
|
||||
|
||||
g.db.add(c_choice)
|
||||
|
||||
if request.host == 'pcmemes.net' and c.body.lower().startswith("based"):
|
||||
pill = re.match("based and (.{1,20}?)(-| )pilled", body, re.IGNORECASE)
|
||||
|
@ -419,7 +435,7 @@ def api_comment(v):
|
|||
n = Notification(comment_id=c_jannied.id, user_id=v.id)
|
||||
g.db.add(n)
|
||||
|
||||
elif request.host == 'rdrama.net' and 'nigg' in c.body.lower() and not v.nwordpass:
|
||||
elif SITE_NAME == 'Drama' and 'nigg' in c.body.lower() and not v.nwordpass:
|
||||
|
||||
c.is_banned = True
|
||||
c.ban_reason = "AutoJanny"
|
||||
|
@ -447,7 +463,7 @@ def api_comment(v):
|
|||
n = Notification(comment_id=c_jannied.id, user_id=v.id)
|
||||
g.db.add(n)
|
||||
|
||||
if request.host == "rdrama.net" and len(c.body) >= 1000 and "<" not in body and "</blockquote>" not in body_html:
|
||||
if SITE_NAME == 'Drama' and len(c.body) >= 1000 and "<" not in body and "</blockquote>" not in body_html:
|
||||
|
||||
body = random.choice(LONGPOST_REPLIES)
|
||||
|
||||
|
@ -476,7 +492,7 @@ def api_comment(v):
|
|||
g.db.add(n)
|
||||
|
||||
|
||||
if request.host == "rdrama.net" and random.random() < 0.001:
|
||||
if SITE_NAME == 'Drama' and random.random() < 0.001:
|
||||
|
||||
body = "zoz"
|
||||
body_html2 = sanitize(body)
|
||||
|
@ -548,7 +564,8 @@ def api_comment(v):
|
|||
|
||||
for x in g.db.query(Subscription.user_id).filter_by(submission_id=c.parent_submission).all(): notify_users.add(x[0])
|
||||
|
||||
if parent.author.id not in [v.id, BASEDBOT_ID, AUTOJANNY_ID, SNAPPY_ID, LONGPOSTBOT_ID, ZOZBOT_ID, AUTOPOLLER_ID]: notify_users.add(parent.author.id)
|
||||
if parent.author.id not in (v.id, BASEDBOT_ID, AUTOJANNY_ID, SNAPPY_ID, LONGPOSTBOT_ID, ZOZBOT_ID, AUTOPOLLER_ID, AUTOCHOICE_ID):
|
||||
notify_users.add(parent.author.id)
|
||||
|
||||
for x in notify_users:
|
||||
n = Notification(comment_id=c.id, user_id=x)
|
||||
|
@ -567,7 +584,7 @@ def api_comment(v):
|
|||
'title': f'New reply by @{c.author_name}',
|
||||
'body': notifbody,
|
||||
'deep_link': f'{SITE_FULL}/comment/{c.id}?context=8&read=true#context',
|
||||
'icon': f'{SITE_FULL}/assets/images/{SITE_NAME}/icon.webp?a=1009',
|
||||
'icon': f'{SITE_FULL}/assets/images/{SITE_NAME}/icon.webp?a=1010',
|
||||
}
|
||||
},
|
||||
'fcm': {
|
||||
|
@ -625,7 +642,7 @@ def api_comment(v):
|
|||
slots.check_for_slots_command(body, v, c)
|
||||
|
||||
blackjack = Blackjack(g)
|
||||
blackjack.check_for_blackjack_command(body, v, c)
|
||||
blackjack.check_for_blackjack_commands(body, v, c)
|
||||
|
||||
treasure = Treasure(g)
|
||||
treasure.check_for_treasure(body, c)
|
||||
|
@ -685,6 +702,19 @@ def edit_comment(cid, v):
|
|||
)
|
||||
g.db.add(c_option)
|
||||
|
||||
if not c.choices:
|
||||
for i in re.finditer('\s*##([^\$\n]+)##\s*', body, re.A):
|
||||
body = body.replace(i.group(0), "")
|
||||
c_choice = Comment(author_id=AUTOCHOICE_ID,
|
||||
parent_submission=c.parent_submission,
|
||||
parent_comment_id=c.id,
|
||||
level=c.level+1,
|
||||
body_html=filter_emojis_only(i.group(1)),
|
||||
upvotes=0,
|
||||
is_bot=True
|
||||
)
|
||||
g.db.add(c_choice)
|
||||
|
||||
body_html = sanitize(body, edit=True)
|
||||
|
||||
if v.marseyawarded and len(list(re.finditer('>[^<\s+]|[^>\s+]<', body_html, re.A))): return {"error":"You can only type marseys!"}, 403
|
||||
|
@ -792,7 +822,7 @@ def edit_comment(cid, v):
|
|||
n = Notification(comment_id=c_jannied.id, user_id=v.id)
|
||||
g.db.add(n)
|
||||
|
||||
elif request.host == 'rdrama.net' and 'nigg' in c.body.lower() and not v.nwordpass:
|
||||
elif SITE_NAME == 'Drama' and 'nigg' in c.body.lower() and not v.nwordpass:
|
||||
|
||||
c.is_banned = True
|
||||
c.ban_reason = "AutoJanny"
|
||||
|
|
|
@ -5,6 +5,7 @@ import time
|
|||
from files.__main__ import app, limiter
|
||||
|
||||
|
||||
|
||||
@app.errorhandler(400)
|
||||
def error_400(e):
|
||||
if request.headers.get("Authorization") or request.headers.get("xhr"): return {"error": "400 Bad Request"}, 400
|
||||
|
@ -20,7 +21,6 @@ def error_401(e):
|
|||
argval = quote(f"{path}?{qs}", safe='')
|
||||
return redirect(f"{SITE_FULL}/login?redirect={argval}")
|
||||
|
||||
|
||||
@app.errorhandler(403)
|
||||
def error_403(e):
|
||||
if request.headers.get("Authorization") or request.headers.get("xhr"): return {"error": "403 Forbidden"}, 403
|
||||
|
@ -32,17 +32,19 @@ def error_404(e):
|
|||
if request.headers.get("Authorization") or request.headers.get("xhr"): return {"error": "404 Not Found"}, 404
|
||||
else: return render_template('errors/404.html', err=True), 404
|
||||
|
||||
|
||||
@app.errorhandler(405)
|
||||
def error_405(e):
|
||||
if request.headers.get("Authorization") or request.headers.get("xhr"): return {"error": "405 Method Not Allowed"}, 405
|
||||
else: return render_template('errors/405.html', err=True), 405
|
||||
|
||||
|
||||
@app.errorhandler(413)
|
||||
def error_413(e):
|
||||
return {"error": "Max file size is 4 MB (8 MB for paypigs)"}, 413
|
||||
|
||||
@app.errorhandler(418)
|
||||
def error_418(e):
|
||||
return {"error": "Too many emojis!"}, 418
|
||||
|
||||
@app.errorhandler(429)
|
||||
def error_429(e):
|
||||
if request.headers.get("Authorization") or request.headers.get("xhr"): return {"error": "429 Too Many Requests"}, 429
|
||||
|
|
|
@ -133,7 +133,10 @@ def notifications(v):
|
|||
@limiter.limit("3/second;30/minute;400/hour;2000/day")
|
||||
@auth_desired
|
||||
def front_all(v, sub=None):
|
||||
if sub and sub not in subs: sub = None
|
||||
if sub: sub = g.db.query(Sub).filter_by(name=sub).one_or_none()
|
||||
|
||||
if request.path.startswith('/s/') and not sub: abort(404)
|
||||
|
||||
if g.webview and not session.get("session_id"):
|
||||
session.permanent = True
|
||||
session["session_id"] = secrets.token_hex(49)
|
||||
|
@ -256,8 +259,7 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, ccmode="false"
|
|||
|
||||
posts = g.db.query(Submission)
|
||||
|
||||
if sub: posts = posts.filter_by(sub=sub)
|
||||
else: posts = posts.filter_by(sub=None)
|
||||
if sub: posts = posts.filter_by(sub=sub.name)
|
||||
|
||||
if t == 'all': cutoff = 0
|
||||
else:
|
||||
|
@ -302,7 +304,7 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, ccmode="false"
|
|||
|
||||
if sort == "hot":
|
||||
ti = int(time.time()) + 3600
|
||||
posts = posts.order_by(-1000000*(Submission.realupvotes + 1 + Submission.comment_count/5 + (func.length(Submission.body_html)-func.length(func.replace(Submission.body_html,'</a>','')))/4)/(func.power(((ti - Submission.created_utc)/1000), 1.23)))
|
||||
posts = posts.order_by(-1000000*(Submission.realupvotes + 1 + Submission.comment_count/5 + (func.length(Submission.body_html)-func.length(func.replace(Submission.body_html,'</a>',''))))/(func.power(((ti - Submission.created_utc)/1000), 1.23)))
|
||||
elif sort == "new":
|
||||
posts = posts.order_by(Submission.created_utc.desc())
|
||||
elif sort == "old":
|
||||
|
@ -327,8 +329,7 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, ccmode="false"
|
|||
|
||||
if (sort == "hot" or (v and v.id == Q_ID)) and page == 1 and ccmode == "false":
|
||||
pins = g.db.query(Submission).filter(Submission.stickied != None, Submission.is_banned == False)
|
||||
if sub: pins = pins.filter_by(sub=sub)
|
||||
else: pins = pins.filter_by(sub=None)
|
||||
if sub: pins = pins.filter_by(sub=sub.name)
|
||||
if v and v.admin_level == 0:
|
||||
blocking = [x[0] for x in g.db.query(UserBlock.target_id).filter_by(user_id=v.id).all()]
|
||||
blocked = [x[0] for x in g.db.query(UserBlock.user_id).filter_by(target_id=v.id).all()]
|
||||
|
@ -447,7 +448,7 @@ def comment_idlist(page=1, v=None, nsfw=False, sort="new", t="all"):
|
|||
|
||||
cc_idlist = [x[0] for x in g.db.query(Submission.id).filter(Submission.club == True).all()]
|
||||
|
||||
comments = g.db.query(Comment.id).filter(Comment.parent_submission.notin_(cc_idlist))
|
||||
comments = g.db.query(Comment.id).filter(Comment.parent_submission != None, Comment.parent_submission.notin_(cc_idlist))
|
||||
|
||||
if v and v.admin_level <= 3:
|
||||
blocking = [x[0] for x in g.db.query(
|
||||
|
|
|
@ -85,7 +85,10 @@ def login_post():
|
|||
username = request.values.get("username")
|
||||
|
||||
if not username: abort(400)
|
||||
account = get_user(username, graceful=True)
|
||||
if username.startswith('@'): username = username[1:]
|
||||
|
||||
if "@" in username: account = g.db.query(User).filter(User.email.ilike(username)).one_or_none()
|
||||
else: account = get_user(username, graceful=True)
|
||||
|
||||
if not account:
|
||||
time.sleep(random.uniform(0, 2))
|
||||
|
@ -312,9 +315,9 @@ def sign_up_post(v):
|
|||
g.db.add(new_badge)
|
||||
|
||||
|
||||
id_1 = g.db.query(User.id).filter_by(id=8).count()
|
||||
id_1 = g.db.query(User.id).filter_by(id=9).count()
|
||||
users_count = g.db.query(User.id).count()
|
||||
if id_1 == 0 and users_count == 7: admin_level=3
|
||||
if id_1 == 0 and users_count == 8: admin_level=3
|
||||
else: admin_level=0
|
||||
|
||||
new_user = User(
|
||||
|
|
|
@ -5,7 +5,6 @@ from files.helpers.const import *
|
|||
from files.classes import *
|
||||
from flask import *
|
||||
from files.__main__ import app, limiter
|
||||
from sqlalchemy.orm import joinedload
|
||||
|
||||
@app.get("/authorize")
|
||||
@auth_required
|
||||
|
@ -190,13 +189,9 @@ def admin_app_id(v, aid):
|
|||
|
||||
aid=aid
|
||||
|
||||
oauth = g.db.query(OauthApp).options(
|
||||
joinedload(
|
||||
OauthApp.author)).filter_by(
|
||||
id=aid).one_or_none()
|
||||
oauth = g.db.query(OauthApp).filter_by(id=aid).one_or_none()
|
||||
|
||||
pids=oauth.idlist(page=int(request.values.get("page",1)),
|
||||
)
|
||||
pids=oauth.idlist(page=int(request.values.get("page",1)))
|
||||
|
||||
next_exists=len(pids)==101
|
||||
pids=pids[:100]
|
||||
|
@ -216,10 +211,7 @@ def admin_app_id_comments(v, aid):
|
|||
|
||||
aid=aid
|
||||
|
||||
oauth = g.db.query(OauthApp).options(
|
||||
joinedload(
|
||||
OauthApp.author)).filter_by(
|
||||
id=aid).one_or_none()
|
||||
oauth = g.db.query(OauthApp).filter_by(id=aid).one_or_none()
|
||||
|
||||
cids=oauth.comments_idlist(page=int(request.values.get("page",1)),
|
||||
)
|
||||
|
|
|
@ -24,7 +24,7 @@ marseys = tuple(f':#{x[0]}:' for x in db.query(Marsey.name).all())
|
|||
db.close()
|
||||
|
||||
if path.exists(f'snappy_{SITE_NAME}.txt'):
|
||||
with open(f'snappy_{SITE_NAME}.txt', "r") as f:
|
||||
with open(f'snappy_{SITE_NAME}.txt', "r", encoding="utf-8") as f:
|
||||
if SITE == 'pcmemes.net': snappyquotes = tuple(f.read().split("{[para]}"))
|
||||
else: snappyquotes = tuple(f.read().split("{[para]}")) + marseys
|
||||
else: snappyquotes = marseys
|
||||
|
@ -91,7 +91,10 @@ def publish(pid, v):
|
|||
@app.get("/s/<sub>/submit")
|
||||
@auth_required
|
||||
def submit_get(v, sub=None):
|
||||
if sub and sub not in subs: sub = None
|
||||
if sub: sub = g.db.query(Sub.name).filter_by(name=sub).one_or_none()
|
||||
|
||||
if request.path.startswith('/s/') and not sub: abort(404)
|
||||
|
||||
return render_template("submit.html", v=v, sub=sub)
|
||||
|
||||
@app.get("/post/<pid>")
|
||||
|
@ -145,7 +148,7 @@ def post_id(pid, anything=None, v=None, sub=None):
|
|||
if not (v and v.shadowbanned) and not (v and v.admin_level > 1):
|
||||
comments = comments.join(User, User.id == Comment.author_id).filter(User.shadowbanned == None)
|
||||
|
||||
comments=comments.filter(Comment.parent_submission == post.id, Comment.author_id.notin_((AUTOPOLLER_ID, AUTOBETTER_ID))).join(
|
||||
comments=comments.filter(Comment.parent_submission == post.id, Comment.author_id.notin_((AUTOPOLLER_ID, AUTOBETTER_ID, AUTOCHOICE_ID))).join(
|
||||
votes,
|
||||
votes.c.comment_id == Comment.id,
|
||||
isouter=True
|
||||
|
@ -188,7 +191,7 @@ def post_id(pid, anything=None, v=None, sub=None):
|
|||
else:
|
||||
pinned = g.db.query(Comment).filter(Comment.parent_submission == post.id, Comment.is_pinned != None).all()
|
||||
|
||||
comments = g.db.query(Comment).join(User, User.id == Comment.author_id).filter(User.shadowbanned == None, Comment.parent_submission == post.id, Comment.author_id.notin_((AUTOPOLLER_ID, AUTOBETTER_ID)), Comment.level == 1, Comment.is_pinned == None)
|
||||
comments = g.db.query(Comment).join(User, User.id == Comment.author_id).filter(User.shadowbanned == None, Comment.parent_submission == post.id, Comment.author_id.notin_((AUTOPOLLER_ID, AUTOBETTER_ID, AUTOCHOICE_ID)), Comment.level == 1, Comment.is_pinned == None)
|
||||
|
||||
if sort == "new":
|
||||
comments = comments.order_by(Comment.created_utc.desc())
|
||||
|
@ -239,7 +242,7 @@ def post_id(pid, anything=None, v=None, sub=None):
|
|||
|
||||
post.views += 1
|
||||
g.db.add(post)
|
||||
if request.host != 'old.rdrama.net' and post.over_18 and not (v and v.over_18) and session.get('over_18', 0) < int(time.time()):
|
||||
if post.over_18 and not (v and v.over_18) and session.get('over_18', 0) < int(time.time()):
|
||||
if request.headers.get("Authorization") or request.headers.get("xhr"): return {"error":"Must be 18+ to view"}, 451
|
||||
return render_template("errors/nsfw.html", v=v)
|
||||
|
||||
|
@ -248,14 +251,16 @@ def post_id(pid, anything=None, v=None, sub=None):
|
|||
else:
|
||||
if post.is_banned and not (v and (v.admin_level > 1 or post.author_id == v.id)): template = "submission_banned.html"
|
||||
else: template = "submission.html"
|
||||
return render_template(template, v=v, p=post, ids=list(ids), sort=sort, render_replies=True, offset=offset, sub=post.sub)
|
||||
return render_template(template, v=v, p=post, ids=list(ids), sort=sort, render_replies=True, offset=offset, sub=post.subr)
|
||||
|
||||
@app.post("/viewmore/<pid>/<sort>/<offset>")
|
||||
@app.get("/viewmore/<pid>/<sort>/<offset>")
|
||||
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
||||
@auth_desired
|
||||
def viewmore(v, pid, sort, offset):
|
||||
offset = int(offset)
|
||||
ids = set(int(x) for x in request.values.get("ids").split(','))
|
||||
try: ids = set(int(x) for x in request.values.get("ids").split(','))
|
||||
except: abort(400)
|
||||
|
||||
if v:
|
||||
votes = g.db.query(CommentVote).filter_by(user_id=v.id).subquery()
|
||||
|
||||
|
@ -268,7 +273,7 @@ def viewmore(v, pid, sort, offset):
|
|||
votes.c.vote_type,
|
||||
blocking.c.id,
|
||||
blocked.c.id,
|
||||
).filter(Comment.parent_submission == pid, Comment.author_id.notin_((AUTOPOLLER_ID, AUTOBETTER_ID)), Comment.is_pinned == None, Comment.id.notin_(ids))
|
||||
).filter(Comment.parent_submission == pid, Comment.author_id.notin_((AUTOPOLLER_ID, AUTOBETTER_ID, AUTOCHOICE_ID)), Comment.is_pinned == None, Comment.id.notin_(ids))
|
||||
|
||||
if not (v and v.shadowbanned) and not (v and v.admin_level > 1):
|
||||
comments = comments.join(User, User.id == Comment.author_id).filter(User.shadowbanned == None)
|
||||
|
@ -312,7 +317,7 @@ def viewmore(v, pid, sort, offset):
|
|||
second = [c[0] for c in comments.filter(or_(Comment.slots_result != None, Comment.blackjack_result != None), func.length(Comment.body) <= 50).all()]
|
||||
comments = first + second
|
||||
else:
|
||||
comments = g.db.query(Comment).join(User, User.id == Comment.author_id).filter(User.shadowbanned == None, Comment.parent_submission == pid, Comment.author_id.notin_((AUTOPOLLER_ID, AUTOBETTER_ID)), Comment.level == 1, Comment.is_pinned == None, Comment.id.notin_(ids))
|
||||
comments = g.db.query(Comment).join(User, User.id == Comment.author_id).filter(User.shadowbanned == None, Comment.parent_submission == pid, Comment.author_id.notin_((AUTOPOLLER_ID, AUTOBETTER_ID, AUTOCHOICE_ID)), Comment.level == 1, Comment.is_pinned == None, Comment.id.notin_(ids))
|
||||
|
||||
if sort == "new":
|
||||
comments = comments.order_by(Comment.created_utc.desc())
|
||||
|
@ -353,7 +358,7 @@ def viewmore(v, pid, sort, offset):
|
|||
return render_template("comments.html", v=v, comments=comments, ids=list(ids), render_replies=True, pid=pid, sort=sort, offset=offset, ajax=True)
|
||||
|
||||
|
||||
@app.post("/morecomments/<cid>")
|
||||
@app.get("/morecomments/<cid>")
|
||||
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
||||
@auth_desired
|
||||
def morecomments(v, cid):
|
||||
|
@ -471,6 +476,18 @@ def edit_post(pid, v):
|
|||
)
|
||||
g.db.add(c)
|
||||
|
||||
if not p.choices.count():
|
||||
for i in re.finditer('\s*##([^\$\n]+)##\s*', body, re.A):
|
||||
body = body.replace(i.group(0), "")
|
||||
c = Comment(author_id=AUTOCHOICE_ID,
|
||||
parent_submission=p.id,
|
||||
level=1,
|
||||
body_html=filter_emojis_only(i.group(1)),
|
||||
upvotes=0,
|
||||
is_bot=True
|
||||
)
|
||||
g.db.add(c)
|
||||
|
||||
body_html = sanitize(body, edit=True)
|
||||
|
||||
bans = filter_comment_html(body_html)
|
||||
|
@ -523,7 +540,7 @@ def edit_post(pid, v):
|
|||
n = Notification(comment_id=c_jannied.id, user_id=v.id)
|
||||
g.db.add(n)
|
||||
|
||||
elif request.host == 'rdrama.net' and 'nigg' in f'{p.body}{p.title}'.lower() and not v.nwordpass:
|
||||
elif SITE_NAME == 'Drama' and 'nigg' in f'{p.body}{p.title}'.lower() and not v.nwordpass:
|
||||
|
||||
p.is_banned = True
|
||||
p.ban_reason = "AutoJanny"
|
||||
|
@ -703,17 +720,18 @@ def thumbnail_thread(pid):
|
|||
db.add(post)
|
||||
db.commit()
|
||||
|
||||
if SITE == 'rdrama.net':
|
||||
if SITE_NAME == 'Drama':
|
||||
for t in ("submission","comment"):
|
||||
for i in requests.get(f'https://api.pushshift.io/reddit/{t}/search?html_decode=true&q=rdrama&size=1').json()["data"]:
|
||||
word = random.choice(('rdrama','marsey'))
|
||||
|
||||
body_html = sanitize(f'New rdrama mention: https://old.reddit.com{i["permalink"]}?context=89', noimages=True)
|
||||
for i in requests.get(f'https://api.pushshift.io/reddit/{t}/search?html_decode=true&q={word}&size=1').json()["data"]:
|
||||
|
||||
body_html = sanitize(f'New {word} mention: https://old.reddit.com{i["permalink"]}?context=89', noimages=True)
|
||||
|
||||
existing_comment = db.query(Comment.id).filter_by(author_id=NOTIFICATIONS_ID, parent_submission=None, distinguish_level=6, body_html=body_html, level=1, sentto=0).first()
|
||||
|
||||
if existing_comment: break
|
||||
|
||||
print(body_html, flush=True)
|
||||
new_comment = Comment(author_id=NOTIFICATIONS_ID,
|
||||
parent_submission=None,
|
||||
distinguish_level=6,
|
||||
|
@ -729,13 +747,13 @@ def thumbnail_thread(pid):
|
|||
notif = Notification(comment_id=new_comment.id, user_id=admin.id)
|
||||
db.add(notif)
|
||||
|
||||
for i in requests.get(f'https://api.pushshift.io/reddit/{t}/search?html_decode=true&q=aevann&size=1').json()["data"]:
|
||||
k,val = random.choice(tuple(REDDIT_NOTIFS.items()))
|
||||
for i in requests.get(f'https://api.pushshift.io/reddit/{t}/search?html_decode=true&q={k}&size=1').json()["data"]:
|
||||
try: body_html = sanitize(f'New mention of you: https://old.reddit.com{i["permalink"]}?context=89', noimages=True)
|
||||
except: continue
|
||||
existing_comment = db.query(Comment.id).filter_by(author_id=NOTIFICATIONS_ID, parent_submission=None, distinguish_level=6, body_html=body_html).first()
|
||||
if existing_comment: break
|
||||
|
||||
print(body_html, flush=True)
|
||||
new_comment = Comment(author_id=NOTIFICATIONS_ID,
|
||||
parent_submission=None,
|
||||
distinguish_level=6,
|
||||
|
@ -745,10 +763,35 @@ def thumbnail_thread(pid):
|
|||
db.add(new_comment)
|
||||
db.flush()
|
||||
|
||||
notif = Notification(comment_id=new_comment.id, user_id=AEVANN_ID)
|
||||
notif = Notification(comment_id=new_comment.id, user_id=val)
|
||||
db.add(notif)
|
||||
|
||||
|
||||
if SITE == 'pcmemes.net':
|
||||
for t in ("submission","comment"):
|
||||
for i in requests.get(f'https://api.pushshift.io/reddit/{t}/search?html_decode=true&q=pcmemes.net&size=1').json()["data"]:
|
||||
|
||||
body_html = sanitize(f'New pcmemes mention: https://old.reddit.com{i["permalink"]}?context=89', noimages=True)
|
||||
|
||||
existing_comment = db.query(Comment.id).filter_by(author_id=NOTIFICATIONS_ID, parent_submission=None, distinguish_level=6, body_html=body_html, level=1, sentto=0).first()
|
||||
|
||||
if existing_comment: break
|
||||
|
||||
new_comment = Comment(author_id=NOTIFICATIONS_ID,
|
||||
parent_submission=None,
|
||||
distinguish_level=6,
|
||||
body_html=body_html,
|
||||
level=1,
|
||||
sentto=0,
|
||||
)
|
||||
db.add(new_comment)
|
||||
db.flush()
|
||||
|
||||
admins = db.query(User).filter(User.admin_level > 2).all()
|
||||
for admin in admins:
|
||||
notif = Notification(comment_id=new_comment.id, user_id=admin.id)
|
||||
db.add(notif)
|
||||
|
||||
db.commit()
|
||||
db.close()
|
||||
stdout.flush()
|
||||
|
@ -760,7 +803,11 @@ def thumbnail_thread(pid):
|
|||
@limiter.limit("1/second;6/minute;200/hour;1000/day")
|
||||
@auth_required
|
||||
def submit_post(v, sub=None):
|
||||
if sub and sub not in subs: sub = None
|
||||
if not sub: sub = request.values.get("sub")
|
||||
sub = g.db.query(Sub.name).filter_by(name=sub).one_or_none()
|
||||
if sub: sub = sub[0]
|
||||
else: sub = None
|
||||
|
||||
if v.is_suspended: return {"error": "You can't perform this action while banned."}, 403
|
||||
|
||||
if v and v.patron:
|
||||
|
@ -953,6 +1000,11 @@ def submit_post(v, sub=None):
|
|||
options.append(i.group(1))
|
||||
body = body.replace(i.group(0), "")
|
||||
|
||||
choices = []
|
||||
for i in re.finditer('\s*##([^\$\n]+)##\s*', body, re.A):
|
||||
choices.append(i.group(1))
|
||||
body = body.replace(i.group(0), "")
|
||||
|
||||
if v.agendaposter and not v.marseyawarded: body = torture_ap(body, v.username)
|
||||
|
||||
if request.files.get("file2") and request.headers.get("cf-ipcountry") != "T1":
|
||||
|
@ -970,7 +1022,7 @@ def submit_post(v, sub=None):
|
|||
body += f"\n\n{url}"
|
||||
else:
|
||||
if request.headers.get("Authorization") or request.headers.get("xhr"): return {"error": "Image/Video files only"}, 400
|
||||
return render_template("submit.html", v=v, error=f"Image/Video files only."), 400
|
||||
return render_template("submit.html", v=v, error="Image/Video files only."), 400
|
||||
|
||||
if '#fortune' in body:
|
||||
body = body.replace('#fortune', '')
|
||||
|
@ -1040,7 +1092,16 @@ def submit_post(v, sub=None):
|
|||
upvotes=0,
|
||||
is_bot=True
|
||||
)
|
||||
g.db.add(c)
|
||||
|
||||
for choice in choices:
|
||||
c = Comment(author_id=AUTOCHOICE_ID,
|
||||
parent_submission=new_post.id,
|
||||
level=1,
|
||||
body_html=filter_emojis_only(choice),
|
||||
upvotes=0,
|
||||
is_bot=True
|
||||
)
|
||||
g.db.add(c)
|
||||
|
||||
vote = Vote(user_id=v.id,
|
||||
|
@ -1074,7 +1135,7 @@ def submit_post(v, sub=None):
|
|||
|
||||
|
||||
if not new_post.thumburl and new_post.url:
|
||||
if request.host in new_post.url or new_post.url.startswith('/') or request.host == 'rdrama.net' and 'rdrama' in new_post.domain:
|
||||
if request.host in new_post.url or new_post.url.startswith('/') or new_post.domain == SITE:
|
||||
new_post.thumburl = f'/static/assets/images/{SITE_NAME}/site_preview.webp'
|
||||
elif request.headers.get('cf-ipcountry')!="T1":
|
||||
gevent.spawn( thumbnail_thread, new_post.id)
|
||||
|
@ -1120,7 +1181,7 @@ def submit_post(v, sub=None):
|
|||
n = Notification(comment_id=c_jannied.id, user_id=v.id)
|
||||
g.db.add(n)
|
||||
|
||||
elif request.host == 'rdrama.net' and 'nigg' in f'{new_post.body}{new_post.title}'.lower() and not v.nwordpass:
|
||||
elif SITE_NAME == 'Drama' and 'nigg' in f'{new_post.body}{new_post.title}'.lower() and not v.nwordpass:
|
||||
|
||||
new_post.is_banned = True
|
||||
new_post.ban_reason = "AutoJanny"
|
||||
|
@ -1167,7 +1228,7 @@ def submit_post(v, sub=None):
|
|||
gevent.spawn(archiveorg, newposturl)
|
||||
|
||||
url_regex = '<a href=\"(https?:\/\/[a-z]{1,20}\.[^\"]+)\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">(.*?)<\/a>'
|
||||
for url_match in re.finditer(url_regex, new_post.body_html):
|
||||
for url_match in list(re.finditer(url_regex, new_post.body_html))[:20]:
|
||||
href = url_match.group(1)
|
||||
if not href: continue
|
||||
|
||||
|
@ -1243,7 +1304,7 @@ def submit_post(v, sub=None):
|
|||
if 'megathread' in new_post.title.lower(): sort = 'new'
|
||||
else: sort = v.defaultsortingcomments
|
||||
if len(body_html) < 40000: new_post.replies = [c]
|
||||
return render_template('submission.html', v=v, p=new_post, sort=sort, render_replies=True, offset=0, success=True, sub=new_post.sub)
|
||||
return render_template('submission.html', v=v, p=new_post, sort=sort, render_replies=True, offset=0, success=True, sub=new_post.subr)
|
||||
|
||||
|
||||
@app.post("/delete_post/<pid>")
|
||||
|
|
|
@ -66,7 +66,7 @@ def searchposts(v):
|
|||
if 'author' in criteria:
|
||||
posts = posts.filter(Submission.ghost == None)
|
||||
author = get_user(criteria['author'])
|
||||
if not author: return {"error": f"User not found"}
|
||||
if not author: return {"error": "User not found"}
|
||||
if author.is_private and author.id != v.id and v.admin_level < 2 and not v.eye:
|
||||
if request.headers.get("Authorization"):
|
||||
return {"error": f"@{author.username}'s profile is private; You can't use the 'author' syntax on them"}
|
||||
|
@ -213,7 +213,7 @@ def searchcomments(v):
|
|||
if 'author' in criteria:
|
||||
comments = comments.filter(Comment.ghost == None)
|
||||
author = get_user(criteria['author'])
|
||||
if not author: return {"error": f"User not found"}
|
||||
if not author: return {"error": "User not found"}
|
||||
if author.is_private and author.id != v.id and v.admin_level < 2 and not v.eye:
|
||||
if request.headers.get("Authorization"):
|
||||
return {"error": f"@{author.username}'s profile is private; You can't use the 'author' syntax on them"}
|
||||
|
|
|
@ -436,9 +436,6 @@ def themecolor(v):
|
|||
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
||||
@auth_required
|
||||
def gumroad(v):
|
||||
if SITE_NAME == 'Drama': patron = 'Paypig'
|
||||
else: patron = 'Patron'
|
||||
|
||||
if not (v.email and v.is_activated):
|
||||
return {"error": f"You must have a verified email to verify {patron} status and claim your rewards"}, 400
|
||||
|
||||
|
@ -735,14 +732,14 @@ def settings_css(v):
|
|||
@auth_required
|
||||
def settings_profilecss_get(v):
|
||||
|
||||
if not v.patron : return f"You must be a paypig to set profile css."
|
||||
if not v.patron : return f"You must be a {patron} to set profile css."
|
||||
return render_template("settings_profilecss.html", v=v)
|
||||
|
||||
@app.post("/settings/profilecss")
|
||||
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
||||
@auth_required
|
||||
def settings_profilecss(v):
|
||||
if not v.patron: return f"You must be a paypig to set profile css."
|
||||
if not v.patron: return f"You must be a {patron} to set profile css."
|
||||
profilecss = request.values.get("profilecss").strip().replace('\\', '').strip()[:4000]
|
||||
v.profilecss = profilecss
|
||||
g.db.add(v)
|
||||
|
|
|
@ -18,7 +18,7 @@ def privacy(v):
|
|||
@app.get("/marseys")
|
||||
@auth_required
|
||||
def marseys(v):
|
||||
if request.host == 'rdrama.net':
|
||||
if SITE_NAME == 'Drama':
|
||||
marseys = g.db.query(Marsey, User).join(User, User.id==Marsey.author_id).order_by(Marsey.count.desc())
|
||||
else:
|
||||
marseys = g.db.query(Marsey).order_by(Marsey.count.desc())
|
||||
|
@ -27,7 +27,7 @@ def marseys(v):
|
|||
@app.get("/marsey_list")
|
||||
@cache.memoize(timeout=600)
|
||||
def marsey_list():
|
||||
if request.host == 'rdrama.net':
|
||||
if SITE_NAME == 'Drama':
|
||||
marseys = [f"{x.name} : {y} {x.tags}" for x, y in g.db.query(Marsey, User.username).join(User, User.id==Marsey.author_id).order_by(Marsey.count.desc())]
|
||||
else:
|
||||
marseys = [f"{x.name} : {x.tags}" for x in g.db.query(Marsey).order_by(Marsey.count.desc())]
|
||||
|
@ -384,7 +384,7 @@ def formatting(v):
|
|||
|
||||
@app.get("/service-worker.js")
|
||||
def serviceworker():
|
||||
with open("files/assets/js/service-worker.js", "r") as f: return Response(f.read(), mimetype='application/javascript')
|
||||
with open("files/assets/js/service-worker.js", "r", encoding="utf-8") as f: return Response(f.read(), mimetype='application/javascript')
|
||||
|
||||
@app.get("/settings/security")
|
||||
@auth_required
|
||||
|
|
|
@ -256,9 +256,9 @@ def transfer_coins(v, username):
|
|||
amount = request.values.get("amount", "").strip()
|
||||
amount = int(amount) if amount.isdigit() else None
|
||||
|
||||
if amount is None or amount <= 0: return {"error": f"Invalid amount of coins."}, 400
|
||||
if v.coins < amount: return {"error": f"You don't have enough coins."}, 400
|
||||
if amount < 100: return {"error": f"You have to gift at least 100 coins."}, 400
|
||||
if amount is None or amount <= 0: return {"error": "Invalid amount of coins."}, 400
|
||||
if v.coins < amount: return {"error": "You don't have enough coins."}, 400
|
||||
if amount < 100: return {"error": "You have to gift at least 100 coins."}, 400
|
||||
|
||||
if not v.patron and not receiver.patron and not v.alts_patron and not receiver.alts_patron: tax = math.ceil(amount*0.03)
|
||||
else: tax = 0
|
||||
|
@ -275,7 +275,7 @@ def transfer_coins(v, username):
|
|||
g.db.commit()
|
||||
return {"message": f"{amount-tax} coins transferred!"}, 200
|
||||
|
||||
return {"message": f"You can't transfer coins to yourself!"}, 400
|
||||
return {"message": "You can't transfer coins to yourself!"}, 400
|
||||
|
||||
|
||||
@app.post("/@<username>/transfer_bux")
|
||||
|
@ -503,7 +503,7 @@ def message2(v, username):
|
|||
'title': f'New message from @{v.username}',
|
||||
'body': notifbody,
|
||||
'deep_link': f'{SITE_FULL}/notifications?messages=true',
|
||||
'icon': f'{SITE_FULL}/assets/images/{SITE_NAME}/icon.webp?a=1009',
|
||||
'icon': f'{SITE_FULL}/assets/images/{SITE_NAME}/icon.webp?a=1010',
|
||||
}
|
||||
},
|
||||
'fcm': {
|
||||
|
@ -674,7 +674,7 @@ def following(username, v):
|
|||
@app.get("/views")
|
||||
@auth_required
|
||||
def visitors(v):
|
||||
if request.host == 'rdrama.net' and v.admin_level < 1 and not v.patron: return render_template("errors/patron.html", v=v)
|
||||
if SITE_NAME == 'Drama' and v.admin_level < 1 and not v.patron: return render_template("errors/patron.html", v=v)
|
||||
viewers=sorted(v.viewers, key = lambda x: x.last_view_utc, reverse=True)
|
||||
return render_template("viewers.html", v=v, viewers=viewers)
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ from files.helpers.const import *
|
|||
from files.classes import *
|
||||
from flask import *
|
||||
from files.__main__ import app, limiter, cache
|
||||
from sqlalchemy.orm import joinedload
|
||||
from os import environ
|
||||
|
||||
@app.get("/votes")
|
||||
|
@ -29,30 +28,18 @@ def admin_vote_info_get(v):
|
|||
thing_id = g.db.query(Submission.id).filter_by(upvotes=thing.upvotes, downvotes=thing.downvotes).order_by(Submission.id).first()[0]
|
||||
else: thing_id = thing.id
|
||||
|
||||
ups = g.db.query(Vote
|
||||
).options(joinedload(Vote.user)
|
||||
).filter_by(submission_id=thing_id, vote_type=1
|
||||
).order_by(Vote.id).all()
|
||||
ups = g.db.query(Vote).filter_by(submission_id=thing_id, vote_type=1).order_by(Vote.id).all()
|
||||
|
||||
downs = g.db.query(Vote
|
||||
).options(joinedload(Vote.user)
|
||||
).filter_by(submission_id=thing_id, vote_type=-1
|
||||
).order_by(Vote.id).all()
|
||||
downs = g.db.query(Vote).filter_by(submission_id=thing_id, vote_type=-1).order_by(Vote.id).all()
|
||||
|
||||
elif isinstance(thing, Comment):
|
||||
if thing.author.shadowbanned and not (v and v.admin_level):
|
||||
thing_id = g.db.query(Comment.id).filter_by(upvotes=thing.upvotes, downvotes=thing.downvotes).order_by(Comment.id).first()[0]
|
||||
else: thing_id = thing.id
|
||||
|
||||
ups = g.db.query(CommentVote
|
||||
).options(joinedload(CommentVote.user)
|
||||
).filter_by(comment_id=thing_id, vote_type=1
|
||||
).order_by(CommentVote.id).all()
|
||||
ups = g.db.query(CommentVote).filter_by(comment_id=thing_id, vote_type=1).order_by(CommentVote.id).all()
|
||||
|
||||
downs = g.db.query(CommentVote
|
||||
).options(joinedload(CommentVote.user)
|
||||
).filter_by(comment_id=thing_id, vote_type=-1
|
||||
).order_by(CommentVote.id).all()
|
||||
downs = g.db.query(CommentVote).filter_by(comment_id=thing_id, vote_type=-1 ).order_by(CommentVote.id).all()
|
||||
|
||||
else: abort(400)
|
||||
|
||||
|
@ -140,7 +127,7 @@ def api_vote_comment(comment_id, new, v):
|
|||
|
||||
comment = get_comment(comment_id)
|
||||
|
||||
if comment.author_id == AUTOBETTER_ID: return {"error": "forbidden."}, 403
|
||||
if comment.author_id in (AUTOPOLLER_ID,AUTOBETTER_ID,AUTOCHOICE_ID): return {"error": "forbidden."}, 403
|
||||
|
||||
existing = g.db.query(CommentVote).filter_by(user_id=v.id, comment_id=comment.id).one_or_none()
|
||||
|
||||
|
@ -248,4 +235,38 @@ def bet(comment_id, v):
|
|||
g.db.add(autobetter)
|
||||
|
||||
g.db.commit()
|
||||
return "", 204
|
||||
|
||||
@app.post("/vote/choice/<comment_id>")
|
||||
@auth_required
|
||||
def api_vote_choice(comment_id, v):
|
||||
|
||||
comment_id = int(comment_id)
|
||||
comment = get_comment(comment_id)
|
||||
|
||||
existing = g.db.query(CommentVote).filter_by(user_id=v.id, comment_id=comment.id).one_or_none()
|
||||
|
||||
if existing and existing.vote_type == 1: return "", 204
|
||||
|
||||
if existing:
|
||||
existing.vote_type = 1
|
||||
g.db.add(existing)
|
||||
else:
|
||||
vote = CommentVote(user_id=v.id, vote_type=1, comment_id=comment.id)
|
||||
g.db.add(vote)
|
||||
|
||||
if comment.parent_comment: parent = comment.parent_comment
|
||||
else: parent = comment.post
|
||||
|
||||
for vote in parent.total_choice_voted(v):
|
||||
vote.comment.upvotes = g.db.query(CommentVote.id).filter_by(comment_id=vote.comment.id, vote_type=1).count() - 1
|
||||
g.db.add(vote.comment)
|
||||
g.db.delete(vote)
|
||||
|
||||
try:
|
||||
g.db.flush()
|
||||
comment.upvotes = g.db.query(CommentVote.id).filter_by(comment_id=comment.id, vote_type=1).count()
|
||||
g.db.add(comment)
|
||||
g.db.commit()
|
||||
except: g.db.rollback()
|
||||
return "", 204
|
|
@ -63,7 +63,7 @@
|
|||
</form>
|
||||
|
||||
<pre></pre>
|
||||
{% if request.host != 'rdrama.net' or v.id == AEVANN_ID %}
|
||||
{% if SITE != 'Drama' or v.id == AEVANN_ID %}
|
||||
<div><a class="btn btn-danger" role="button" onclick="post_toast('/admin/monthly')">Grant Monthly Marseybux</a></div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
|
@ -60,7 +60,7 @@
|
|||
<label class="custom-control-label" for="{{badge.id}}"></label>
|
||||
</div>
|
||||
</td>
|
||||
<td><label for="badge-{{badge.id}}"><img alt="{{badge.name}}" loading="lazy" src="/static/assets/images/badges/{{badge.id}}.webp?a=1010" width=64.16 height=70></label></td>
|
||||
<td><label for="badge-{{badge.id}}"><img alt="{{badge.name}}" loading="lazy" src="/static/assets/images/badges/{{badge.id}}.webp?a=1011" width=64.16 height=70></label></td>
|
||||
<td>{{badge.name}}</td>
|
||||
<td>{{badge.description}}</td>
|
||||
</tr>
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
<label class="custom-control-label" for="{{badge.id}}"></label>
|
||||
</div>
|
||||
</td>
|
||||
<td><label for="badge-{{badge.id}}"><img alt="{{badge.name}}" loading="lazy" src="/static/assets/images/badges/{{badge.id}}.webp?a=1010" width=64.16 height=70></label></td>
|
||||
<td><label for="badge-{{badge.id}}"><img alt="{{badge.name}}" loading="lazy" src="/static/assets/images/badges/{{badge.id}}.webp?a=1011" width=64.16 height=70></label></td>
|
||||
<td>{{badge.name}}</td>
|
||||
<td>{{badge.description}}</td>
|
||||
</tr>
|
||||
|
|
|
@ -20,14 +20,14 @@
|
|||
<div class="col col-md-8">
|
||||
<div class="settings">
|
||||
<div id="description">
|
||||
<h2>Edit sidebar</h2>
|
||||
<h2>Edit {% if sub %}/s/{{sub.name}}{% endif %} sidebar</h2>
|
||||
<br>
|
||||
</div>
|
||||
<div class="body d-lg-flex">
|
||||
<div class="w-lg-100">
|
||||
<form id="profile-settings" action="/admin/sidebar" method="post">
|
||||
<form id="profile-settings" action="{% if sub %}/s/{{sub.name}}{% else %}/admin{% endif %}/sidebar" method="post">
|
||||
<input autocomplete="off" type="hidden" name="formkey" value="{{v.formkey}}">
|
||||
<textarea autocomplete="off" maxlength="10000" class="form-control rounded" id="bio-text" aria-label="With textarea" placeholder="Site sidebar" rows="50" name="sidebar" form="profile-settings">{% if sidebar %}{{sidebar}}{% endif %}</textarea>
|
||||
<textarea autocomplete="off" maxlength="10000" class="form-control rounded" id="bio-text" aria-label="With textarea" placeholder="Enter sidebar here..." rows="50" name="sidebar" form="profile-settings">{% if sidebar %}{{sidebar}}{% endif %}</textarea>
|
||||
|
||||
<div class="d-flex mt-2">
|
||||
<input autocomplete="off" class="btn btn-primary ml-auto" type="submit" value="Save">
|
||||
|
|
|
@ -30,13 +30,13 @@
|
|||
|
||||
headers={"Authorization": "access_token_goes_here"}
|
||||
|
||||
url="https://rdrama.net/@carpathianflorist"
|
||||
url="{{SITE_FULL}}/?sort=comments"
|
||||
|
||||
r=requests.get(url, headers=headers)
|
||||
|
||||
print(r.json())
|
||||
</pre>
|
||||
<p>The expected result of this would be a large JSON representation of the posts posted by @carpathianflorist</p>
|
||||
<p>The expected result of this would be a large JSON representation of the posts on the frontpage sorted by the number of comments</p>
|
||||
<pre>
|
||||
|
||||
|
||||
|
@ -61,7 +61,7 @@
|
|||
<p>Drama administrators will review and approve or deny your request for API keys. You'll know when your request has been approved when you get a private message with an access token tied to your account.</p>
|
||||
<p>DO NOT reveal your Client ID or Access Token. Anyone with these information will be able to pretend to be you. You are responsible for keeping them a secret!</p>
|
||||
<h2>Step 2: Prompt Your User for Authorization</h2>
|
||||
<p>Send your user to <code>https://rdrama.net/authorize/?client_id=YOUR_CLIENT_ID</code></p>
|
||||
<p>Send your user to <code>{{SITE_FULL}}/authorize/?client_id=YOUR_CLIENT_ID</code></p>
|
||||
<p>If done correctly, the user will see that your application wants to access their Drama account, and be prompted to approve or deny the request.</p>
|
||||
<h2>Step 3: Catch the redirect</h2>
|
||||
<p>The user clicks "Authorize". Drama will redirect the user's browser to GET the designated redirect URI. The access token URL parameter will be included in the redirect, which your server should process.</p>
|
||||
|
@ -72,11 +72,11 @@
|
|||
|
||||
headers={"Authorization": "access_token_goes_here"}
|
||||
|
||||
url="https://rdrama.net/@carpathianflorist"
|
||||
url="{{SITE_FULL}}/?sort=comments"
|
||||
|
||||
r=requests.get(url, headers=headers)
|
||||
|
||||
print(r.json())
|
||||
</pre>
|
||||
<p>The expected result of this would be a large JSON representation of the submissions submitted by @carpathianflorist</p>
|
||||
<p>The expected result of this would be a large JSON representation of the posts on the frontpage sorted by the number of comments</p>
|
||||
{% endblock %}
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=108"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=15">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=116"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=19">
|
||||
{% if v.agendaposter %}
|
||||
<style>
|
||||
html {
|
||||
|
@ -39,7 +39,7 @@
|
|||
{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=108"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=15">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=108"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=19">
|
||||
{% endif %}
|
||||
|
||||
</head>
|
||||
|
@ -111,7 +111,7 @@
|
|||
|
||||
<div class="splash-overlay"></div>
|
||||
|
||||
<img alt="cover" loading="lazy" class="splash-img" src="/static/assets/images/{{SITE_NAME}}/cover.webp?a=1008"></img>
|
||||
<img alt="cover" loading="lazy" class="splash-img" src="/static/assets/images/{{SITE_NAME}}/cover.webp?a=1010"></img>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<tr>
|
||||
<td style="font-weight:bold">{{loop.index}}</td>
|
||||
<td>{{badge.name}}</td>
|
||||
<td><img alt="{{badge.name}}" loading="lazy" src="/static/assets/images/badges/{{badge.id}}.webp?a=1010" width=45.83 height=50>
|
||||
<td><img alt="{{badge.name}}" loading="lazy" src="/static/assets/images/badges/{{badge.id}}.webp?a=1011" width=45.83 height=50>
|
||||
<td>{{badge.description}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
{% extends "default.html" %}
|
||||
|
||||
{% block title %}
|
||||
<title>Unable to post comment</title>
|
||||
{% endblock %}
|
||||
|
||||
{% block pagetype %}message{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="">
|
||||
|
||||
<p>Please remove the following link(s) from your comment, and then you will be able to post it:</p>
|
||||
|
||||
<ul>
|
||||
{% for s in badlinks %}
|
||||
<li>{{s}}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<div>
|
||||
<div class="comment-write collapsed child p-4">
|
||||
<form id="reply" action="{{action}}" method="post" class="input-group">
|
||||
|
||||
<input autocomplete="off" type="hidden" name="formkey" value="{{v.formkey}}">
|
||||
|
||||
{% if parent_fullname %}<input autocomplete="off" type="hidden" name="parent_fullname" value="{{parent_fullname}}">{% endif %}
|
||||
{% if parent_submission %}<input autocomplete="off" type="hidden" name="submission" value="{{parent_submission}}">{% endif %}
|
||||
|
||||
<textarea autocomplete="off" name="body" form="reply" class="comment-box form-control rounded" id="reply-form" aria-label="With textarea" placeholder="Add your comment..." {% if v.longpost %}minlength="280"{% endif %} maxlength="{% if v.bird %}140{% else %}10000{% endif %}" rows="10">{{body}}</textarea>
|
||||
|
||||
<div class="comment-format">
|
||||
<small class="format pl-0"><i class="fas fa-bold" aria-hidden="true" onclick="makeReplyBold()" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="Bold"></i></small>
|
||||
<a class="format" role="button"><i class="fas fa-italic" aria-hidden="true" onclick="makeReplyItalics()" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="Italicize"></i></a>
|
||||
<a class="format" role="button"><i class="fas fa-quote-right" aria-hidden="true" onclick="makeReplyQuote()" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="Quote"></i></a>
|
||||
<a class="format" role="button"><i class="fas fa-link" aria-hidden="true"></i></small>
|
||||
|
||||
</div>
|
||||
<button form="reply" class="btn btn-primary ml-auto fl-r">Comment</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -185,6 +185,7 @@
|
|||
{% set dealer_hand = split_result[1].split('/')[0] if blackjack_status == 'active' else split_result[1] %}
|
||||
{% set dealer_hand = dealer_hand.replace('X', '10') %}
|
||||
{% set wager = split_result[4] %}
|
||||
{% set kind = split_result[5] %}
|
||||
{% endif %}
|
||||
|
||||
<div id="comment-{{c.id}}" class="anchor {% if c.unread %}unread{% endif %} comment {% if standalone and level==1 %} mt-0{% endif %} {% if c.collapse_for_user(v,request.path) %}collapsed{% endif %}" style="{% if isreply %}padding-left:0!important;{% elif not c.unread %}border-left: 2px solid {% if c.ghost %}var(--primary){% else %}#{{c.author.namecolor}};{% endif %}{% endif %} {% if c.unread %}padding: 10px 10px 10px !important;{% endif %}">
|
||||
|
@ -225,13 +226,13 @@
|
|||
👻
|
||||
{% else %}
|
||||
{% if c.author.house %}
|
||||
<img src="/assets/images/{{SITE_NAME}}/houses/{{c.author.house}}.webp?a=1" height="20" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="House {{c.author.house}}">
|
||||
<img src="/assets/images/{{SITE_NAME}}/houses/{{c.author.house}}.webp?a=5" height="20" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="House {{c.author.house}}">
|
||||
{% endif %}
|
||||
|
||||
{% if c.author.verified %}<i class="fas fa-badge-check align-middle ml-1" style="color:{% if c.author.verifiedcolor %}#{{c.author.verifiedcolor}}{% else %}#1DA1F2{% endif %}" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="{{c.author.verified}}"></i>
|
||||
{% endif %}
|
||||
|
||||
<a class="user-name text-decoration-none" onclick='popclick({{c.author.json_popover(v) | tojson}})' data-bs-placement="bottom" data-bs-toggle="popover" data-bs-trigger="click" data-content-id="popover" role="button" tabindex="0" style="color:#{{c.author.namecolor}}; font-size:12px; font-weight:bold;"><img alt="@{{c.author_name}}'s profile picture" loading="lazy" src="{{c.author.profile_url}}" class="profile-pic-25 mr-2"><span {% if c.author.patron and not c.distinguish_level %}class="patron" style="background-color:#{{c.author.namecolor}};"{% elif c.distinguish_level and request.host == 'rdrama.net' %}class="mod"{% endif %}>{{c.author_name}}</span></a>
|
||||
<a class="user-name text-decoration-none" onclick='popclick({{c.author.json_popover(v) | tojson}})' data-bs-placement="bottom" data-bs-toggle="popover" data-bs-trigger="click" data-content-id="popover" role="button" tabindex="0" style="color:#{{c.author.namecolor}}; font-size:12px; font-weight:bold;"><img alt="@{{c.author_name}}'s profile picture" loading="lazy" src="{{c.author.profile_url}}" class="profile-pic-25 mr-2"><span {% if c.author.patron and not c.distinguish_level %}class="patron" style="background-color:#{{c.author.namecolor}};"{% elif c.distinguish_level and SITE_NAME == 'Drama' %}class="mod"{% endif %}>{{c.author_name}}</span></a>
|
||||
{% if c.author.customtitle %} <bdi style="color: #{{c.author.titlecolor}}"> {% if c.author.quadrant %}<img alt="{{c.author.quadrant}} quadrant" loading="lazy" height="20" src="/static/assets/images/quadrants/{{c.author.quadrant}}.webp?a=1008">{% endif %}{{c.author.customtitle | safe}}</bdi>{% endif %}
|
||||
{% endif %}
|
||||
|
||||
|
@ -259,20 +260,21 @@
|
|||
{% endif %}
|
||||
|
||||
{% if c.blackjack_result %}
|
||||
{% set currency_kind = "Coins" if kind == "coins" else "Marseybucks" %}
|
||||
<em>{{player_hand}} vs. {{dealer_hand}}</em>
|
||||
{% if blackjack_status == 'active' and v.id == c.author_id %}
|
||||
<button class="btn btn-success small" style="text-transform: uppercase; padding: 2px;" onclick="handle_blackjack_action('{{c.id}}', 'hit')">Hit</button>
|
||||
<button class="btn btn-danger small" style="text-transform: uppercase; padding: 2px;" onclick="handle_blackjack_action('{{c.id}}', 'stay')">Stay</button>
|
||||
{% elif blackjack_status == 'push' %}
|
||||
<strong>Pushed.</strong>
|
||||
<strong>Pushed. Refunded {{wager}} {{currency_kind}}.</strong>
|
||||
{% elif blackjack_status == 'bust' %}
|
||||
<strong>Bust. Lost {{wager}} Coins.</strong>
|
||||
<strong>Bust. Lost {{wager}} {{currency_kind}}.</strong>
|
||||
{% elif blackjack_status == 'lost' %}
|
||||
<strong>Lost {{wager}} Coins.</strong>
|
||||
<strong>Lost {{wager}} {{currency_kind}}.</strong>
|
||||
{% elif blackjack_status == 'won' %}
|
||||
<strong>Won {{wager}} Coins.</strong>
|
||||
{% elif blackjack_status == 'blackjack' %}
|
||||
<strong>Blackjack! Won <span id="blackjack-result-{{c.id}}">{{(wager|int * 3/2)|round(0, 'floor')|int}}</span> Coins.</strong>
|
||||
<strong>Blackjack! Won {{(wager|int * 3/2)|round(0, 'floor')|int}} {{currency_kind}}.</strong>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
@ -450,7 +452,7 @@
|
|||
|
||||
<a class="btn caction nobackground px-1 text-muted" href="{{c.permalink}}"><i class="fas fa-book-open"></i>Context</a>
|
||||
|
||||
<button class="btn caction py-0 nobackground px-1 text-muted copy-link" role="button" role="button" data-clipboard-text="{% if request.host == 'rdrama.net' %}https://rdrama.com{{c.shortlink_context}}{% else %}{{c.permalink}}{% endif %}"><i class="fas fa-copy"></i>Copy link</button>
|
||||
<button class="btn caction py-0 nobackground px-1 text-muted copy-link" role="button" role="button" data-clipboard-text="{% if SITE_NAME == 'Drama' %}https://rdrama.com{{c.shortlink_context}}{% else %}{{c.permalink}}{% endif %}"><i class="fas fa-copy"></i>Copy link</button>
|
||||
|
||||
{% if v %}
|
||||
<button class="btn caction py-0 nobackground px-1 text-muted" data-bs-toggle="modal" data-bs-target="#reportCommentModal" onclick="report_commentModal('{{c.id}}','{{c.author_name}}',)"><i class="fas fa-flag fa-fw"></i>Report</button>
|
||||
|
@ -620,7 +622,7 @@
|
|||
|
||||
{% if not c.ghost %}<a href="/votes?link={{c.fullname}}"><li class="list-group-item"><i class="fas fa-arrows-v"></i>Votes</li></a>{% endif %}
|
||||
|
||||
<a role="button" role="button" class="list-group-item copy-link" data-bs-dismiss="modal" data-clipboard-text="{% if request.host == 'rdrama.net' %}https://rdrama.com{{c.shortlink_context}}{% else %}{{c.permalink}}{% endif %}"><i class="fas fa-copy"></i>Copy link</a>
|
||||
<a role="button" role="button" class="list-group-item copy-link" data-bs-dismiss="modal" data-clipboard-text="{% if SITE_NAME == 'Drama' %}https://rdrama.com{{c.shortlink_context}}{% else %}{{c.permalink}}{% endif %}"><i class="fas fa-copy"></i>Copy link</a>
|
||||
|
||||
<a class="list-group-item" href="{{c.permalink}}"><i class="fas fa-dna"></i>Context</a>
|
||||
|
||||
|
@ -907,8 +909,8 @@
|
|||
</style>
|
||||
|
||||
{% if v %}
|
||||
<script src="/static/assets/js/marked.js?a=240"></script>
|
||||
<script src="/static/assets/js/comments_v.js?a=240"></script>
|
||||
<script src="/static/assets/js/marked.js?a=241"></script>
|
||||
<script src="/static/assets/js/comments_v.js?a=243"></script>
|
||||
{% endif %}
|
||||
|
||||
<script src="/static/assets/js/clipboard.js?a=240"></script>
|
||||
|
@ -920,7 +922,7 @@
|
|||
{% include "expanded_image_modal.html" %}
|
||||
|
||||
<script src="/static/assets/js/comments+submission_listing.js?a=240"></script>
|
||||
<script src="/static/assets/js/comments.js?a=241"></script>
|
||||
<script src="/static/assets/js/comments.js?a=242"></script>
|
||||
|
||||
<script>
|
||||
{% if p and (not v or v.highlightcomments) %}
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
<script src="/static/assets/js/bootstrap.js?a=240"></script>
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=108">
|
||||
<link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=15">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=116">
|
||||
<link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=19">
|
||||
{% if v.agendaposter %}
|
||||
<style>
|
||||
html {
|
||||
|
@ -32,22 +32,22 @@
|
|||
{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=108"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=15">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=116"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=19">
|
||||
{% endif %}
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<meta name="thumbnail" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1009">
|
||||
<meta name="thumbnail" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1011">
|
||||
|
||||
<link rel="icon" type="image/png" href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1009">
|
||||
<link rel="icon" type="image/png" href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1010">
|
||||
{% block title %}
|
||||
<title>{{SITE_NAME}}</title>
|
||||
|
||||
<meta property="og:type" content="article" >
|
||||
<meta property="og:title" content="{{SITE_NAME}}" >
|
||||
<meta property="og:site_name" content="{{request.host}}" >
|
||||
<meta property="og:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1009" >
|
||||
<meta property="og:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1011" >
|
||||
<meta property="og:url" content="{{SITE_FULL}}{{request.full_path}}">
|
||||
<meta property="og:description" name="description" content="{{SITE_NAME}} - {{config('DESCRIPTION')}}">
|
||||
<meta property="og:author" name="author" content="@{{SITE_FULL}}/" >
|
||||
|
@ -58,7 +58,7 @@
|
|||
<meta name="twitter:title" content="{{SITE_NAME}}" >
|
||||
<meta name="twitter:creator" content="@{{SITE_FULL}}/">
|
||||
<meta name="twitter:description" content="{{SITE_NAME}} - {{config('DESCRIPTION')}}" >
|
||||
<meta name="twitter:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1009" >
|
||||
<meta name="twitter:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1011" >
|
||||
<meta name="twitter:url" content="{{SITE_FULL}}{{request.full_path}}" >
|
||||
{% endblock %}
|
||||
|
||||
|
@ -67,10 +67,10 @@
|
|||
<meta name="format-detection" content="telephone=no">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1009">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1010">
|
||||
<link rel="manifest" href="/static/assets/manifest.json?a=1">
|
||||
<link rel="mask-icon" href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1009'DEFAULT_COLOR')}}">
|
||||
<link rel="shortcut icon" href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1009">
|
||||
<link rel="mask-icon" href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1010'DEFAULT_COLOR')}}">
|
||||
<link rel="shortcut icon" href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1010">
|
||||
<meta name="apple-mobile-web-app-title" content="{{SITE_NAME}}">
|
||||
<meta name="application-name" content="{{SITE_NAME}}">
|
||||
<meta name="msapplication-TileColor" content="#{{config('DEFAULT_COLOR')}}">
|
||||
|
@ -82,127 +82,127 @@
|
|||
<link
|
||||
rel="apple-touch-startup-image"
|
||||
sizes="320x480"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1009"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1010"
|
||||
>
|
||||
<link
|
||||
rel="apple-touch-startup-image"
|
||||
sizes="640x960"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1009"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1010"
|
||||
>
|
||||
<link
|
||||
rel="apple-touch-icon"
|
||||
sizes="640x1136"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1009"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1010"
|
||||
>
|
||||
<link
|
||||
rel="apple-touch-icon"
|
||||
sizes="750x1334"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1009"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1010"
|
||||
>
|
||||
<link
|
||||
rel="apple-touch-startup-image"
|
||||
sizes="768x1004"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1009"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1010"
|
||||
>
|
||||
<link
|
||||
rel="apple-touch-startup-image"
|
||||
sizes="768x1024"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1009"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1010"
|
||||
>
|
||||
<link
|
||||
rel="apple-touch-startup-image"
|
||||
sizes="828x1792"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1009"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1010"
|
||||
>
|
||||
<link
|
||||
rel="apple-touch-startup-image"
|
||||
sizes="1024x748"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1009"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1010"
|
||||
>
|
||||
<link
|
||||
rel="apple-touch-startup-image"
|
||||
sizes="1024x768"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1009"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1010"
|
||||
>
|
||||
<link
|
||||
rel="apple-touch-startup-image"
|
||||
sizes="1125x2436"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1009"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1010"
|
||||
>
|
||||
<link
|
||||
rel="apple-touch-startup-image"
|
||||
sizes="1242x2208"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1009"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1010"
|
||||
>
|
||||
<link
|
||||
rel="apple-touch-startup-image"
|
||||
sizes="1242x2688"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1009"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1010"
|
||||
>
|
||||
<link
|
||||
rel="apple-touch-startup-image"
|
||||
sizes="1334x750"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1009"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1010"
|
||||
>
|
||||
<link
|
||||
rel="apple-touch-startup-image"
|
||||
sizes="1536x2008"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1009"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1010"
|
||||
>
|
||||
<link
|
||||
rel="apple-touch-startup-image"
|
||||
sizes="1536x2048"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1009"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1010"
|
||||
>
|
||||
<link
|
||||
rel="apple-touch-startup-image"
|
||||
sizes="1668x2224"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1009"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1010"
|
||||
>
|
||||
<link
|
||||
rel="apple-touch-startup-image"
|
||||
sizes="1792x828"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1009"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1010"
|
||||
>
|
||||
<link
|
||||
rel="apple-touch-startup-image"
|
||||
sizes="2048x1496"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1009"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1010"
|
||||
>
|
||||
<link
|
||||
rel="apple-touch-startup-image"
|
||||
sizes="2048x1536"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1009"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1010"
|
||||
>
|
||||
<link
|
||||
rel="apple-touch-startup-image"
|
||||
sizes="2048x2732"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1009"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1010"
|
||||
>
|
||||
<link
|
||||
rel="apple-touch-startup-image"
|
||||
sizes="2208x1242"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1009"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1010"
|
||||
>
|
||||
<link
|
||||
rel="apple-touch-startup-image"
|
||||
sizes="2224x1668"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1009"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1010"
|
||||
>
|
||||
<link
|
||||
rel="apple-touch-startup-image"
|
||||
sizes="2436x1125"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1009"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1010"
|
||||
>
|
||||
<link
|
||||
rel="apple-touch-startup-image"
|
||||
sizes="2668x1242"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1009"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1010"
|
||||
>
|
||||
<link
|
||||
rel="apple-touch-startup-image"
|
||||
sizes="2737x2048"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1009"
|
||||
href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1010"
|
||||
>
|
||||
|
||||
{% block fixedMobileBarJS %}
|
||||
|
@ -225,13 +225,13 @@
|
|||
</a>
|
||||
{% else %}
|
||||
<a href="/">
|
||||
<img alt="site banner" src="/static/assets/images/{{SITE_NAME}}/banner.webp?a=1011" width="100%">
|
||||
<img alt="site banner" src="/static/assets/images/{{SITE_NAME}}/banner.webp?a=1012" width="100%">
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
{% else %}
|
||||
<a href="/login">
|
||||
<img class="banner" alt="site banner" src="/static/assets/images/{{SITE_NAME}}/cached.webp?a=1009" width="100%">
|
||||
<img class="banner" alt="site banner" src="/static/assets/images/{{SITE_NAME}}/cached.webp?a=1010" width="100%">
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
@ -272,7 +272,7 @@
|
|||
{% endblock %}
|
||||
|
||||
</div>
|
||||
{% if request.path in ('/', '/logged_out', '/logged_out/') %}
|
||||
{% if request.path in ('/', '/logged_out', '/logged_out/') or sub %}
|
||||
{% block sidebar %}
|
||||
{% include "sidebar_" + SITE_NAME + ".html" %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<script data-cfasync="false" src="/static/assets/js/emoji_modal.js?a=241"></script>
|
||||
<script data-cfasync="false" src="/static/assets/js/emoji_modal.js?a=242"></script>
|
||||
|
||||
<style>
|
||||
a.emojitab {
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<div class="text-center px-3 my-8">
|
||||
<img alt=":#marseymerchant:" loading="lazy" class="mb-2" src="/static/assets/images/emojis/marseymerchant.webp?a=1008">
|
||||
<h1 class="h5">401 Not Authorized</h1>
|
||||
<p class="text-muted">This page is only available to {% if request.host == "rdrama.net" %}paypigs{% else %}patrons{% endif %}:</p>
|
||||
<p class="text-muted">This page is only available to {% if SITE_NAME == 'Drama' %}paypigs{% else %}patrons{% endif %}:</p>
|
||||
<a rel="nofollow noopener noreferrer" href="{{config('GUMROAD_LINK')}}">{{config('GUMROAD_LINK')}}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -87,13 +87,31 @@ You can use Markdown formatting:
|
|||
<td><img loading="lazy" data-bs-toggle="tooltip" class="emoji-lg mirrored" alt=":!marseylove:" data-bs-original-title=":!marseylove:" delay="0" src="/static/assets/images/emojis/marseylove.webp?a=1008"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Poll Options</td>
|
||||
<td>$$bussy$$</td>
|
||||
<td>Poll Options (can select multiple options)</td>
|
||||
<td>$$bussy$$ $$gussy$$</td>
|
||||
<td>
|
||||
<div class="custom-control">
|
||||
<input autocomplete="off" type="checkbox" class="custom-control-input" id="422741" name="option">
|
||||
<input autocomplete="off" type="checkbox" class="custom-control-input" id="422741">
|
||||
<label class="custom-control-label" for="422741">bussy - <a href="/votes?link=t3_422741"><span id="poll-422741">0</span> votes</a></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="custom-control">
|
||||
<input autocomplete="off" type="checkbox" class="custom-control-input" id="422742">
|
||||
<label class="custom-control-label" for="422742">gussy - <a href="/votes?link=t3_422742"><span id="poll-422742">0</span> votes</a></label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Poll Options (can select only 1 option)</td>
|
||||
<td>##bussy## ##gussy##</td>
|
||||
<td>
|
||||
<div class="custom-control">
|
||||
<input name="choice" autocomplete="off" type="radio" class="custom-control-input" id="1338113">
|
||||
<label class="custom-control-label" for="1338113">bussy - <a href="/votes?link=t3_1338113"><span id="choice-1338113">0</span> votes</a></label>
|
||||
</div>
|
||||
<div class="custom-control">
|
||||
<input name="choice" autocomplete="off" type="radio" class="custom-control-input" id="1338114">
|
||||
<label class="custom-control-label" for="1338114">gussy - <a href="/votes?link=t3_1338114"><span id="choice-1338114">0</span> votes</a></label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
|
@ -1,29 +1,52 @@
|
|||
|
||||
<nav class="shadow shadow-md fixed-top">
|
||||
{% if SITE_NAME == 'Drama' %}
|
||||
{% if SITE_NAME == 'Drama' or SUBS %}
|
||||
<style>
|
||||
body {padding-top: 90px !important}
|
||||
body {padding-top: 85.88px !important}
|
||||
@media (max-width: 767.98px) {
|
||||
body {
|
||||
padding-top: 69.55px !important
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<div id="srd" style="width: 100%; background-color: var(--primary); padding: 2px; text-align: center; font-weight: bold;white-space:nowrap">
|
||||
<a style="color: white" class="text-small-mobile" href="https://reddit.com/r/SubredditDrama">💖🌈 welcome to rdrama.net: the official site for r/subredditdrama</a>
|
||||
</div>
|
||||
{% else %}
|
||||
<style>
|
||||
body {padding-top: 65px !important}
|
||||
body {padding-top: 60.89px !important}
|
||||
@media (max-width: 767.98px) {
|
||||
body {
|
||||
padding-top: 44.55px !important
|
||||
}
|
||||
}
|
||||
</style>
|
||||
{% endif %}
|
||||
|
||||
{% if SITE_NAME == 'Drama' %}
|
||||
<div id="srd" style="width: 100%; background-color: var(--primary); padding: 2px; text-align: center; font-weight: bold;white-space:nowrap">
|
||||
<a style="color: white" class="text-small-mobile" href="https://reddit.com/r/SubredditDrama">💖🌈 welcome to {{SITE}}: the official site for r/subredditdrama</a>
|
||||
</div>
|
||||
{% elif SUBS %}
|
||||
<div id="srd" style="width: 100%; background-color: var(--primary); padding: 2px; text-align: left; font-weight: bold;white-space:nowrap">
|
||||
{% for s in SUBS %}
|
||||
<a {% if sub and s == sub.name %} style="color: var(--secondary)" {% else %} style="color: white"{% endif %} class="text-small-mobile ml-2" href="/s/{{s}}">/s/{{s}}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="navbar navbar-expand-md navbar-light" id="navbar">
|
||||
<div class="container-fluid" style="padding:0;">
|
||||
<div class="flex-grow-1">
|
||||
<a href="/" class="navbar-brand mr-auto">
|
||||
{% if request.host == 'rdrama.net' %}
|
||||
{% if SITE_NAME == 'Drama' %}
|
||||
{% set icon = ('marseyblm','marseykween','marseydynamite','marseyblack','marseymyeisha','marseyetika','marseyobama','marseyblackcop','marseysosa','marseyblackface')|random() %}
|
||||
<img alt="header icon" height=35 src="/static/assets/images/emojis/{{icon}}.webp?a=1008">
|
||||
<img alt="header icon" height=33 src="/static/assets/images/emojis/{{icon}}.webp?a=1008">
|
||||
{% else %}
|
||||
<img alt="header icon" width=32.32 height=25 src="/static/assets/images/{{SITE_NAME}}/headericon.webp?a=1009" style="object-fit: contain;">
|
||||
<img alt="header icon" height=33 src="/static/assets/images/{{SITE_NAME}}/headericon.webp?a=1010">
|
||||
{% endif %}
|
||||
{% if request.host != 'pcmemes.net' %}
|
||||
|
||||
{% if SITE_NAME == 'Drama' %}
|
||||
<img alt="logo" src="/static/assets/images/{{SITE_NAME}}/logo.webp?a=1010" height=20 width=77>
|
||||
{% elif sub %}
|
||||
<a href="/s/{{sub.name}}" class="font-weight-bold ml-2 mt-2">/s/{{sub.name}}</a>
|
||||
{% endif %}
|
||||
</a>
|
||||
</div>
|
||||
|
@ -37,22 +60,28 @@
|
|||
</span>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{% if v %}
|
||||
{% if v.notifications_count %}
|
||||
<a class="mobile-nav-icon d-md-none" href="/notifications{% if not v.not_post_notifications_count %}?posts=true{% endif %}" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="Notifications"><i class="fas fa-bell align-middle text-danger" {% if not v.not_post_notifications_count %}style="color:blue!important"{% endif %}></i><span class="notif-count ml-1" style="padding-left: 4.5px;{% if not v.not_post_notifications_count %}background:blue{% endif %}">{{v.notifications_count}}</span></a>
|
||||
{% else %}
|
||||
<a class="mobile-nav-icon d-md-none" href="/notifications" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="Notifications"><i class="fas fa-bell align-middle text-gray-500 black"></i></a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if not err %}
|
||||
<a class="mobile-nav-icon d-md-none" href="/random"><i class="fas fa-random align-middle text-gray-500 black"></i></a>
|
||||
{% if v and v.admin_level > 1 %}
|
||||
<a class="mobile-nav-icon d-md-none" href="/admin"><i class="fas fa-crown align-middle text-gray-500 black"></i></a>
|
||||
{% endif %}
|
||||
{% if v %}
|
||||
<a class="mobile-nav-icon d-md-none" href="{% if sub %}/s/{{sub}}{% endif %}/submit"><i class="fas fa-feather-alt align-middle text-gray-500 black"></i></a>
|
||||
<a class="mobile-nav-icon d-md-none" href="{% if sub %}/s/{{sub.name}}{% endif %}/submit"><i class="fas fa-feather-alt align-middle text-gray-500 black"></i></a>
|
||||
{% else %}
|
||||
<a class="mobile-nav-icon d-md-none" href="/login"><i class="fas fa-feather-alt align-middle text-gray-500 black"></i></a>
|
||||
{% endif %}
|
||||
<button class="navbar-toggler" role="button" data-bs-toggle="collapse" data-bs-target="#navbarResponsive"
|
||||
aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon {% if v and v.notifications_count %}position-relative{% endif %}"><i class="fal fa-bars text-gray-500 black"></i>
|
||||
{% if v and v.notifications_count %}
|
||||
<span class="notif-count" {% if not v.not_post_notifications_count %}style="background:blue"{% endif %}>{{v.notifications_count}}</span>
|
||||
{% endif %}
|
||||
</span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarResponsive">
|
||||
|
@ -85,7 +114,7 @@
|
|||
{% endif %}
|
||||
|
||||
<li class="nav-item d-flex align-items-center justify-content-center text-center mx-1">
|
||||
<a class="nav-link" href="{% if sub %}/s/{{sub}}{% endif %}/submit" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="Create post"><i class="fas fa-feather-alt"></i></a>
|
||||
<a class="nav-link" href="{% if sub %}/s/{{sub.name}}{% endif %}/submit" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="Create post"><i class="fas fa-feather-alt"></i></a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item d-flex align-items-center justify-content-center text-center mx-1">
|
||||
|
@ -120,26 +149,26 @@
|
|||
<a class="dropdown-item" href="/settings"><i class="fas fa-cog fa-fw text-left mr-3"></i>Settings</a>
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<button class="dropdown-item copy-link" data-clipboard-text="/signup?ref={{v.username}}"><i class="fad fa-user-friends fa-fw text-left mr-3"></i>Invite friends</button>
|
||||
<button class="dropdown-item copy-link" data-clipboard-text="{{SITE_FULL}}/signup?ref={{v.username}}"><i class="fad fa-user-friends fa-fw text-left mr-3"></i>Invite friends</button>
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<a class="dropdown-item" href="/assets/{{config('SITE_NAME')}}_v1.6.apk"><i class="fab fa-android fa-fw text-left mr-3"></i>Android app</a>
|
||||
<a class="dropdown-item" href="/assets/{{config('SITE_NAME')}}_v1.7.apk?a=1"><i class="fab fa-android fa-fw text-left mr-3"></i>Android app</a>
|
||||
|
||||
<a class="dropdown-item" href="/changelog"><i class="fas fa-clipboard fa-fw text-left mr-3"></i>Changelog</a>
|
||||
|
||||
<a class="dropdown-item" rel="nofollow noopener noreferrer" href="https://github.com/Aevann1/Drama"><i class="fab fa-github fa-fw text-left mr-3"></i>Source code</a>
|
||||
|
||||
{% if request.host in ['rdrama.net', 'pcmemes.net'] %}
|
||||
{% if SITE_NAME in ['Drama', 'PCM'] %}
|
||||
<a class="dropdown-item" rel="nofollow noopener noreferrer" href="/report_bugs"><i class="fas fa-bug fa-fw text-left mr-3"></i>Bugs/Suggestions</a>
|
||||
{% endif %}
|
||||
|
||||
{% if request.host != 'pcmemes.net' %}
|
||||
<a class="dropdown-item" href="/discord"><i class="fab fa-discord fa-fw text-left mr-3"></i>Discord</a>
|
||||
{% endif %}
|
||||
{% if not (g.webview and v.truecoins < 1) %}
|
||||
{% if not (g.webview and v.truecoins < 1) and request.host != '2Much4You' %}
|
||||
<a class="dropdown-item" rel="nofollow noopener noreferrer" href="{{config('GUMROAD_LINK')}}"><i class="fas fa-dollar-sign fa-fw text-left mr-3"></i>Donate</a>
|
||||
{% endif %}
|
||||
{% if request.host == 'rdrama.net' %}<a class="dropdown-item" href="/archives"><i class="fas fa-book fa-fw text-left mr-3"></i>Archives</a>{% endif %}
|
||||
{% if SITE_NAME == 'Drama' %}<a class="dropdown-item" href="/archives"><i class="fas fa-book fa-fw text-left mr-3"></i>Archives</a>{% endif %}
|
||||
<a class="dropdown-item" href="/contact"><i class="fas fa-file-signature fa-fw text-left mr-3"></i>Contact us</a>
|
||||
</div>
|
||||
<div class="px-2">
|
||||
|
@ -176,18 +205,15 @@
|
|||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{v.url}}"><i class="fas fa-user-circle fa-fw mr-3"></i>@{{v.username}}</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link position-relative" href="/notifications{% if v.notifications_count and not v.not_post_notifications_count %}?posts=true{% endif %}">
|
||||
<i class="fas fa-envelope fa-fw mr-3"></i>Inbox
|
||||
{% if v.notifications_count %}
|
||||
<i class="fas fa-circle text-danger position-absolute" style="left: 19px; top: 5px; font-size: 10px;{% if not v.not_post_notifications_count %}color:blue!important{% endif %}"></i>
|
||||
{% endif %}
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/settings"><i class="fas fa-cog fa-fw mr-3"></i>Settings</a>
|
||||
</li>
|
||||
<a class="nav-item nav-link" href="/assets/{{config('SITE_NAME')}}_v1.6.apk"><i class="fab fa-android fa-fw mr-3"></i>Android app</a>
|
||||
{% if not g.webview %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link copy-link" data-clipboard-text="{{SITE_FULL}}/signup?ref={{v.username}}"><i class="fas fa-user-friends fa-fw text-left mr-3"></i>Invite friends</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
<a class="nav-item nav-link" href="/assets/{{config('SITE_NAME')}}_v1.7.apk?a=1"><i class="fab fa-android fa-fw mr-3"></i>Android app</a>
|
||||
|
||||
<a class="nav-item nav-link" rel="nofollow noopener noreferrer" href="https://github.com/Aevann1/Drama"><i class="fab fa-github fa-fw mr-3"></i>Source code</a>
|
||||
|
||||
|
@ -197,7 +223,7 @@
|
|||
{% if not (g.webview and v.truecoins < 1) %}
|
||||
<a class="nav-item nav-link" rel="nofollow noopener noreferrer" href="{{config('GUMROAD_LINK')}}"><i class="fas fa-dollar-sign fa-fw mr-3"></i>Donate</a>
|
||||
{% endif %}
|
||||
{% if request.host == 'rdrama.net' %}<a class="nav-item nav-link" href="/archives"><i class="fas fa-book fa-fw mr-3"></i>Archives</a>{% endif %}
|
||||
{% if SITE_NAME == 'Drama' %}<a class="nav-item nav-link" href="/archives"><i class="fas fa-book fa-fw mr-3"></i>Archives</a>{% endif %}
|
||||
<a class="nav-item nav-link" href="/contact"><i class="fas fa-file-signature fa-fw mr-3"></i>Contact us</a>
|
||||
|
||||
<li class="nav-item border-top border-bottom mt-2 pt-2">
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
{% block desktopBanner %}
|
||||
|
||||
{% if v %}
|
||||
{% if v and environ.get("FP") %}
|
||||
{% if not v.fp %}
|
||||
<script>
|
||||
function fp(fp) {
|
||||
|
@ -114,7 +114,7 @@
|
|||
</div>
|
||||
<div class="card-body">
|
||||
{% if v %}
|
||||
<a href="{% if sub %}/s/{{sub}}{% endif %}/submit">
|
||||
<a href="{% if sub %}/s/{{sub.name}}{% endif %}/submit">
|
||||
<input autocomplete="off" type="text" class="form-control"
|
||||
aria-label="Username"
|
||||
aria-describedby="basic-addon1">
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
{% block content %}
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=108"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=15">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=116"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=19">
|
||||
{% if v.agendaposter %}
|
||||
<style>
|
||||
html {
|
||||
|
@ -30,7 +30,7 @@
|
|||
{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=108"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=15">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=116"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=19">
|
||||
{% endif %}
|
||||
|
||||
<div class="row justify-content-around">
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
{% endblock %}
|
||||
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=108">
|
||||
<link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=15">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=116">
|
||||
<link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=19">
|
||||
|
||||
</head>
|
||||
|
||||
|
@ -117,7 +117,7 @@
|
|||
|
||||
<div class="splash-overlay"></div>
|
||||
|
||||
<img alt="cover" loading="lazy" class="splash-img" src="/static/assets/images/{{SITE_NAME}}/cover.webp?a=1008"></img>
|
||||
<img alt="cover" loading="lazy" class="splash-img" src="/static/assets/images/{{SITE_NAME}}/cover.webp?a=1010"></img>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<title>2-Step Login - {{SITE_NAME}}</title>
|
||||
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=108"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=15">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=116"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=19">
|
||||
|
||||
</head>
|
||||
|
||||
|
@ -94,7 +94,7 @@
|
|||
|
||||
<div class="splash-overlay"></div>
|
||||
|
||||
<img alt="cover" loading="lazy" class="splash-img" src="/static/assets/images/{{SITE_NAME}}/cover.webp?a=1008"></img>
|
||||
<img alt="cover" loading="lazy" class="splash-img" src="/static/assets/images/{{SITE_NAME}}/cover.webp?a=1010"></img>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -11,11 +11,11 @@
|
|||
<th style="font-weight: bold">Name</th>
|
||||
<th style="font-weight: bold">Marsey</th>
|
||||
<th style="font-weight: bold">Usage</th>
|
||||
{% if request.host == 'rdrama.net' %}<th style="font-weight: bold">Author</th>{% endif %}
|
||||
{% if SITE_NAME == 'Drama' %}<th style="font-weight: bold">Author</th>{% endif %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="followers-table">
|
||||
{% if request.host == 'rdrama.net' %}
|
||||
{% if SITE_NAME == 'Drama' %}
|
||||
{% for marsey, author in marseys %}
|
||||
<tr>
|
||||
<td style="font-weight: bold">{{loop.index}}</td>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<td style="font-weight:bold;">{{loop.index}}</td>
|
||||
<td><a style="color:#{{u.namecolor}}; font-weight:bold;" href="/@{{u.username}}"><img alt="@{{u.username}}'s profile picture" loading="lazy" src="{{u.profile_url}}" class="pp20"><span {% if u.patron %}class="patron" style="background-color:#{{u.namecolor}}"{% endif %}>{{u.username}}</span></a></td>
|
||||
|
||||
<td><img alt="2{{u.patron}}" loading="lazy" width=29.33 height=32 src="/static/assets/images/badges/2{{u.patron}}.webp?a=1010"></td>
|
||||
<td><img alt="2{{u.patron}}" loading="lazy" width=29.33 height=32 src="/static/assets/images/badges/2{{u.patron}}.webp?a=1011"></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
|
|
@ -140,10 +140,10 @@
|
|||
<p>If you have any questions about this Privacy Policy, You can contact us:</p>
|
||||
<ul>
|
||||
<li>
|
||||
<p>By email: drama@rdrama.net</p>
|
||||
<p>By email: drama@{{SITE}}</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>By visiting this page on our website: <a href="https://rdrama.net/contact" rel="external nofollow noopener" target="_blank">https://rdrama.net/contact</a></p>
|
||||
<p>By visiting this page on our website: <a href="{{SITE_FULL}}/contact" rel="external nofollow noopener" target="_blank">{{SITE_FULL}}/contact</a></p>
|
||||
</li>
|
||||
</ul>
|
||||
{% endblock %}
|
|
@ -12,13 +12,13 @@
|
|||
|
||||
<meta name="author" content="">
|
||||
|
||||
<link rel="icon" type="image/png" href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1009">
|
||||
<link rel="icon" type="image/png" href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1010">
|
||||
|
||||
<title>{% block pagetitle %}Settings - {{SITE_NAME}}{% endblock %}</title>
|
||||
<meta property="og:type" content="article" >
|
||||
<meta property="og:title" content="{{SITE_NAME}}" >
|
||||
<meta property="og:site_name" content="{{request.host}}" >
|
||||
<meta property="og:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1009" >
|
||||
<meta property="og:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1011" >
|
||||
<meta property="og:url" content="{{request.host}}">
|
||||
<meta property="og:description" name="description" content="{{SITE_NAME}} - {{config('DESCRIPTION')}}">
|
||||
<meta property="og:author" name="author" content="@{{SITE_FULL}}/" >
|
||||
|
@ -29,12 +29,12 @@
|
|||
<meta name="twitter:title" content="{{SITE_NAME}}" >
|
||||
<meta name="twitter:creator" content="@{{SITE_FULL}}/">
|
||||
<meta name="twitter:description" content="{{SITE_NAME}} - {{config('DESCRIPTION')}}" >
|
||||
<meta name="twitter:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1009" >
|
||||
<meta name="twitter:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1011" >
|
||||
<meta name="twitter:url" content="{{request.host}}" >
|
||||
|
||||
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=108"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=15">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=116"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=19">
|
||||
{% if v.agendaposter %}
|
||||
<style>
|
||||
html {
|
||||
|
|
|
@ -12,13 +12,13 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<meta name="author" content="">
|
||||
<meta name="thumbnail" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1009">
|
||||
<link rel="icon" type="image/png" href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1009">
|
||||
<meta name="thumbnail" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1011">
|
||||
<link rel="icon" type="image/png" href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1010">
|
||||
|
||||
<meta property="og:type" content="article" >
|
||||
<meta property="og:title" content="{{SITE_NAME}}" >
|
||||
<meta property="og:site_name" content="{{request.host}}" >
|
||||
<meta property="og:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1009" >
|
||||
<meta property="og:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1011" >
|
||||
<meta property="og:url" content="{{SITE_FULL}}{{request.full_path}}">
|
||||
<meta property="og:description" name="description" content="{{SITE_NAME}} - {{config('DESCRIPTION')}}">
|
||||
<meta property="og:author" name="author" content="{{SITE_FULL}}/" >
|
||||
|
@ -29,7 +29,7 @@
|
|||
<meta name="twitter:title" content="{{SITE_NAME}}" >
|
||||
<meta name="twitter:creator" content="{{SITE_FULL}}/">
|
||||
<meta name="twitter:description" content="{{SITE_NAME}} - {{config('DESCRIPTION')}}" >
|
||||
<meta name="twitter:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1009" >
|
||||
<meta name="twitter:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1011" >
|
||||
<meta name="twitter:url" content="{{SITE_FULL}}{{request.full_path}}" >
|
||||
|
||||
|
||||
|
@ -39,10 +39,10 @@
|
|||
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=108"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=15">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=116"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=19">
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=108"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=15">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=116"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=19">
|
||||
{% endif %}
|
||||
</head>
|
||||
|
||||
|
|
|
@ -104,7 +104,7 @@
|
|||
</div>
|
||||
<div class="modal-body">
|
||||
<input autocomplete="off" type="hidden" name="formkey" value="{{v.formkey}}">
|
||||
<input autocomplete="off" type="text" name="username" placeholder="enter username" id="exile-username" class="form-control" maxlength=25 required>
|
||||
<input autocomplete="off" type="text" name="username" placeholder="Enter username..." id="exile-username" class="form-control" maxlength=25 required>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-link text-muted" data-bs-dismiss="modal">Cancel</button>
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
<div class="col sidebar text-left d-none d-lg-block pt-3 bg-white" style="max-width:300px">
|
||||
{% if sub %}
|
||||
{% set image='/static/assets/images/subs/' + sub.name + '.webp?a=1010' %}
|
||||
{% else %}
|
||||
{% set image='/static/assets/images/2Much4You/sidebar.webp?a=1039' %}
|
||||
{% endif %}
|
||||
|
||||
<img role="button" data-bs-toggle="modal" data-bs-target="#expandImageModal" onclick="expandDesktopImage('{{image}}')" loading="lazy" src="{{image}}" width=100%>
|
||||
|
||||
|
||||
{% if sub %}
|
||||
<div class="mt-4">{{sub.sidebar_html|safe}}</div>
|
||||
<a class="btn btn-primary btn-block mt-4" href="/s/{{sub.name}}/mods">MODS</a>
|
||||
{% if v and v.mods(sub.name) %}
|
||||
<a class="btn btn-primary btn-block" href="/s/{{sub.name}}/sidebar">EDIT SIDEBAR</a>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<p class="mt-4">Rules: No doxxing, No CP or other clearly illegal shit. Thanks!</p>
|
||||
{% endif %}
|
||||
|
||||
<pre>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</pre>
|
||||
</div>
|
|
@ -1,4 +1,4 @@
|
|||
<div class="col sidebar text-left d-none d-lg-block pt-3 bg-white" style="max-width:300px">
|
||||
<div class="col sidebar text-left d-none d-lg-block pt-3 pb-5 bg-white" style="max-width:300px">
|
||||
|
||||
{% set path = "assets/images/" + SITE_NAME + "/sidebar" %}
|
||||
{% set image = "/static/" + path + "/" + listdir('files/' + path)|random() + '?a=32' %}
|
||||
|
@ -20,7 +20,7 @@
|
|||
|
||||
<p>Do your part to keep our community healthy by blowing everything out of proportion and making literally everything as dramatic as possible.</p>
|
||||
|
||||
<p>rdrama.net caters to drama in all forms such as: Real life, videos, photos, gossip, rumors, news sites, Reddit, and Beyond™. There isn't drama we won't touch, and we want it all.</p>
|
||||
<p>{{SITE}} caters to drama in all forms such as: Real life, videos, photos, gossip, rumors, news sites, Reddit, and Beyond™. There isn't drama we won't touch, and we want it all.</p>
|
||||
|
||||
What we want
|
||||
|
||||
|
@ -58,6 +58,11 @@ All rules can and likely will be ignored at the discretion of the custodial staf
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</pre>
|
||||
</div>
|
|
@ -14,7 +14,7 @@
|
|||
<meta property="og:type" content="article" >
|
||||
<meta property="og:title" content="{{SITE_NAME}}" >
|
||||
<meta property="og:site_name" content="{{request.host}}" >
|
||||
<meta property="og:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1009" >
|
||||
<meta property="og:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1011" >
|
||||
<meta property="og:url" content="{{request.host}}">
|
||||
<meta property="og:description" name="description" content="{{SITE_NAME}} - {{config('DESCRIPTION')}}">
|
||||
<meta property="og:author" name="author" content="{{SITE_FULL}}/" >
|
||||
|
@ -25,13 +25,13 @@
|
|||
<meta name="twitter:title" content="{{SITE_NAME}}" >
|
||||
<meta name="twitter:creator" content="{{SITE_FULL}}/">
|
||||
<meta name="twitter:description" content="{{SITE_NAME}} - {{config('DESCRIPTION')}}" >
|
||||
<meta name="twitter:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1009" >
|
||||
<meta name="twitter:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1011" >
|
||||
<meta name="twitter:url" content="{{request.host}}" >
|
||||
|
||||
<title>{% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}Sign up - {{SITE_NAME}}{% endif %}</title>
|
||||
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=108"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=15">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=116"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=19">
|
||||
|
||||
</head>
|
||||
|
||||
|
@ -146,7 +146,7 @@
|
|||
|
||||
<div class="splash-overlay"></div>
|
||||
|
||||
<img alt="cover" loading="lazy" class="splash-img" src="/static/assets/images/{{SITE_NAME}}/cover.webp?a=1008"></img>
|
||||
<img alt="cover" loading="lazy" class="splash-img" src="/static/assets/images/{{SITE_NAME}}/cover.webp?a=1010"></img>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<meta property="og:type" content="article" >
|
||||
<meta property="og:title" content="{{SITE_NAME}}" >
|
||||
<meta property="og:site_name" content="{{request.host}}" >
|
||||
<meta property="og:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1009" >
|
||||
<meta property="og:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1011" >
|
||||
<meta property="og:url" content="{{request.host}}">
|
||||
<meta property="og:description" name="description" content="{{SITE_NAME}} - {{config('DESCRIPTION')}}">
|
||||
<meta property="og:author" name="author" content="{{SITE_FULL}}/" >
|
||||
|
@ -26,13 +26,13 @@
|
|||
<meta name="twitter:title" content="{{SITE_NAME}}" >
|
||||
<meta name="twitter:creator" content="{{SITE_FULL}}/">
|
||||
<meta name="twitter:description" content="{{SITE_NAME}} - {{config('DESCRIPTION')}}" >
|
||||
<meta name="twitter:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1009" >
|
||||
<meta name="twitter:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1011" >
|
||||
<meta name="twitter:url" content="{{request.host}}" >
|
||||
|
||||
<title>{% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}{{SITE_NAME}}{% endif %}</title>
|
||||
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=108"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=15">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=116"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=19">
|
||||
|
||||
</head>
|
||||
|
||||
|
@ -84,7 +84,7 @@
|
|||
|
||||
<div class="splash-overlay"></div>
|
||||
|
||||
<img alt="cover" loading="lazy" class="splash-img" src="/static/assets/images/{{SITE_NAME}}/cover.webp?a=1008"></img>
|
||||
<img alt="cover" loading="lazy" class="splash-img" src="/static/assets/images/{{SITE_NAME}}/cover.webp?a=1010"></img>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -221,7 +221,7 @@
|
|||
<meta property="og:description" name="description" content="{{comment_info.plainbody(v)}}" >
|
||||
<meta property="og:author" name="author" content="{{'@'+comment_info.author_name}}" >
|
||||
<meta property="og:title" content="{{'@'+comment_info.author_name}} comments on {{p.plaintitle(v)}} - {{SITE_NAME}}" >
|
||||
<meta property="og:image" content="{% if p.is_image %}{{p.realurl(v)}}{% elif p.has_thumb%}{{p.thumb_url}}{% else %}{{SITE_NAME}}/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1009{% endif %}" >
|
||||
<meta property="og:image" content="{% if p.is_image %}{{p.realurl(v)}}{% elif p.has_thumb%}{{p.thumb_url}}{% else %}{{SITE_NAME}}/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1011{% endif %}" >
|
||||
{% if p.is_video %}
|
||||
<meta property="og:video" content="{{p.realurl(v)}}" >
|
||||
{% endif %}
|
||||
|
@ -233,7 +233,7 @@
|
|||
<meta name="twitter:title" content="{{'@'+comment_info.author_name}} comments on {{p.plaintitle(v)}} - {{SITE_NAME}}" >
|
||||
<meta name="twitter:creator" content="{{'@'+comment_info.author_name}}">
|
||||
<meta name="twitter:description" content="{{comment_info.plainbody(v)}}" >
|
||||
<meta name="twitter:image" content="{% if p.is_image %}{{p.realurl(v)}}{% elif p.has_thumb%}{{p.thumb_url}}{% else %}{{SITE_NAME}}/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1009{% endif %}" >
|
||||
<meta name="twitter:image" content="{% if p.is_image %}{{p.realurl(v)}}{% elif p.has_thumb%}{{p.thumb_url}}{% else %}{{SITE_NAME}}/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1011{% endif %}" >
|
||||
<meta name="twitter:url" content="{{p.permalink}}" >
|
||||
|
||||
{% else %}
|
||||
|
@ -246,7 +246,7 @@
|
|||
<meta property="og:description" name="description" content="{{p.plainbody(v)}}" >
|
||||
{% if p.author %}<meta property="og:author" name="author" content="{{'@'+p.author_name}}" >{% endif %}
|
||||
<meta property="og:title" content="{{p.plaintitle(v)}} - {{SITE_NAME}}" >
|
||||
<meta property="og:image" content="{% if p.is_image %}{{p.realurl(v)}}{% elif p.has_thumb%}{{p.thumb_url}}{% else %}{{SITE_NAME}}/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1009{% endif %}" >
|
||||
<meta property="og:image" content="{% if p.is_image %}{{p.realurl(v)}}{% elif p.has_thumb%}{{p.thumb_url}}{% else %}{{SITE_NAME}}/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1011{% endif %}" >
|
||||
{% if p.url and p.is_video %}
|
||||
<meta property="og:video" content="{{p.realurl(v)}}" >
|
||||
{% endif %}
|
||||
|
@ -258,7 +258,7 @@
|
|||
<meta name="twitter:title" content="{{p.plaintitle(v)}} - {{SITE_NAME}}" >
|
||||
{% if p.author %}<meta name="twitter:creator" content="{{'@'+p.author_name}}">{% endif %}
|
||||
<meta name="twitter:description" content="{{p.plainbody(v)}}" >
|
||||
<meta name="twitter:image" content="{% if p.is_image %}{{p.realurl(v)}}{% elif p.has_thumb %}{{p.thumb_url}}{% else %}{{SITE_NAME}}/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1009{% endif %}" >
|
||||
<meta name="twitter:image" content="{% if p.is_image %}{{p.realurl(v)}}{% elif p.has_thumb %}{{p.thumb_url}}{% else %}{{SITE_NAME}}/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1011{% endif %}" >
|
||||
<meta name="twitter:url" content="{{p.permalink}}" >
|
||||
|
||||
{% endif %}
|
||||
|
@ -420,6 +420,10 @@
|
|||
<div id="post-content" class="{% if p.deleted_utc %}deleted {% endif %}card-block w-100 my-md-auto">
|
||||
|
||||
<div class="post-meta text-left mb-2">
|
||||
{% if p.sub %}
|
||||
<a href='/s/{{p.sub}}'>/s/{{p.sub}}</a>
|
||||
{% endif %}
|
||||
|
||||
{% if p.bannedfor %}
|
||||
<a role="button"><i class="fad fa-gavel text-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="User was banned for this post{% if p.author.banned_by %} by @{{p.author.banned_by.username}}{% endif %}"></i></a>
|
||||
{% endif %}
|
||||
|
@ -445,12 +449,12 @@
|
|||
👻
|
||||
{% else %}
|
||||
{% if p.author.house %}
|
||||
<img src="/assets/images/{{SITE_NAME}}/houses/{{p.author.house}}.webp?a=1" height="20" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="House {{p.author.house}}">
|
||||
<img src="/assets/images/{{SITE_NAME}}/houses/{{p.author.house}}.webp?a=5" height="20" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="House {{p.author.house}}">
|
||||
{% endif %}
|
||||
|
||||
{% if p.author.verified %}<i class="fas fa-badge-check align-middle ml-1" style="color:{% if p.author.verifiedcolor %}#{{p.author.verifiedcolor}}{% else %}#1DA1F2{% endif %}" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="{{p.author.verified}}"></i>
|
||||
{% endif %}
|
||||
<a class="user-name text-decoration-none" onclick='popclick({{p.author.json_popover(v) | tojson}})' data-bs-placement="bottom" data-bs-toggle="popover" data-bs-trigger="click" data-content-id="popover" role="button" tabindex="0" style="color: #{{p.author.namecolor}}; font-weight: bold;" class="user-name"><img alt="@{{p.author_name}}'s profile picture" loading="lazy" src="{{p.author.profile_url}}" class="profile-pic-25 mr-2"><span {% if p.author.patron and not p.distinguish_level %}class="patron" style="background-color:#{{p.author.namecolor}};"{% elif p.distinguish_level and request.host == 'rdrama.net' %}class="mod"{% endif %}>{{p.author_name}}</span></a>{% if p.author.customtitle %} <bdi style="color: #{{p.author.titlecolor}}"> {% if p.author.quadrant %}<img alt="{{p.author.quadrant}} quadrant" loading="lazy" height="20" src="/static/assets/images/quadrants/{{p.author.quadrant}}.webp?a=1008">{% endif %}{{p.author.customtitle | safe}}</bdi>{% endif %}
|
||||
<a class="user-name text-decoration-none" onclick='popclick({{p.author.json_popover(v) | tojson}})' data-bs-placement="bottom" data-bs-toggle="popover" data-bs-trigger="click" data-content-id="popover" role="button" tabindex="0" style="color: #{{p.author.namecolor}}; font-weight: bold;" class="user-name"><img alt="@{{p.author_name}}'s profile picture" loading="lazy" src="{{p.author.profile_url}}" class="profile-pic-25 mr-2"><span {% if p.author.patron and not p.distinguish_level %}class="patron" style="background-color:#{{p.author.namecolor}};"{% elif p.distinguish_level and SITE_NAME == 'Drama' %}class="mod"{% endif %}>{{p.author_name}}</span></a>{% if p.author.customtitle %} <bdi style="color: #{{p.author.titlecolor}}"> {% if p.author.quadrant %}<img alt="{{p.author.quadrant}} quadrant" loading="lazy" height="20" src="/static/assets/images/quadrants/{{p.author.quadrant}}.webp?a=1008">{% endif %}{{p.author.customtitle | safe}}</bdi>{% endif %}
|
||||
{% endif %}
|
||||
<span data-bs-toggle="tooltip" data-bs-placement="bottom" id="timestamp" onmouseover="timestamp('timestamp','{{p.created_utc}}')"> {{p.age_string}}</span>
|
||||
({% if p.is_image %}image post{% elif p.is_video %}video post{% elif p.realurl(v) %}<a href="/search/posts/?q=domain%3A{{p.domain}}&sort=new&t=all" {% if not v or v.newtabexternal %}target="_blank"{% endif %}>{{p.domain}}</a>{% else %}text post{% endif %})
|
||||
|
@ -617,7 +621,7 @@
|
|||
<a class="list-inline-item text-muted d-none d-md-inline-block" role="button" data-bs-toggle="modal" data-bs-target="#awardModal" onclick="awardModal('/post/{{p.id}}/awards')"><i class="fas fa-gift fa-fw"></i>Give Award</a>
|
||||
{% endif %}
|
||||
|
||||
<a class="list-inline-item copy-link" role="button" role="button" data-clipboard-text="{% if request.host == 'rdrama.net' %}https://rdrama.com{{p.shortlink}}{% else %}{{p.permalink}}{% endif %}"><i class="fas fa-copy"></i>Copy link</a>
|
||||
<a class="list-inline-item copy-link" role="button" role="button" data-clipboard-text="{% if SITE_NAME == 'Drama' %}https://rdrama.com{{p.shortlink}}{% else %}{{p.permalink}}{% endif %}"><i class="fas fa-copy"></i>Copy link</a>
|
||||
|
||||
{% if v %}
|
||||
<a id="subscribe-{{p.id}}" class="{% if p.id in v.subscribed_idlist() %}d-none{% endif %} list-inline-item" role="button" onclick="post_toast2('/subscribe/{{p.id}}','subscribe-{{p.id}}','unsubscribe-{{p.id}}')"><i class="fas fa-eye"></i>Subscribe</a>
|
||||
|
@ -752,7 +756,7 @@
|
|||
{% endif %}
|
||||
</li>
|
||||
|
||||
<a class="list-inline-item copy-link" role="button" role="button" data-clipboard-text="{% if request.host == 'rdrama.net' %}https://rdrama.com{{p.shortlink}}{% else %}{{p.permalink}}{% endif %}"><i class="fas fa-link"></i>Copy link</a>
|
||||
<a class="list-inline-item copy-link" role="button" role="button" data-clipboard-text="{% if SITE_NAME == 'Drama' %}https://rdrama.com{{p.shortlink}}{% else %}{{p.permalink}}{% endif %}"><i class="fas fa-link"></i>Copy link</a>
|
||||
{% if v %}
|
||||
<li class="list-inline-item">
|
||||
<a role="button" data-bs-toggle="modal" data-bs-target="#actionsModal">
|
||||
|
@ -879,7 +883,7 @@
|
|||
</div>
|
||||
|
||||
{% if offset %}
|
||||
<script src="/static/assets/js/viewmore.js?a=240"></script>
|
||||
<script src="/static/assets/js/viewmore.js?a=245"></script>
|
||||
{% endif %}
|
||||
|
||||
{% elif not p.replies and p.deleted_utc == 0 %}
|
||||
|
|
|
@ -152,6 +152,10 @@
|
|||
<div class="card-block text-left x-scroll-parent my-md-auto w-100">
|
||||
|
||||
<div class="post-meta text-left x-scroll mb-md-2">
|
||||
{% if p.sub %}
|
||||
<a href='/s/{{p.sub}}'>/s/{{p.sub}}</a>
|
||||
{% endif %}
|
||||
|
||||
{% if p.bannedfor %}
|
||||
<a role="button"><i class="fad fa-gavel text-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="User was banned for this post{% if p.author.banned_by %} by @{{p.author.banned_by.username}}{% endif %}"></i></a>
|
||||
{% endif %}
|
||||
|
@ -181,12 +185,12 @@
|
|||
👻
|
||||
{% else %}
|
||||
{% if p.author.house %}
|
||||
<img src="/assets/images/{{SITE_NAME}}/houses/{{p.author.house}}.webp?a=1" height="20" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="House {{p.author.house}}">
|
||||
<img src="/assets/images/{{SITE_NAME}}/houses/{{p.author.house}}.webp?a=5" height="20" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="House {{p.author.house}}">
|
||||
{% endif %}
|
||||
|
||||
{% if p.author.verified %}<i class="fas fa-badge-check align-middle ml-1" style="color:{% if p.author.verifiedcolor %}#{{p.author.verifiedcolor}}{% else %}#1DA1F2{% endif %}" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="{{p.author.verified}}"></i>
|
||||
{% endif %}
|
||||
<a class="user-name text-decoration-none" onclick='popclick({{p.author.json_popover(v) | tojson}})' data-bs-placement="bottom" data-bs-toggle="popover" data-bs-trigger="click" data-content-id="popover" role="button" tabindex="0" style="color: #{{p.author.namecolor}}; font-weight: bold;"><img alt="@{{p.author_name}}'s profile picture" loading="lazy" src="{{p.author.profile_url}}" class="profile-pic-25 mr-2"><span {% if p.author.patron and not p.distinguish_level %}class="patron" style="background-color:#{{p.author.namecolor}};"{% elif p.distinguish_level and request.host == 'rdrama.net' %}class="mod"{% endif %}>{{p.author_name}}</span></a>{% if p.author.customtitle %}<bdi style="color: #{{p.author.titlecolor}}"> {% if p.author.quadrant %}<img alt="{{p.author.quadrant}} quadrant" loading="lazy" height="20" src="/static/assets/images/quadrants/{{p.author.quadrant}}.webp?a=1008">{% endif %}{{p.author.customtitle | safe}}</bdi>{% endif %}
|
||||
<a class="user-name text-decoration-none" onclick='popclick({{p.author.json_popover(v) | tojson}})' data-bs-placement="bottom" data-bs-toggle="popover" data-bs-trigger="click" data-content-id="popover" role="button" tabindex="0" style="color: #{{p.author.namecolor}}; font-weight: bold;"><img alt="@{{p.author_name}}'s profile picture" loading="lazy" src="{{p.author.profile_url}}" class="profile-pic-25 mr-2"><span {% if p.author.patron and not p.distinguish_level %}class="patron" style="background-color:#{{p.author.namecolor}};"{% elif p.distinguish_level and SITE_NAME == 'Drama' %}class="mod"{% endif %}>{{p.author_name}}</span></a>{% if p.author.customtitle %}<bdi style="color: #{{p.author.titlecolor}}"> {% if p.author.quadrant %}<img alt="{{p.author.quadrant}} quadrant" loading="lazy" height="20" src="/static/assets/images/quadrants/{{p.author.quadrant}}.webp?a=1008">{% endif %}{{p.author.customtitle | safe}}</bdi>{% endif %}
|
||||
{% endif %}
|
||||
<span data-bs-toggle="tooltip" data-bs-placement="bottom" onmouseover="timestamp('timestamp-{{p.id}}','{{p.created_utc}}')" id="timestamp-{{p.id}}"> {{p.age_string}}</span>
|
||||
|
||||
|
@ -220,7 +224,7 @@
|
|||
<a class="list-inline-item text-muted d-none d-md-inline-block" role="button" data-bs-toggle="modal" data-bs-target="#awardModal" onclick="awardModal('/post/{{p.id}}/awards')"><i class="fas fa-gift fa-fw"></i>Give Award</a>
|
||||
{% endif %}
|
||||
|
||||
<a class="list-inline-item copy-link" role="button" data-clipboard-text="{% if request.host == 'rdrama.net' %}https://rdrama.com{{p.shortlink}}{% else %}{{p.permalink}}{% endif %}"><i class="fas fa-copy"></i>Copy link</a>
|
||||
<a class="list-inline-item copy-link" role="button" data-clipboard-text="{% if SITE_NAME == 'Drama' %}https://rdrama.com{{p.shortlink}}{% else %}{{p.permalink}}{% endif %}"><i class="fas fa-copy"></i>Copy link</a>
|
||||
|
||||
{% if v %}
|
||||
<a id="subscribe-{{p.id}}" class="{% if p.id in v.subscribed_idlist() %}d-none{% endif %} list-inline-item" role="button" onclick="post_toast2('/subscribe/{{p.id}}','subscribe-{{p.id}}','unsubscribe-{{p.id}}')"><i class="fas fa-eye"></i>Subscribe</a>
|
||||
|
@ -318,7 +322,7 @@
|
|||
|
||||
</li>
|
||||
|
||||
<a class="copy-link" role="button" data-clipboard-text="{% if request.host == 'rdrama.net' %}https://rdrama.com{{p.shortlink}}{% else %}{{p.permalink}}{% endif %}" style="margin-right: 15px;margin-top:5px;"><i class="fas fa-link"></i></a>
|
||||
<a class="copy-link" role="button" data-clipboard-text="{% if SITE_NAME == 'Drama' %}https://rdrama.com{{p.shortlink}}{% else %}{{p.permalink}}{% endif %}" style="margin-right: 15px;margin-top:5px;"><i class="fas fa-link"></i></a>
|
||||
|
||||
{% if p.realbody(v) and request.path != "/changelog"%}
|
||||
<a class="list-inline-item" role="button" onclick="expandText('{{p.id}}')"><i class="fas fa-expand-alt mr-0 text-expand-icon-{{p.id}}"></i></a>
|
||||
|
@ -550,7 +554,7 @@
|
|||
</span>
|
||||
<h2 class="h5">You haven't {% if "saved" in request.full_path %}saved{% else %}made{% endif %} a post yet</h2>
|
||||
<p class="text-muted mb-md-5">Your {% if "saved" in request.full_path %}saved posts{% else %}posting history{% endif %} will show here.</p>
|
||||
{% if "saved" not in request.full_path %}<a href="{% if sub %}/s/{{sub}}{% endif %}/submit" class="btn btn-primary">Create a post</a>{% endif %}
|
||||
{% if "saved" not in request.full_path %}<a href="{% if sub %}/s/{{sub.name}}{% endif %}/submit" class="btn btn-primary">Create a post</a>{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<meta name="author" content="">
|
||||
<link rel="icon" type="image/png" href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1009">
|
||||
<link rel="icon" type="image/png" href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1010">
|
||||
|
||||
{% if request.host == 'pcmemes.net' %}
|
||||
{% set cc='Splash Mountain' %}
|
||||
|
@ -26,7 +26,7 @@
|
|||
{% block stylesheets %}
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=108"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=15">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=116"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=19">
|
||||
{% if v.agendaposter %}
|
||||
<style>
|
||||
html {
|
||||
|
@ -50,8 +50,8 @@
|
|||
{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=108">
|
||||
<link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=15">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=116">
|
||||
<link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=19">
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
|
@ -63,7 +63,7 @@
|
|||
|
||||
|
||||
<div class="submit-grid-view">
|
||||
<form id="submitform" action="{% if sub %}/s/{{sub}}{% endif %}/submit" method="post" enctype="multipart/form-data" style="grid-column: 2">
|
||||
<form id="submitform" action="{% if sub %}/s/{{sub.name}}{% endif %}/submit" method="post" enctype="multipart/form-data" style="grid-column: 2">
|
||||
|
||||
<div class="container">
|
||||
|
||||
|
@ -79,7 +79,24 @@
|
|||
|
||||
<input autocomplete="off" type="hidden" name="formkey" value="{{v.formkey}}">
|
||||
|
||||
<label for="title">Post Title</label>
|
||||
{% if SUBS %}
|
||||
<label class='mt-4' for="title">Sub</label>
|
||||
|
||||
<div class="input-group mb2">
|
||||
<select autocomplete="off" id='sub' class="form-control" form="submitform" name="sub">
|
||||
<option {% if not sub %}selected{% endif %}>
|
||||
general
|
||||
</option>
|
||||
{% for s in SUBS %}
|
||||
<option value="{{s}}" {% if sub.name == s %}selected{% endif %}>
|
||||
/s/{{s}}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<label class='mt-4' for="title">Post Title</label>
|
||||
|
||||
|
||||
<input autocomplete="off" class="form-control" id="post-title" aria-describedby="titleHelpRegister" type="text" name="title" placeholder="Required" value="{{title}}" minlength="1" maxlength="500" required oninput="checkForRequired();savetext()">
|
||||
|
@ -239,9 +256,9 @@
|
|||
checkForRequired()
|
||||
</script>
|
||||
|
||||
<script src="/static/assets/js/marked.js?a=240"></script>
|
||||
<script src="/static/assets/js/marked.js?a=241"></script>
|
||||
<script src="/static/assets/js/formatting.js?a=240"></script>
|
||||
<script src="/static/assets/js/submit.js?a=242"></script>
|
||||
<script src="/static/assets/js/submit.js?a=243"></script>
|
||||
{% include "emoji_modal.html" %}
|
||||
{% include "gif_modal.html" %}
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
</span>
|
||||
{% endif %}
|
||||
{% if u.house %}
|
||||
<img src="/assets/images/{{SITE_NAME}}/houses/{{u.house}}.webp?a=1" height="20" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="House {{u.house}}">
|
||||
<img src="/assets/images/{{SITE_NAME}}/houses/{{u.house}}.webp?a=5" height="20" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="House {{u.house}}">
|
||||
{% endif %}
|
||||
|
||||
{% if u.verified %}<span><i class="fas fa-badge-check align-middle ml-1" style="color:{% if u.verifiedcolor %}#{{u.verifiedcolor}}{% else %}#1DA1F2{% endif %}" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="{{u.verified}}"></i></span>{% endif %}
|
||||
|
@ -353,7 +353,7 @@
|
|||
{% if u.unban_utc %}<h5 class="text-primary">>{{u.unban_string}}</h5>{% endif %}
|
||||
{% endif %}
|
||||
{% if u.house %}
|
||||
<img src="/assets/images/{{SITE_NAME}}/houses/{{u.house}}.webp?a=1" height="20" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="House {{u.house}}">
|
||||
<img src="/assets/images/{{SITE_NAME}}/houses/{{u.house}}.webp?a=5" height="20" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="House {{u.house}}">
|
||||
{% endif %}
|
||||
|
||||
{% if u.verified %}<span><i class="fas fa-badge-check align-middle ml-1" style="color:{% if u.verifiedcolor %}#{{u.verifiedcolor}}{% else %}#1DA1F2{% endif %}" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="{{u.verified}}"></i></span> {% endif %}
|
||||
|
@ -730,7 +730,7 @@
|
|||
</nav>
|
||||
{% endif %}
|
||||
|
||||
<script src="/static/assets/js/marked.js?a=240"></script>
|
||||
<script src="/static/assets/js/marked.js?a=241"></script>
|
||||
|
||||
<style>
|
||||
.userbanner {
|
||||
|
|
|
@ -33,6 +33,10 @@ INSERT INTO public.users (
|
|||
0, 'AutoBetter', '', 'hot', 'top', 'day', '62ca56', 'e4432d', '', '',
|
||||
'', 'dark', '30409f', false, false, '', '', 0, false, 0,
|
||||
0, 0, '', true, 0);
|
||||
(8, 'AutoChoice', '', 0, 0, true, true, '', '', 0, false,
|
||||
0, 'AutoChoice', '', 'hot', 'top', 'day', '62ca56', 'e4432d', '', '',
|
||||
'', 'dark', '30409f', false, false, '', '', 0, false, 0,
|
||||
0, 0, '', true, 0);
|
||||
|
||||
SELECT pg_catalog.setval('public.users_id_seq', 7, true);
|
||||
|
||||
|
|
|
@ -3286,4 +3286,6 @@ But Cooper won't budge. Cooper won't even look at her. Cooper only looks at you.
|
|||
"What?" <br>
|
||||
"N.... never mind that's just a reference to a song"
|
||||
{[para]}
|
||||
based
|
||||
based
|
||||
{[para]}
|
||||
Do any of you look at your cat's poo when it's in the litter tray? Honestly Rose and Belle's poos look like pigs in blanketx
|
Loading…
Reference in New Issue