def get(self, share_key):
sharedfile = Sharedfile.get_by_share_key(share_key)
if not sharedfile:
raise tornado.web.HTTPError(404)
expanded = self.get_argument("expanded", False)
if expanded:
expanded = True
# Prevent IE from caching AJAX requests
self.set_header("Cache-Control","no-store, no-cache, must-revalidate");
self.set_header("Pragma","no-cache");
self.set_header("Expires", 0);
user = self.get_current_user_object()
can_comment = user and user.email_confirmed == 1 and not options.readonly
comments = sharedfile.comments()
html_response = self.render_string("image/quick-comments.html", sharedfile=sharedfile,
comments=comments, current_user=user,
can_comment=can_comment,
expanded=expanded)
return self.write({'result' : 'ok', 'count' : len(comments), 'html' : html_response })
评论列表
文章目录