vcx
This commit is contained in:
parent
52f88b6352
commit
d8ea05ab3d
4 changed files with 256 additions and 251 deletions
|
@ -604,7 +604,7 @@ def api_comment(v):
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
|
|
||||||
if request.headers.get("Authorization"): return c.json
|
if request.headers.get("Authorization"): return c.json
|
||||||
return render_template("comments.html", v=v, comments=[c])
|
return render_template("comments.html", v=v, comments=[c], ajax=True)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -338,7 +338,7 @@ def viewmore(v, pid, sort, offset):
|
||||||
if len(comments) == len(comments2): offset = None
|
if len(comments) == len(comments2): offset = None
|
||||||
comments = comments2
|
comments = comments2
|
||||||
|
|
||||||
return render_template("comments.html", v=v, comments=comments, render_replies=True, pid=pid, sort=sort, offset=offset)
|
return render_template("comments.html", v=v, comments=comments, render_replies=True, pid=pid, sort=sort, offset=offset, ajax=True)
|
||||||
|
|
||||||
|
|
||||||
@app.post("/morecomments/<cid>")
|
@app.post("/morecomments/<cid>")
|
||||||
|
@ -387,7 +387,7 @@ def morecomments(v, cid):
|
||||||
c = g.db.query(Comment).filter_by(id=cid).one_or_none()
|
c = g.db.query(Comment).filter_by(id=cid).one_or_none()
|
||||||
comments = c.replies
|
comments = c.replies
|
||||||
|
|
||||||
return render_template("comments.html", v=v, comments=comments, render_replies=True)
|
return render_template("comments.html", v=v, comments=comments, render_replies=True, ajax=True)
|
||||||
|
|
||||||
@app.post("/edit_post/<pid>")
|
@app.post("/edit_post/<pid>")
|
||||||
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
||||||
|
|
|
@ -573,7 +573,7 @@ def messagereply(v):
|
||||||
g.db.add(notif)
|
g.db.add(notif)
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
|
|
||||||
return render_template("comments.html", v=v, comments=[new_comment])
|
return render_template("comments.html", v=v, comments=[new_comment], ajax=True)
|
||||||
|
|
||||||
@app.get("/2faqr/<secret>")
|
@app.get("/2faqr/<secret>")
|
||||||
@auth_required
|
@auth_required
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
{% if comment_info and not request.full_path.endswith('#context') %}
|
{% if not ajax %}
|
||||||
|
{% if comment_info and not request.full_path.endswith('#context') %}
|
||||||
<script>
|
<script>
|
||||||
history.pushState(null, null, '#context');
|
history.pushState(null, null, '#context');
|
||||||
</script>
|
</script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if v %}
|
{% if v %}
|
||||||
{% include "award_modal.html" %}
|
{% include "award_modal.html" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
html {
|
html {
|
||||||
scroll-padding-top: 75px;
|
scroll-padding-top: 75px;
|
||||||
}
|
}
|
||||||
|
@ -31,9 +32,9 @@
|
||||||
background: rgba(255,255,255,0.2);
|
background: rgba(255,255,255,0.2);
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div style="display:none" id="popover">
|
<div style="display:none" id="popover">
|
||||||
<div class="popover-user-profile" role="tooltip">
|
<div class="popover-user-profile" role="tooltip">
|
||||||
<img loading="lazy" class="pop-banner w-100 h-64 object-cover">
|
<img loading="lazy" class="pop-banner w-100 h-64 object-cover">
|
||||||
<div class="d-flex align-items-end px-3 mt-n6 mb-3">
|
<div class="d-flex align-items-end px-3 mt-n6 mb-3">
|
||||||
|
@ -69,7 +70,8 @@
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% macro single_comment(c, level=1) %}
|
{% macro single_comment(c, level=1) %}
|
||||||
|
|
||||||
|
@ -742,7 +744,8 @@
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% if v %}
|
{% if not ajax %}
|
||||||
|
{% if v %}
|
||||||
{% include "gif_modal.html" %}
|
{% include "gif_modal.html" %}
|
||||||
{% include "emoji_modal.html" %}
|
{% include "emoji_modal.html" %}
|
||||||
{% if v.admin_level > 1 %}
|
{% if v.admin_level > 1 %}
|
||||||
|
@ -808,9 +811,9 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.mod:before {
|
.mod:before {
|
||||||
content: '(((';
|
content: '(((';
|
||||||
}
|
}
|
||||||
|
@ -901,25 +904,25 @@
|
||||||
margin-right: 3px;
|
margin-right: 3px;
|
||||||
margin-top: -2px;
|
margin-top: -2px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
{% if v %}
|
{% if v %}
|
||||||
<script src="/static/assets/js/marked.js?a=220"></script>
|
<script src="/static/assets/js/marked.js?a=220"></script>
|
||||||
<script src="/static/assets/js/comments_v.js?a=235"></script>
|
<script src="/static/assets/js/comments_v.js?a=235"></script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<script src="/static/assets/js/clipboard.js?a=220"></script>
|
<script src="/static/assets/js/clipboard.js?a=220"></script>
|
||||||
|
|
||||||
{% if v and v.admin_level > 1 %}
|
{% if v and v.admin_level > 1 %}
|
||||||
<script src="/static/assets/js/comments_admin.js?a=220"></script>
|
<script src="/static/assets/js/comments_admin.js?a=220"></script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% include "expanded_image_modal.html" %}
|
{% include "expanded_image_modal.html" %}
|
||||||
|
|
||||||
<script src="/static/assets/js/comments+submission_listing.js?a=221"></script>
|
<script src="/static/assets/js/comments+submission_listing.js?a=221"></script>
|
||||||
<script src="/static/assets/js/comments.js?a=221"></script>
|
<script src="/static/assets/js/comments.js?a=221"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
{% if p and (not v or v.highlightcomments) %}
|
{% if p and (not v or v.highlightcomments) %}
|
||||||
comments = JSON.parse(localStorage.getItem("comment-counts")) || {}
|
comments = JSON.parse(localStorage.getItem("comment-counts")) || {}
|
||||||
lastCount = comments['{{p.id}}']
|
lastCount = comments['{{p.id}}']
|
||||||
|
@ -935,7 +938,8 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
}
|
}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</script>
|
</script>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if offset %}
|
{% if offset %}
|
||||||
{% if p %}
|
{% if p %}
|
||||||
|
@ -944,4 +948,5 @@
|
||||||
<br>
|
<br>
|
||||||
<div id="viewmore-{{offset}}"><button id="viewbtn" class="btn btn-primary" onclick="viewmore({{pid}},'{{sort}}',{{offset}})">VIEW MORE COMMENTS</a></div>
|
<div id="viewmore-{{offset}}"><button id="viewbtn" class="btn btn-primary" onclick="viewmore({{pid}},'{{sort}}',{{offset}})">VIEW MORE COMMENTS</a></div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
</body>
|
</body>
|
Loading…
Add table
Add a link
Reference in a new issue