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,3 +1,4 @@
|
||||||
|
{% if not ajax %}
|
||||||
{% if comment_info and not request.full_path.endswith('#context') %}
|
{% if comment_info and not request.full_path.endswith('#context') %}
|
||||||
<script>
|
<script>
|
||||||
history.pushState(null, null, '#context');
|
history.pushState(null, null, '#context');
|
||||||
|
@ -70,6 +71,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% macro single_comment(c, level=1) %}
|
{% macro single_comment(c, level=1) %}
|
||||||
|
|
||||||
|
@ -742,6 +744,7 @@
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
{% if not ajax %}
|
||||||
{% if v %}
|
{% if v %}
|
||||||
{% include "gif_modal.html" %}
|
{% include "gif_modal.html" %}
|
||||||
{% include "emoji_modal.html" %}
|
{% include "emoji_modal.html" %}
|
||||||
|
@ -936,6 +939,7 @@
|
||||||
}
|
}
|
||||||
{% 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