pull/311/merge
Pelle Nilsson 6 years ago committed by GitHub
commit dab701946b

@ -27,14 +27,19 @@ require(["app/lib/ready", "app/config", "app/i18n", "app/api", "app/isso", "app/
return console.log("abort, #isso-thread is missing");
}
$("#isso-thread").append($.new('h4'));
$("#isso-thread").append(new isso.Postbox(null));
$("#isso-thread").append('<div id="isso-root"></div>');
api.fetch($("#isso-thread").getAttribute("data-isso-id"),
config["max-comments-top"],
config["max-comments-nested"]).then(
function(rv) {
for (var setting in rv.config) {
config[setting] = rv.config[setting]
}
$("#isso-thread").append($.new('h4'));
$("#isso-thread").append(new isso.Postbox(null));
$("#isso-thread").append('<div id="isso-root"></div>');
if (rv.total_replies === 0) {
$("#isso-thread > h4").textContent = i18n.translate("no-comments");
return;

@ -113,6 +113,11 @@ class API(object):
self.conf = isso.conf.section("general")
self.moderated = isso.conf.getboolean("moderation", "enabled")
# These configuration records can be read out by client
self.public_conf = {}
self.public_conf["reply-to-self"] = isso.conf.getboolean("guard", "reply-to-self")
self.public_conf["require-email"] = isso.conf.getboolean("guard", "require-email")
self.guard = isso.db.guard
self.threads = isso.db.threads
self.comments = isso.db.comments
@ -684,7 +689,8 @@ class API(object):
'id' : root_id,
'total_replies' : reply_counts[root_id],
'hidden_replies' : reply_counts[root_id] - len(root_list),
'replies' : self._process_fetched_list(root_list, plain)
'replies' : self._process_fetched_list(root_list, plain),
'config' : self.public_conf
}
# We are only checking for one level deep comments
if root_id is None:

Loading…
Cancel
Save