forked from rDrama/rDrama
master
parent
50976dcc5f
commit
c4154ffa96
|
@ -190,6 +190,7 @@ def get_comment(i, v=None, graceful=False, **kwargs):
|
||||||
vt = g.db.query(CommentVote).filter_by(user_id=v.id, comment_id=Comment.id).first()
|
vt = g.db.query(CommentVote).filter_by(user_id=v.id, comment_id=Comment.id).first()
|
||||||
comment._is_blocking = block and block.user_id == v.id
|
comment._is_blocking = block and block.user_id == v.id
|
||||||
comment._is_blocked = block and block.target_id == v.id
|
comment._is_blocked = block and block.target_id == v.id
|
||||||
|
print(vt.vote_type)
|
||||||
comment.voted = vt.vote_type if vt else 0
|
comment.voted = vt.vote_type if vt else 0
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -58,8 +58,6 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None):
|
||||||
# context improver
|
# context improver
|
||||||
try: context = int(request.args.get("context", 0))
|
try: context = int(request.args.get("context", 0))
|
||||||
except: context = 0
|
except: context = 0
|
||||||
comment_info = comment
|
|
||||||
c = comment
|
|
||||||
while context > 0 and c.level > 1:
|
while context > 0 and c.level > 1:
|
||||||
|
|
||||||
parent = get_comment(c.parent_comment_id, v=v)
|
parent = get_comment(c.parent_comment_id, v=v)
|
||||||
|
@ -68,7 +66,6 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None):
|
||||||
|
|
||||||
c = parent
|
c = parent
|
||||||
context -= 1
|
context -= 1
|
||||||
top_comment = c
|
|
||||||
|
|
||||||
if v: defaultsortingcomments = v.defaultsortingcomments
|
if v: defaultsortingcomments = v.defaultsortingcomments
|
||||||
else: defaultsortingcomments = "top"
|
else: defaultsortingcomments = "top"
|
||||||
|
@ -171,10 +168,10 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None):
|
||||||
|
|
||||||
post.tree_comments()
|
post.tree_comments()
|
||||||
|
|
||||||
post.replies=[top_comment]
|
post.replies=[comment]
|
||||||
|
|
||||||
if request.headers.get("Authorization"): return top_comment.json
|
if request.headers.get("Authorization"): return comment.json
|
||||||
else: return post.rendered_page(v=v, sort=sort, comment=top_comment, comment_info=comment_info)
|
else: return post.rendered_page(v=v, sort=sort, comment=comment, comment_info=comment)
|
||||||
|
|
||||||
|
|
||||||
@app.post("/comment")
|
@app.post("/comment")
|
||||||
|
|
|
@ -20,8 +20,8 @@
|
||||||
<p><a href="{{thing.permalink}}">{{thing.permalink}}</a></p>
|
<p><a href="{{thing.permalink}}">{{thing.permalink}}</a></p>
|
||||||
<p><b>Author:</b> <a href="{{thing.author.url}}">@{{thing.author.username}}</a></p>
|
<p><b>Author:</b> <a href="{{thing.author.url}}">@{{thing.author.username}}</a></p>
|
||||||
<p><b>Author Created At:</b> {{thing.author.created_utc}} ({{thing.author.created_datetime}})</p>
|
<p><b>Author Created At:</b> {{thing.author.created_utc}} ({{thing.author.created_datetime}})</p>
|
||||||
<p><preb>Upvotes: </pre>{{ups | length}}</p>
|
<p><b>Upvotes: </b>{{ups | length}}</p>
|
||||||
<p><pre>Downvotes: </pre>{{downs | length}}</p>
|
<p><b>Downvotes: </b>{{downs | length}}</p>
|
||||||
|
|
||||||
<h2>Upvotes</h2>
|
<h2>Upvotes</h2>
|
||||||
<table class="table table-striped mb-5">
|
<table class="table table-striped mb-5">
|
||||||
|
|
Loading…
Reference in New Issue