fdMerge branch 'frost' of https://github.com/Aevann1/Drama into frost

master
Aevann1 2022-03-05 22:20:11 +00:00
commit c5475a7aee
21 changed files with 34 additions and 93 deletions

View File

@ -30,7 +30,6 @@ class User(Base):
__tablename__ = "users"
if SITE == "pcmemes.net":
quadrant = Column(String)
basedcount = Column(Integer, default=0)
pills = deferred(Column(String, default=""))

View File

@ -46,7 +46,12 @@ def notif_comment(text, autojanny=False):
text_html = sanitize(text, alert=True)
existing = g.db.query(Comment.id).filter_by(author_id=author_id, parent_submission=None, body_html=text_html).one_or_none()
try: existing = g.db.query(Comment.id).filter_by(author_id=author_id, parent_submission=None, body_html=text_html).one_or_none()
except:
existing = g.db.query(Comment).filter_by(author_id=author_id, parent_submission=None, body_html=text_html).all()
for c in existing: g.db.delete(c)
g.db.flush()
existing = g.db.query(Comment.id).filter_by(author_id=author_id, parent_submission=None, body_html=text_html).one_or_none()
if existing: return existing[0]
else: return create_comment(text_html, autojanny)

View File

@ -153,7 +153,7 @@ elif SITE == "pcmemes.net":
SNAPPY_ID = 261
LONGPOSTBOT_ID = 1832
ZOZBOT_ID = 1833
AUTOPOLLER_ID = 3369
AUTOPOLLER_ID = 2129
AUTOBETTER_ID = 1867
AUTOCHOICE_ID = 2072
BASEDBOT_ID = 800

View File

@ -348,40 +348,6 @@ def settings_profile_post(v):
updated = True
quadrant = request.values.get("quadrant")
if quadrant and request.host == 'pcmemes.net'.lower():
v.quadrant = quadrant
v.customtitle = quadrant
if quadrant=="Centrist":
v.namecolor = "7f8fa6"
v.titlecolor = "7f8fa6"
elif quadrant=="LibLeft":
v.namecolor = "62ca56"
v.titlecolor = "62ca56"
elif quadrant=="LibRight":
v.namecolor = "f8db58"
v.titlecolor = "f8db58"
elif quadrant=="AuthLeft":
v.namecolor = "ff0000"
v.titlecolor = "ff0000"
elif quadrant=="AuthRight":
v.namecolor = "2a96f3"
v.titlecolor = "2a96f3"
elif quadrant=="LibCenter":
v.namecolor = "add357"
v.titlecolor = "add357"
elif quadrant=="AuthCenter":
v.namecolor = "954b7a"
v.titlecolor = "954b7a"
elif quadrant=="Left":
v.namecolor = "b1652b"
v.titlecolor = "b1652b"
elif quadrant=="Right":
v.namecolor = "91b9A6"
v.titlecolor = "91b9A6"
updated = True
if updated:
g.db.add(v)
g.db.commit()

View File

@ -19,7 +19,10 @@ def privacy(v):
@auth_required
def marseys(v):
if SITE_NAME == 'Drama':
marseys = g.db.query(Marsey, User).join(User, User.id==Marsey.author_id).order_by(Marsey.count.desc())
marseys = g.db.query(Marsey, User).join(User, User.id==Marsey.author_id)
sort = request.values.get("sort", "usage")
if sort == "usage": marseys = marseys.order_by(Marsey.count.desc())
else: marseys = marseys.order_by(User.username)
else:
marseys = g.db.query(Marsey).order_by(Marsey.count.desc())
return render_template("marseys.html", v=v, marseys=marseys)

View File

