summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.eslintrc.json2
-rw-r--r--client/components/main/header.js8
-rw-r--r--client/components/settings/settingBody.jade20
-rw-r--r--client/components/settings/settingBody.js22
-rw-r--r--client/components/settings/settingBody.styl2
-rw-r--r--i18n/en.i18n.json6
-rw-r--r--models/announcements.js (renamed from models/notices.js)12
-rw-r--r--server/publications/announcements.js3
-rw-r--r--server/publications/notices.js3
9 files changed, 39 insertions, 39 deletions
diff --git a/.eslintrc.json b/.eslintrc.json
index 2a55dcc3..b93dd916 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -131,6 +131,6 @@
"Integrations": true,
"HTTP": true,
"AccountSettings": true,
- "Notices": true
+ "Announcements": true
}
}
diff --git a/client/components/main/header.js b/client/components/main/header.js
index 3b724651..c8f415df 100644
--- a/client/components/main/header.js
+++ b/client/components/main/header.js
@@ -12,14 +12,14 @@ Template.header.helpers({
},
hasAnnouncement() {
- const notice = Notices.findOne();
- return notice && notice.enabled;
+ const announcements = Announcements.findOne();
+ return announcements && announcements.enabled;
},
announcement() {
$('.announcement').show();
- const notice = Notices.findOne();
- return notice && notice.body;
+ const announcements = Announcements.findOne();
+ return announcements && announcements.body;
},
});
diff --git a/client/components/settings/settingBody.jade b/client/components/settings/settingBody.jade
index a3b534f4..2152cc2c 100644
--- a/client/components/settings/settingBody.jade
+++ b/client/components/settings/settingBody.jade
@@ -15,7 +15,7 @@ template(name="setting")
li
a.js-setting-menu(data-id="account-setting") {{_ 'accounts'}}
li
- a.js-setting-menu(data-id="notice-setting") {{_ 'admin-notice'}}
+ a.js-setting-menu(data-id="announcement-setting") {{_ 'admin-announcement'}}
.main-body
if loading.get
+spinner
@@ -25,8 +25,8 @@ template(name="setting")
+email
else if accountSetting.get
+accountSettings
- else if noticeSetting.get
- +administratorNoticeSettings
+ else if announcementSetting.get
+ +announcementSettings
template(name="general")
ul#registration-setting.setting-detail
@@ -101,18 +101,18 @@ template(name='accountSettings')
li
button.js-accounts-save.primary {{_ 'save'}}
-template(name='administratorNoticeSettings')
- ul#notice-setting.setting-detail
+template(name='announcementSettings')
+ ul#announcement-setting.setting-detail
li
a.flex.js-toggle-activemessage
.materialCheckBox(class="{{#if currentSetting.enabled}}is-checked{{/if}}")
- span {{_ 'admin-notice-active'}}
+ span {{_ 'admin-announcement-active'}}
li
- .admin-notice(class="{{#if currentSetting.enabled}}{{else}}hide{{/if}}")
+ .admin-announcement(class="{{#if currentSetting.enabled}}{{else}}hide{{/if}}")
ul
li
- .title {{_ 'admin-notice-title'}}
- textarea#admin-notice.form-control= currentSetting.body
+ .title {{_ 'admin-announcement-title'}}
+ textarea#admin-announcement.form-control= currentSetting.body
li
- button.js-notice-save.primary {{_ 'save'}}
+ button.js-announcement-save.primary {{_ 'save'}}
diff --git a/client/components/settings/settingBody.js b/client/components/settings/settingBody.js
index 38213828..27f690ee 100644
--- a/client/components/settings/settingBody.js
+++ b/client/components/settings/settingBody.js
@@ -1,7 +1,7 @@
Meteor.subscribe('setting');
Meteor.subscribe('mailServer');
Meteor.subscribe('accountSettings');
-Meteor.subscribe('notices');
+Meteor.subscribe('announcements');
BlazeComponent.extendComponent({
onCreated() {
@@ -10,7 +10,7 @@ BlazeComponent.extendComponent({
this.generalSetting = new ReactiveVar(true);
this.emailSetting = new ReactiveVar(false);
this.accountSetting = new ReactiveVar(false);
- this.noticeSetting = new ReactiveVar(false);
+ this.announcementSetting = new ReactiveVar(false);
},
setError(error) {
@@ -67,7 +67,7 @@ BlazeComponent.extendComponent({
this.generalSetting.set('registration-setting' === targetID);
this.emailSetting.set('email-setting' === targetID);
this.accountSetting.set('account-setting' === targetID);
- this.noticeSetting.set('notice-setting' === targetID);
+ this.announcementSetting.set('announcement-setting' === targetID);
}
},
@@ -166,12 +166,12 @@ BlazeComponent.extendComponent({
},
currentSetting(){
- return Notices.findOne();
+ return Announcements.findOne();
},
saveMessage() {
- const message = $('#admin-notice').val().trim();
- Notices.update(Notices.findOne()._id, {
+ const message = $('#admin-announcement').val().trim();
+ Announcements.update(Announcements.findOne()._id, {
$set: { 'body': message },
});
},
@@ -179,21 +179,21 @@ BlazeComponent.extendComponent({
toggleActive(){
this.setLoading(true);
const isActive = this.currentSetting().enabled;
- Notices.update(Notices.findOne()._id, {
+ Announcements.update(Announcements.findOne()._id, {
$set:{ 'enabled': !isActive},
});
this.setLoading(false);
if(isActive){
- $('.admin-notice').slideUp();
+ $('.admin-announcement').slideUp();
}else{
- $('.admin-notice').slideDown();
+ $('.admin-announcement').slideDown();
}
},
events() {
return [{
'click a.js-toggle-activemessage': this.toggleActive,
- 'click button.js-notice-save': this.saveMessage,
+ 'click button.js-announcement-save': this.saveMessage,
}];
},
-}).register('administratorNoticeSettings');
+}).register('announcementSettings');
diff --git a/client/components/settings/settingBody.styl b/client/components/settings/settingBody.styl
index d28ae268..fec64cee 100644
--- a/client/components/settings/settingBody.styl
+++ b/client/components/settings/settingBody.styl
@@ -65,7 +65,7 @@
span
padding: 0 0.5rem
- .admin-notice,
+ .admin-announcement,
.invite-people
padding-left 20px;
li
diff --git a/i18n/en.i18n.json b/i18n/en.i18n.json
index a87c45e5..a33d55d1 100644
--- a/i18n/en.i18n.json
+++ b/i18n/en.i18n.json
@@ -54,9 +54,9 @@
"addMemberPopup-title": "Members",
"admin": "Admin",
"admin-desc": "Can view and edit cards, remove members, and change settings for the board.",
- "admin-notice": "Notice",
- "admin-notice-active": "Active message",
- "admin-notice-title": "Message from service administrator",
+ "admin-announcement": "Announcement",
+ "admin-announcement-active": "Active System-Wide Announcement",
+ "admin-announcement-title": "Announcement from Administrator",
"all-boards": "All boards",
"and-n-other-card": "And __count__ other card",
"and-n-other-card_plural": "And __count__ other cards",
diff --git a/models/notices.js b/models/announcements.js
index d62f6797..2cb1e1b7 100644
--- a/models/notices.js
+++ b/models/announcements.js
@@ -1,6 +1,6 @@
-Notices = new Mongo.Collection('notices');
+Announcements = new Mongo.Collection('announcements');
-Notices.attachSchema(new SimpleSchema({
+Announcements.attachSchema(new SimpleSchema({
enabled: {
type: Boolean,
defaultValue: false,
@@ -19,7 +19,7 @@ Notices.attachSchema(new SimpleSchema({
},
}));
-Notices.allow({
+Announcements.allow({
update(userId) {
const user = Users.findOne(userId);
return user && user.isAdmin;
@@ -28,9 +28,9 @@ Notices.allow({
if (Meteor.isServer) {
Meteor.startup(() => {
- const notices = Notices.findOne({});
- if(!notices){
- Notices.insert({enabled: false, sort: 0});
+ const announcements = Announcements.findOne({});
+ if(!announcements){
+ Announcements.insert({enabled: false, sort: 0});
}
});
}
diff --git a/server/publications/announcements.js b/server/publications/announcements.js
new file mode 100644
index 00000000..efebf640
--- /dev/null
+++ b/server/publications/announcements.js
@@ -0,0 +1,3 @@
+Meteor.publish('announcements', function() {
+ return Announcements.find();
+});
diff --git a/server/publications/notices.js b/server/publications/notices.js
deleted file mode 100644
index 8910d740..00000000
--- a/server/publications/notices.js
+++ /dev/null
@@ -1,3 +0,0 @@
-Meteor.publish('notices', function() {
- return Notices.find();
-});