mirror of
https://github.com/wassname/talk.git
synced 2026-07-04 08:46:13 +08:00
Merge branch 'master' into like-login-prompt
This commit is contained in:
@@ -56,12 +56,14 @@ hr {
|
||||
|
||||
/* Info Box Styles */
|
||||
.coral-plugin-infobox-info {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
border: 0;
|
||||
background: rgb(105,105,105);
|
||||
color: white;
|
||||
border-radius: 2px;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
padding: 10px;
|
||||
margin-bottom: 10px;
|
||||
font-weight: bold;
|
||||
display: block;
|
||||
}
|
||||
|
||||
+4
-5
@@ -38,12 +38,11 @@ SettingSchema.statics.getSettings = function () {
|
||||
};
|
||||
|
||||
/**
|
||||
* Gets the moderation settings and sends it back
|
||||
* Gets the settings visible to the public
|
||||
* @return {Promise} moderation the settings for how to moderate comments
|
||||
*/
|
||||
SettingSchema.statics.getModerationSetting = function () {
|
||||
console.log('Getting moderation setting');
|
||||
return this.findOne({id: '1'}).select('moderation');
|
||||
SettingSchema.statics.getPublicSettings = function () {
|
||||
return this.findOne({id: '1'}).select('moderation infoBoxEnable infoBoxContent');
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -51,7 +50,7 @@ SettingSchema.statics.getModerationSetting = function () {
|
||||
* @return {Promise} content the content of the info Box
|
||||
*/
|
||||
SettingSchema.statics.getInfoBoxSetting = function () {
|
||||
return this.findOne({id: '1'}).select('infoBoxEnable', 'infoBoxContent');
|
||||
return this.findOne({id: '1'}).select('infoBoxEnable infoBoxContent');
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,7 +16,7 @@ const router = express.Router();
|
||||
// Pre-moderation: New comments are shown in the moderator queues immediately.
|
||||
// Post-moderation: New comments do not appear in moderation queues unless they are flagged by other users.
|
||||
router.get('/comments/pending', (req, res, next) => {
|
||||
Setting.getModerationSetting().then(({moderation}) =>
|
||||
Setting.getPublicSettings().then(({moderation}) =>
|
||||
Comment.moderationQueue(moderation))
|
||||
.then((comments) => {
|
||||
return Promise.all([
|
||||
|
||||
@@ -26,8 +26,8 @@ router.get('/', (req, res, next) => {
|
||||
return asset;
|
||||
}),
|
||||
|
||||
// Get the moderation setting from the settings.
|
||||
Setting.getModerationSetting()
|
||||
// Get the public settings.
|
||||
Setting.getPublicSettings()
|
||||
])
|
||||
.then(([asset, settings]) => {
|
||||
|
||||
|
||||
@@ -4,7 +4,9 @@ const expect = require('chai').expect;
|
||||
describe('Setting: model', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
const defaults = {id: 1};
|
||||
const defaults = {
|
||||
id: 1
|
||||
};
|
||||
return Setting.update({id: '1'}, {$setOnInsert: defaults}, {upsert: true});
|
||||
});
|
||||
|
||||
@@ -35,10 +37,13 @@ describe('Setting: model', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('#getModerationSetting', () => {
|
||||
describe('#getPublicSettings', () => {
|
||||
it('should return the moderation settings', () => {
|
||||
return Setting.getModerationSetting().then(({moderation}) => {
|
||||
return Setting.getPublicSettings().then(({moderation, infoBoxEnable, infoBoxContent, wordlist}) => {
|
||||
expect(moderation).not.to.be.null;
|
||||
expect(infoBoxEnable).not.to.be.null;
|
||||
expect(infoBoxContent).not.to.be.null;
|
||||
expect(wordlist).to.be.undefined;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user