master
Aevann1 2021-12-10 06:58:55 +02:00
parent e23182b55f
commit a10b470695
18 changed files with 71 additions and 26 deletions

View File

@ -95,6 +95,7 @@ class User(Base):
sig_html = Column(String)
fp = Column(String)
sigs_disabled = Column(Boolean)
fish = Column(Boolean)
friends = deferred(Column(String))
friends_html = deferred(Column(String))
enemies = deferred(Column(String))

View File

@ -626,6 +626,14 @@ AWARDS = {
"color": "text-lightgreen",
"price": 10000
},
"fish": {
"kind": "fish",
"title": "Fish",
"description": "This user cannot be unfollowed",
"icon": "fas fa-fish",
"color": "text-lightblue",
"price": 20000
},
"pause": {
"kind": "pause",
"title": "Pause",
@ -774,6 +782,14 @@ AWARDS2 = {
"color": "text-lightgreen",
"price": 10000
},
"fish": {
"kind": "fish",
"title": "Fish",
"description": "This user cannot be unfollowed",
"icon": "fas fa-fish",
"color": "text-lightblue",
"price": 20000
},
"pause": {
"kind": "pause",
"title": "Pause",

View File

@ -183,6 +183,15 @@ def shop(v):
"owned": 0,
"price": 10000
},
"fish": {
"kind": "fish",
"title": "Fish",
"description": "This user cannot be unfollowed",
"icon": "fas fa-fish",
"color": "text-lightblue",
"owned": 0,
"price": 20000
},
"pause": {
"kind": "pause",
"title": "Pause",
@ -357,6 +366,14 @@ def buy(v, award):
"color": "text-lightgreen",
"price": 10000
},
"fish": {
"kind": "fish",
"title": "Fish",
"description": "This user cannot be unfollowed",
"icon": "fas fa-fish",
"color": "text-lightblue",
"price": 20000
},
"pause": {
"kind": "pause",
"title": "Pause",
@ -593,6 +610,9 @@ def award_post(pid, v):
new_badge = Badge(badge_id=87, user_id=author.id)
g.db.add(new_badge)
for block in g.db.query(UserBlock).filter_by(target_id=author.id).all(): g.db.delete(block)
elif kind == "fish":
author.fish = True
send_notification(CARP_ID, f"@{v.username} used {kind} award!")
if post.author.received_award_count: post.author.received_award_count += 1
else: post.author.received_award_count = 1
@ -749,6 +769,9 @@ def award_comment(cid, v):
new_badge = Badge(badge_id=87, user_id=author.id)
g.db.add(new_badge)
for block in g.db.query(UserBlock).filter_by(target_id=author.id).all(): g.db.delete(block)
elif kind == "fish":
author.fish = True
send_notification(CARP_ID, f"@{v.username} used {kind} award!")
if c.author.received_award_count: c.author.received_award_count += 1
else: c.author.received_award_count = 1

View File

@ -765,7 +765,7 @@ def unfollow_user(username, v):
target = get_user(username)
if target.id == CARP_ID: abort(403)
if target.fish: return {"error": "You can't unfollow this user!"}
follow = g.db.query(Follow).filter_by(user_id=v.id, target_id=target.id).first()

View File

@ -13,11 +13,11 @@
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=139"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=125">
<link rel="stylesheet" href="/assets/css/main.css?v=140"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=125">
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=125">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
{% else %}
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=139"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=125">
<link rel="stylesheet" href="/assets/css/main.css?v=140"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=125">
{% endif %}
</head>

View File

@ -24,6 +24,11 @@
<div class="text-muted">{{award.owned}} owned</div>
</a>
{% endfor %}
<a class="card disabled d-md-none" style="border:none">
<i class="fas fa-volume-mute" style="opacity:0"></i>
<div class="pt-2" style="font-weight: bold; font-size: 14px; color:#E1E1E1">&nbsp;</div>
<div class="text-muted">&nbsp;</div>
</a>
</div>
<label id="notelabel" for="note" class="pt-4">Note (optional):</label>
<input id="kind" name="kind" value="" hidden>
@ -73,7 +78,7 @@
@media (min-width: 767.98px) {
.award-columns {
column-count: 9 !important;
column-count: 7 !important;
}
}
</style>

View File

@ -4,15 +4,15 @@
<script src="/assets/js/bootstrap.js?v=1"></script>
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=139">
<link rel="stylesheet" href="/assets/css/main.css?v=140">
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=125">
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=125">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
{% else %}
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=139"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=125">
<link rel="stylesheet" href="/assets/css/main.css?v=140"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=125">
{% endif %}
<link href="/assets/css/fa.css?v=54" rel="stylesheet">
<link href="/assets/css/fa.css?v=55" rel="stylesheet">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

View File

@ -1,6 +1,6 @@
{% extends "default.html" %}
{% block content %}
<script src="/assets/js/following.js?v=2"></script>
<script src="/assets/js/following.js?v=3"></script>
<pre>
@ -23,7 +23,7 @@
<td style="font-weight: bold">{{loop.index}}</td>
<td><a style="color:#{{user.namecolor}}; font-weight:bold;" href="/@{{user.username}}"><img loading="lazy" src="/uid/{{user.id}}/pic" class="pp20"><span {% if user.patron %}class="patron" style="background-color:#{{user.namecolor}};"{% endif %}>{{user.username}}</span></a></td>
{% if v.id == u.id %}
<td><div class="btn btn-danger" onclick="removeFollower(event, '{{user.username}}')">Unfollow</div></td>
<td><div class="btn btn-danger" onclick="removeFollowing(event, '{{user.username}}')">Unfollow</div></td>
{% endif %}
</tr>
{% endfor %}

View File

@ -6,11 +6,11 @@
{% block content %}
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=139"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=125">
<link rel="stylesheet" href="/assets/css/main.css?v=140"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=125">
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=125">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
{% else %}
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=139"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=125">
<link rel="stylesheet" href="/assets/css/main.css?v=140"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=125">
{% endif %}
<div class="row justify-content-around">

View File

@ -16,7 +16,7 @@
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=70"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=70">
<link href="/assets/css/fa.css?v=54" rel="stylesheet">
<link href="/assets/css/fa.css?v=55" rel="stylesheet">
</head>

View File

@ -12,7 +12,7 @@
<title>2-Step Login - {{'SITE_NAME' | app_config}}</title>
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=139"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=125">
<link rel="stylesheet" href="/assets/css/main.css?v=140"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=125">
</head>

View File

@ -31,10 +31,10 @@
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=139"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=125">
<link rel="stylesheet" href="/assets/css/main.css?v=140"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=125">
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=125">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
<link href="/assets/css/fa.css?v=54" rel="stylesheet">
<link href="/assets/css/fa.css?v=55" rel="stylesheet">
</head>
<body id="settings" style="overflow-x: hidden; {% if v and v.background %} background:url(/assets/images/backgrounds/{{v.background}}) no-repeat center center fixed !important; background-size: cover!important; background-color: #000!important;{% endif %}">

View File

@ -36,13 +36,13 @@
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=139"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=125">
<link rel="stylesheet" href="/assets/css/main.css?v=140"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=125">
{% else %}
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=139"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=125">
<link rel="stylesheet" href="/assets/css/main.css?v=140"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=125">
{% endif %}
<link href="/assets/css/fa.css?v=54" rel="stylesheet">
<link href="/assets/css/fa.css?v=55" rel="stylesheet">
</head>
<body id="settings2" style="overflow-x: hidden; {% if v and v.background %} background:url(/assets/images/backgrounds/{{v.background}}) no-repeat center center fixed !important; background-size: cover!important; background-color: #000!important;{% endif %}">

View File

@ -28,7 +28,7 @@
<title>{% if ref_user %}{{ref_user.username}} invites you to {{'SITE_NAME' | app_config}}{% else %}Sign up - {{'SITE_NAME' | app_config}}{% endif %}</title>
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=139"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=125">
<link rel="stylesheet" href="/assets/css/main.css?v=140"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=125">
</head>

View File

@ -29,7 +29,7 @@
<title>{% if ref_user %}{{ref_user.username}} invites you to {{'SITE_NAME' | app_config}}{% else %}{{'SITE_NAME' | app_config}}{% endif %}</title>
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=139"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=125">
<link rel="stylesheet" href="/assets/css/main.css?v=140"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=125">
</head>

View File

@ -23,16 +23,16 @@
{% block stylesheets %}
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=139"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=125">
<link rel="stylesheet" href="/assets/css/main.css?v=140"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=125">
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=125">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
{% else %}
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=139">
<link rel="stylesheet" href="/assets/css/main.css?v=140">
<link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=125">
{% endif %}
{% endblock %}
<link href="/assets/css/fa.css?v=54" rel="stylesheet"> </head>
<link href="/assets/css/fa.css?v=55" rel="stylesheet"> </head>
<body id="submit" style="overflow-x: hidden; {% if v and v.background %} background:url(/assets/images/backgrounds/{{v.background}}) no-repeat center center fixed !important; background-size: cover!important; background-color: #000!important;{% endif %}display: block;">

View File

@ -15,7 +15,7 @@
{% if v.id!=u.id and not u.is_private and not u.is_nofollow %}
<div id="button-sub-{{u.id}}" style="z-index: 2" class="{% if u.has_follower(v) %}d-none{% endif %}"><a class="btn btn-primary " href="javascript:void(0)" onclick="post_toast2('/follow/{{u.username}}','button-sub-{{u.id}}','button-unsub-{{u.id}}')">Follow</a></div>
{% if u.id != 995 %}<div id="button-unsub-{{u.id}}" style="z-index: 2" class="{% if not u.has_follower(v) %} d-none{% endif %}"><a class="btn btn-secondary " href="javascript:void(0)" onclick="post_toast2('/unfollow/{{u.username}}','button-sub-{{u.id}}','button-unsub-{{u.id}}')">Unfollow</a></div>{% endif %}
{% if not u.fish %}<div id="button-unsub-{{u.id}}" style="z-index: 2" class="{% if not u.has_follower(v) %} d-none{% endif %}"><a class="btn btn-secondary " href="javascript:void(0)" onclick="post_toast2('/unfollow/{{u.username}}','button-sub-{{u.id}}','button-unsub-{{u.id}}')">Unfollow</a></div>{% endif %}
{% endif %}
{% else %}
<div id="button-sub-{{u.id}}" style="z-index: 2" "><a class="btn btn-primary " href="/signup?redirect={{request.path}}">Follow</a></div>

View File

@ -157,7 +157,7 @@
<div class="d-flex justify-content-between align-items-center">
<div>
{% if v and v.id != u.id %}
{% if u.id != 995 %}<a id="button-unsub" class="btn btn-secondary {% if not is_following %}d-none{% endif %}" href="javascript:void(0)" onclick="post_toast2('/unfollow/{{u.username}}','button-unsub','button-sub')">Unfollow</a>{% endif %}
{% if not u.fish %}<a id="button-unsub" class="btn btn-secondary {% if not is_following %}d-none{% endif %}" href="javascript:void(0)" onclick="post_toast2('/unfollow/{{u.username}}','button-unsub','button-sub')">Unfollow</a>{% endif %}
<a id="button-sub" class="btn btn-primary {% if is_following or u.is_nofollow or u.is_blocked %}d-none{% endif %}" href="javascript:void(0)" onclick="post_toast2('/follow/{{u.username}}','button-unsub','button-sub')">Follow</a>
<a class="btn btn-primary" href="javascript:void(0)" onclick="toggleElement('profile-toggleable', 'message')">Message</a>
@ -441,7 +441,7 @@
{% endif %}
{% if v and v.id != u.id %}
{% if u.id != 995 %}<a id="button-unsub2" class="btn btn-secondary {% if not is_following %}d-none{% endif %}" href="javascript:void(0)" onclick="post_toast2('/unfollow/{{u.username}}','button-unsub2','button-sub2')">Unfollow</a>{% endif %}
{% if not u.fish %}<a id="button-unsub2" class="btn btn-secondary {% if not is_following %}d-none{% endif %}" href="javascript:void(0)" onclick="post_toast2('/unfollow/{{u.username}}','button-unsub2','button-sub2')">Unfollow</a>{% endif %}
<a id="button-sub2" class="btn btn-primary {% if is_following or u.is_nofollow or u.is_blocked %}d-none{% endif %}" href="javascript:void(0)" onclick="post_toast2('/follow/{{u.username}}','button-unsub2','button-sub2')">Follow</a>
<a class="btn btn-primary" href="javascript:void(0)" onclick="toggleElement('profile-toggleable-mobile', 'message-mobile')">Message</a>
<a class="btn btn-primary" href="javascript:void(0)" onclick="post_toast('/@{{u.username}}/suicide')">Get them help</a>