Have client read out shared settings from server
This commit is contained in:
parent
b5e7c78dcc
commit
4f66192b52
@ -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");
|
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"),
|
api.fetch($("#isso-thread").getAttribute("data-isso-id"),
|
||||||
config["max-comments-top"],
|
config["max-comments-top"],
|
||||||
config["max-comments-nested"]).then(
|
config["max-comments-nested"]).then(
|
||||||
function(rv) {
|
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) {
|
if (rv.total_replies === 0) {
|
||||||
$("#isso-thread > h4").textContent = i18n.translate("no-comments");
|
$("#isso-thread > h4").textContent = i18n.translate("no-comments");
|
||||||
return;
|
return;
|
||||||
|
@ -102,6 +102,11 @@ class API(object):
|
|||||||
self.conf = isso.conf.section("general")
|
self.conf = isso.conf.section("general")
|
||||||
self.moderated = isso.conf.getboolean("moderation", "enabled")
|
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.guard = isso.db.guard
|
||||||
self.threads = isso.db.threads
|
self.threads = isso.db.threads
|
||||||
self.comments = isso.db.comments
|
self.comments = isso.db.comments
|
||||||
@ -397,7 +402,8 @@ class API(object):
|
|||||||
'id' : root_id,
|
'id' : root_id,
|
||||||
'total_replies' : reply_counts[root_id],
|
'total_replies' : reply_counts[root_id],
|
||||||
'hidden_replies' : reply_counts[root_id] - len(root_list),
|
'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
|
# We are only checking for one level deep comments
|
||||||
if root_id is None:
|
if root_id is None:
|
||||||
|
Loading…
Reference in New Issue
Block a user