@ -15,7 +15,7 @@
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/static/assets/css/main.css?v=172"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=27">
<link rel="stylesheet" href="/static/assets/css/main.css?v=173"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=27">
{% if v.agendaposter %}
<style>
html {

View File

@ -226,7 +226,7 @@
{{c.print()}}
{% 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 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 %}&nbsp;<bdi style="color: #{{c.author.titlecolor}}">&nbsp;{% if c.author.quadrant %}<img alt="{{c.author.quadrant}} quadrant" loading="lazy" height="20" src="/static/assets/images/quadrants/{{c.author.quadrant}}.webp?v=1008">{% endif %}{{c.author.customtitle | safe}}</bdi>{% endif %}
{% if c.author.customtitle %}&nbsp;<bdi style="color: #{{c.author.titlecolor}}">&nbsp;{{c.author.customtitle | safe}}</bdi>{% endif %}
{% endif %}
{% if c.parent_comment_id and not standalone and level != 1 %}<a href="#comment-{{c.parent_comment_id}}-only" class="text-muted ml-2"><i class="fas fa-reply fa-sm fa-fw fa-flip-horizontal mr-1"></i>{{c.parent_comment.author_name}}</a>{% endif %}

View File

@ -7,9 +7,9 @@
<script src="/static/assets/js/bootstrap.js?v=245"></script>
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/static/assets/css/main.css?v=172">
<link rel="stylesheet" href="/static/assets/css/main.css?v=173">
{% if SITE_NAME == 'Drama' and not request.path.startswith('/s/') %}
<link rel="stylesheet" href="/static/assets/css/ukraine.css?v=1">
<link rel="stylesheet" href="/static/assets/css/ukraine.css?v=2">
{% endif %}
<link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=27">
{% if v.agendaposter %}
@ -35,9 +35,9 @@
{% endif %}
{% else %}
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="/static/assets/css/main.css?v=172">
<link rel="stylesheet" href="/static/assets/css/main.css?v=173">
{% if SITE_NAME == 'Drama' and not request.path.startswith('/s/') %}
<link rel="stylesheet" href="/static/assets/css/ukraine.css?v=1">
<link rel="stylesheet" href="/static/assets/css/ukraine.css?v=2">
{% endif %}
<link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=27">
{% endif %}

View File

@ -6,7 +6,7 @@
{% block content %}
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/static/assets/css/main.css?v=172"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=27">
<link rel="stylesheet" href="/static/assets/css/main.css?v=173"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=27">
{% 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?v=172"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=27">
<link rel="stylesheet" href="/static/assets/css/main.css?v=173"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=27">
{% endif %}
<div class="row justify-content-around">

View File

@ -18,7 +18,7 @@
{% endblock %}
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="/static/assets/css/main.css?v=172">
<link rel="stylesheet" href="/static/assets/css/main.css?v=173">
<link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=27">
</head>

View File

@ -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?v=172"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=27">
<link rel="stylesheet" href="/static/assets/css/main.css?v=173"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=27">
</head>

View File

@ -10,8 +10,8 @@
<th>#</th>
<th>Name</th>
<th>Marsey</th>
<th>Usage</th>
{% if SITE_NAME == 'Drama' %}<th>Author</th>{% endif %}
<th><a href="?sort=usage">Usage</a></th>
{% if SITE_NAME == 'Drama' %}<th><a href="?sort=author">Author</a></th>{% endif %}
</tr>
</thead>
<tbody id="followers-table">

View File

@ -34,7 +34,7 @@
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/static/assets/css/main.css?v=172"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=27">
<link rel="stylesheet" href="/static/assets/css/main.css?v=173"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=27">
{% if v.agendaposter %}
<style>
html {

View File

@ -39,10 +39,10 @@
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/static/assets/css/main.css?v=172"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=27">
<link rel="stylesheet" href="/static/assets/css/main.css?v=173"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=27">
{% else %}
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="/static/assets/css/main.css?v=172"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=27">
<link rel="stylesheet" href="/static/assets/css/main.css?v=173"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=27">
{% endif %}
</head>

View File

@ -10,38 +10,6 @@
<div class="settings">
{% if request.host == "pcmemes.net".lower() %}
<h2 class="h5" name="referral">Quadrant</h2>
<div class="settings-section rounded">
<div class="d-lg-flex border-bottom">
<div class="title w-lg-25">
<label for="quadrant">Quadrant</label>
</div>
<div class="body w-lg-100">
<p>Choose your quadrant.</p>
<div class="input-group mb2">
<select autocomplete="off" id='quadrant' class="form-control" form="profile-settings" name="quadrant" onchange="post_toast(this,'/settings/profile?quadrant='+document.getElementById('quadrant').value, '1')">
{% for entry in ["Centrist", "LibLeft", "LibRight", "AuthLeft", "AuthRight", "LibCenter", "AuthCenter", "Left", "Right"] %}
<option value="{{entry}}" {% if v.quadrant==entry %} selected {% endif %}>
{{entry}}
</option>
{% endfor %}
</select>
</div>
</div>
</div>
</div>
{% endif %}
{% if SITE_NAME == 'Drama' %}
<h2 class="h5" name="referral">House</h2>

View File

@ -31,7 +31,7 @@
<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?v=172"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=27">
<link rel="stylesheet" href="/static/assets/css/main.css?v=173"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=27">
</head>

View File

@ -32,7 +32,7 @@
<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?v=172"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=27">
<link rel="stylesheet" href="/static/assets/css/main.css?v=173"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=27">
</head>

View File

@ -632,7 +632,7 @@
{% 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" 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 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 %}&nbsp;<bdi style="color: #{{p.author.titlecolor}}">&nbsp;{% if p.author.quadrant %}<img alt="{{p.author.quadrant}} quadrant" loading="lazy" height="20" src="/static/assets/images/quadrants/{{p.author.quadrant}}.webp?v=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 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 %}&nbsp;<bdi style="color: #{{p.author.titlecolor}}">&nbsp;{{p.author.customtitle | safe}}</bdi>{% endif %}
{% endif %}
<span data-bs-toggle="tooltip" data-bs-placement="bottom" id="timestamp" onmouseover="timestamp('timestamp','{{p.created_utc}}')">&nbsp;{{p.age_string}}</span>
({% if p.is_image %}image post{% elif p.is_video %}video post{% elif p.domain %}<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 %})

View File

@ -200,7 +200,7 @@
{% 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" 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 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}}">&nbsp;&nbsp;{% if p.author.quadrant %}<img alt="{{p.author.quadrant}} quadrant" loading="lazy" height="20" src="/static/assets/images/quadrants/{{p.author.quadrant}}.webp?v=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 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}}">&nbsp;&nbsp;{{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}}">&nbsp;{{p.age_string}}</span>
&nbsp;

View File

@ -26,7 +26,7 @@
{% block stylesheets %}
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/static/assets/css/main.css?v=172"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=27">
<link rel="stylesheet" href="/static/assets/css/main.css?v=173"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=27">
{% if v.agendaposter %}
<style>
html {
@ -50,7 +50,7 @@
{% endif %}
{% else %}
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="/static/assets/css/main.css?v=172">
<link rel="stylesheet" href="/static/assets/css/main.css?v=173">
<link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=27">
{% endif %}
{% endblock %}

View File

@ -104,7 +104,7 @@
</div>
</div>
{% if u.customtitle %}<p class="font-weight-bolder" style="color: #{{u.titlecolor}}">{% if u.quadrant %}<img alt="{{u.quadrant}} quadrant" loading="lazy" height="20" src="/static/assets/images/quadrants/{{u.quadrant}}.webp?v=1008">{% endif %}{{u.customtitle | safe}}</p>
{% if u.customtitle %}<p class="font-weight-bolder" style="color: #{{u.titlecolor}}">{{u.customtitle | safe}}</p>
{% else %}<pre></pre>
{% endif %}
@ -399,7 +399,7 @@
{% if v and v.has_follower(u) and not v.is_nofollow %}
<span class="followsyou badge badge-secondary text-small align-middle mx-1">Follows you</span>
{% endif %}
{% if u.customtitle %}<p style="color: #{{u.titlecolor}}">{% if u.quadrant %}<img alt="@{{u.quadrant}} quadrant" loading="lazy" height="20" src="/static/assets/images/quadrants/{{u.quadrant}}.webp?v=1008">{% endif %}{{u.customtitle | safe}}</p>
{% if u.customtitle %}<p style="color: #{{u.titlecolor}}">{{u.customtitle | safe}}</p>
{% else %}
<pre></pre>
{% endif %}