From: hylom Date: Wed, 4 Oct 2017 17:22:03 +0000 (+0900) Subject: fix journal's comment settings to work X-Git-Tag: v0.1.1~323 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=4271435111deeea679a603188488c8e79f71d39f;p=newslash%2Fnewslash.git fix journal's comment settings to work --- diff --git a/src/newslash_web/public/js/base.js b/src/newslash_web/public/js/base.js index f7e0931a..bd807eba 100644 --- a/src/newslash_web/public/js/base.js +++ b/src/newslash_web/public/js/base.js @@ -55,7 +55,7 @@ var Comment = function () { this.tweak = 0; this.badge_id = 0; this.comment = ''; - + this.create_time = ''; this.author = ''; this.children = []; }; diff --git a/src/newslash_web/public/js/comment-tree.js b/src/newslash_web/public/js/comment-tree.js index 5863e12c..afa426d6 100644 --- a/src/newslash_web/public/js/comment-tree.js +++ b/src/newslash_web/public/js/comment-tree.js @@ -12,6 +12,7 @@ commentTree.init = function () { return { userConfig: userConfig || {}, archived: page.archived || false, + commentAllowed: page.commentAllowed || false, savable: user.is_login || false, isConfigVisible: false, }; @@ -46,7 +47,8 @@ commentTree.init = function () { template: '#comment-tree-template', data: function () { return { - archived: page.archived, + commentAllowed: page.commentAllowed, + archived: page.archived || false, comments: [], rootID: 0, }; @@ -101,7 +103,8 @@ commentTree.init = function () { secToken: '', displayForce: false, - archived: page.archived, + commentAllowed: page.commentAllowed, + archived: page.archived || false, isFormVisible: false, }; @@ -116,6 +119,7 @@ commentTree.init = function () { }, computed: { commentLocalTime: function () { + if (this.comment.create_time == "") return ""; var dt = nsUtil.decodeMySQLDateTime(this.comment.create_time); return nsUtil.formatToLocalDateTime(dt); }, @@ -179,10 +183,10 @@ commentTree.init = function () { return count[0]; }, isModerateEnabled: function () { - return this.comment.cid && (user.is_admin || (user.is_moderator && !this.archived)); + return this.comment.cid && (user.is_admin || (user.is_moderator && this.commentAllowed)); }, isReplyEnabled: function () { - return !this.archived && !this.comment.isPreview; + return this.commentAllowed && !this.comment.isPreview; }, isSignatureVisible: function () { return !userConfig.hide_signature && this.comment.signature; diff --git a/src/newslash_web/templates/common/comment/comment_header.html.tt2 b/src/newslash_web/templates/common/comment/comment_header.html.tt2 index abde023f..eda0a1f3 100644 --- a/src/newslash_web/templates/common/comment/comment_header.html.tt2 +++ b/src/newslash_web/templates/common/comment/comment_header.html.tt2 @@ -2,11 +2,14 @@
この議論は賞味期限が切れたので、アーカイブ化されています。 新たにコメントを付けることはできません。
+
+ 設定によりコメント投稿は許可されていません。 +
[%# %] - +