master
Aevann1 2021-12-17 09:06:25 +02:00
parent fbbae48405
commit fac0b71acc
9 changed files with 44 additions and 25 deletions

View File

@ -967,15 +967,15 @@ def api_distinguish_post(post_id, v):
@validate_formkey
def api_sticky_post(post_id, v):
pins = g.db.query(Submission.id).filter(Submission.stickied != None, Submission.is_banned == False).count()
if pins > 2: return {"error": "Can't exceed 3 pinned posts limit!"}, 403
post = g.db.query(Submission).filter_by(id=post_id).first()
if post:
if post.stickied:
if post.stickied.startswith("t:"): abort(403)
else: post.stickied = None
else: post.stickied = v.username
else:
pins = g.db.query(Submission.id).filter(Submission.stickied != None, Submission.is_banned == False).count()
if pins > 2: return {"error": "Can't exceed 3 pinned posts limit!"}, 403
post.stickied = v.username
g.db.add(post)
ma=ModAction(

View File

@ -104,6 +104,6 @@
</nav>
{% endif %}
<script src="/assets/CHRISTMAS/js/post_toast2.js?v=200"></script>
<script src="/assets/CHRISTMAS/js/post_toast2.js?v=201"></script>
{% endblock %}

View File

@ -346,7 +346,7 @@
{% if v %}
<script>function formkey() {return '{{v.formkey}}';}</script>
<script src="/assets/CHRISTMAS/js/default.js?v=200"></script>
<script src="/assets/CHRISTMAS/js/default.js?v=201"></script>
{% endif %}
</body>

View File

@ -215,7 +215,7 @@
{% if v %}
<script>function formkey() {return '{{v.formkey}}';}</script>
<script src="/assets/CHRISTMAS/js/default.js?v=200"></script>
<script src="/assets/CHRISTMAS/js/default.js?v=201"></script>
{% endif %}
</body>
</html>

View File

@ -53,7 +53,4 @@
{% endif %}
</ul>
</nav>
{% endblock %}
{% block SongsTax %}
{% endblock %}

View File

@ -80,7 +80,4 @@
{% endif %}
</ul>
</nav>
{% endblock %}
{% block SongsTax %}
{% endblock %}

View File

@ -683,6 +683,18 @@
</div>
{% if u.song %}
<div id="uid" class="d-none">{{u.id}}</div>
{% endif %}
{% if v %}
<div id='tax' class="d-none">{% if v.patron or u.patron %}0{% else %}0.03{% endif %}</div>
<script src="/assets/js/userpage_v.js?v=190"></script>
<div id="username" class="d-none">{{u.username}}</div>
{% endif %}
<script src="/assets/js/userpage.js?v=190"></script>
{% endblock %}
{% block pagenav %}
@ -720,16 +732,5 @@
{% endblock %}
{% block SongsTax %}
{% if u.song %}
<div id="uid" class="d-none">{{u.id}}</div>
{% endif %}
{% if v %}
<div id='tax' class="d-none">{% if v.patron or u.patron %}0{% else %}0.03{% endif %}</div>
<script src="/assets/js/userpage_v.js?v=190"></script>
<div id="username" class="d-none">{{u.username}}</div>
{% endif %}
<script src="/assets/js/userpage.js?v=190"></script>
{% block GIFpicker %}
{% endblock %}

View File

@ -103,4 +103,16 @@
{% endif %}
</div>
</div>
{% if u.song %}
<div id="uid" class="d-none">{{u.id}}</div>
{% endif %}
{% if v %}
<div id='tax' class="d-none">{% if v.patron or u.patron %}0{% else %}0.03{% endif %}</div>
<script src="/assets/js/userpage_v.js?v=190"></script>
<div id="username" class="d-none">{{u.username}}</div>
{% endif %}
<script src="/assets/js/userpage.js?v=190"></script>
{% endblock %}

View File

@ -30,6 +30,18 @@
</div>
</div>
</div>
{% if u.song %}
<div id="uid" class="d-none">{{u.id}}</div>
{% endif %}
{% if v %}
<div id='tax' class="d-none">{% if v.patron or u.patron %}0{% else %}0.03{% endif %}</div>
<script src="/assets/js/userpage_v.js?v=190"></script>
<div id="username" class="d-none">{{u.username}}</div>
{% endif %}
<script src="/assets/js/userpage.js?v=190"></script>
{% endblock %}
{% block pagenav %}