remove this stupid template

pull/20/head
justcool393 2022-11-19 04:40:02 -06:00
parent 8b352371bf
commit 23aa542d03
4 changed files with 6 additions and 159 deletions

View File

@ -74,10 +74,8 @@ def post_pid_comment_cid(v, cid, pid=None, anything=None, sub=None):
execute_shadowban_viewers_and_voters(v, comment)
if v and v.client: return top_comment.json
else:
if post.is_banned and not (v and (v.admin_level >= PERMS['POST_COMMENT_MODERATION'] 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.subr)
else:
return render_template("submission.html", 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")

View File

@ -220,12 +220,7 @@ def post_id(v, pid, anything=None, sub=None):
if v and v.client:
return post.json(g.db)
template = "submission.html"
if (post.is_banned or post.author.shadowbanned) \
and not (v and (v.admin_level >= PERMS['POST_COMMENT_MODERATION'] or post.author_id == v.id)):
template = "submission_banned.html"
return render_template(template, v=v, p=post, ids=list(ids),
return render_template("submission.html", v=v, p=post, ids=list(ids),
sort=sort, render_replies=True, offset=offset, sub=post.subr,
fart=get_setting('Fart mode'))

View File

@ -8,18 +8,16 @@
{% else %}
{% set voted=-2 %}
{% endif %}
{% set v_forbid_deleted = (p.deleted_utc != 0) and not (v and v.admin_level >= PERMS['POST_COMMENT_MODERATION']) and not (v and v.id == p.author_id) %}
{% set v_forbid_deleted = (not v and v.id == p.author_id) and
((p.deleted_utc != 0 and not v.admin_level >= PERMS['POST_COMMENT_MODERATION']) or
(p.author.shadowbanne) and not v.admin_level >= PERMS['USER_SHADOWBAN'])) %}
{% block title %}
<style>
body > .container {
padding-left: 20px !important;
padding-right: 20px !important;
}
</style>
{% include "awards.html" %}
{% if SITE_NAME == 'PCM' %}
{% include "awards_PCM.html" %}
@ -27,9 +25,7 @@
{% endblock %}
{% block pagetype %}thread{% endblock %}
{% block actionsModal %}
{% if v %}
<div class="modal fade d-md-none" id="actionsModal" tabindex="-1" role="dialog" aria-labelledby="actionsModalTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">

View File

@ -1,142 +0,0 @@
{% extends "submission.html" %}
{% set score=p.score %}
{% if v %}
{% set voted=p.voted %}
{% set adjust=voted %}
{% else %}
{% set voted=-2 %}
{% set adjust=0 %}
{% endif %}
{% block title %}
<title>{{p.plaintitle(v)}}</title>
{% if p.is_banned %}
{% else %}
{% endif %}
{% endblock %}
{% block content %}
<div class="mb-2 p-3">
<div class="col-12">
<div id="post-{{p.id}}" class="banned {% if p.award_count('glowie', v) %}glow{% endif %} card d-flex flex-row-reverse flex-nowrap justify-content-end border-0 p-0 {% if voted==1 %} upvoted{% elif voted==-1 %} downvoted{% endif %}">
<div class="card-block my-md-auto">
<div class="post-meta text-left d-md-none mb-1">{% if p.over_18 %}<span class="badge badge-danger">+18</span> {% endif %}{% if p.is_banned %}removed by @{{p.ban_reason}} (Admin){% else %}[Deleted by user]{% endif %}</div>
<h5 class="card-title post-title text-left mb-0 mb-md-1">{{p.plaintitle(v)}}</h5>
<div class="post-meta text-left d-mob-none">{% if p.over_18 %}<span class="badge badge-danger">+18</span> {% endif %}{% if p.is_banned %}removed by @{{p.ban_reason}} (Admin){% else %}[Deleted by user]{% endif %}</div>
</div>
<div id="voting" class="d-md-block my-auto mr-3 text-center">
<div class="post-{{p.id}}-up arrow-up mx-auto">
</div>
<span class="post-{{p.id}}-score-up score-up text-muted{% if voted!=1 %} d-none{% endif %}"></span>
<span class="post-{{p.id}}-score-none score text-muted{% if voted!=0 and voted!=-2 %} d-none{% endif %}"></span>
<span class="post-{{p.id}}-score-down score-down text-muted{% if voted!=-1 %} d-none{% endif %}"></span>
<div class="post-{{p.id}}-down arrow-down mx-auto">
</div>
</div>
</div>
{% if v.admin_level >= PERMS['POST_COMMENT_MODERATION'] and p.body_html %}
<div class="post-body mt-4 mb-2">
{{p.body_html | safe}}
</div>
{% endif %}
</div>
</div>
<div class="row mb-2 p-3">
<div class="col-12">
<div class="post-actions d-mob-none">
<ul class="list-inline text-left mb-2">
<li class="list-inline-item"><a href="{{p.permalink}}"><i
class="fas fa-comment-dots mr-2"></i>{{p.comment_count}} Comment{{'s' if p.comment_count != 1 else ''}}</a>
</li>
</ul>
</div>
</div>
</div>
<div class="comment-section">
{% with comments=p.replies %}
{% include "comments.html" %}
{% endwith %}
</div>
{% if offset %}
<script>
function viewmore(pid,sort,offset,ids) {
btn = document.getElementById("viewbtn");
btn.disabled = true;
btn.innerHTML = "Requesting...";
const form = new FormData();
const xhr = new XMLHttpRequest();
xhr.open("get", `/viewmore/${pid}/${sort}/${offset}?ids=${ids}`);
xhr.setRequestHeader('xhr', 'xhr');
xhr.onload=function(){
if (xhr.status==200) {
let e = document.getElementById(`viewmore-${offset}`);
e.innerHTML = xhr.response.replace(/data-src/g, 'src').replace(/data-cfsrc/g, 'src').replace(/style="display:none;visibility:hidden;"/g, '');
bs_trigger(e)
comments = JSON.parse(localStorage.getItem("old-comment-counts")) || {}
lastCount = comments['{{p.id}}']
if (lastCount)
{
{% for c in p.comments %}
{% if not (v and v.id==c.author_id) and not c.voted %}
if ({{c.created_utc*1000}} > lastCount.t)
try {document.getElementById("comment-{{c.id}}-only").classList.add('unread')}
catch(e) {}
{% endif %}
{% endfor %}
}
}
btn.disabled = false;
}
xhr.send(form)
}
</script>
{% endif %}
{% endblock %}
{% block mobileactions %}
<div class="row fixed-top bg-white shadow d-inline-flex d-md-none p-3" id="footer-actions" style="z-index: 3; top: 48px; transition: top cubic-bezier(0, 0, 0.2, 1) 220ms;">
<div class="col text-center">
<div class="post-actions mx-auto">
<ul class="list-inline">
<li id="voting-mobile" class="voting list-inline-item{% if voted==1 %} upvoted{% elif voted==-1 %} downvoted{% endif %}">
<span class="arrow-mobile-up mr-2 arrow-mobile-up">
<i class="fas fa-arrow-alt-up mx-0"></i>
</span>
<span class="post-{{p.id}}-score-mobile-up score-up text-muted{% if voted!=1 %} d-none{% endif %}"></span>
<span class="post-{{p.id}}-score-mobile-none score text-muted{% if voted!=0 and voted!=-2 %} d-none{% endif %}"></span>
<span class="post-{{p.id}}-score-mobile-down score-down text-muted{% if voted!=-1 %} d-none{% endif %}"></span>
<span class="arrow-mobile-down arrow-mobile-down ml-2 my-0">
<i class="fas fa-arrow-alt-down mx-0"></i>
</span>
</li>
</ul>
</div>
</div>
</div>
{% endblock %}