mirror of
https://github.com/wekan/wekan.git
synced 2025-09-22 01:50:48 +02:00
Rename notice -> announcement
This commit is contained in:
parent
aa1876f94c
commit
a88ac6113e
9 changed files with 39 additions and 39 deletions
|
@ -131,6 +131,6 @@
|
||||||
"Integrations": true,
|
"Integrations": true,
|
||||||
"HTTP": true,
|
"HTTP": true,
|
||||||
"AccountSettings": true,
|
"AccountSettings": true,
|
||||||
"Notices": true
|
"Announcements": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,14 +12,14 @@ Template.header.helpers({
|
||||||
},
|
},
|
||||||
|
|
||||||
hasAnnouncement() {
|
hasAnnouncement() {
|
||||||
const notice = Notices.findOne();
|
const announcements = Announcements.findOne();
|
||||||
return notice && notice.enabled;
|
return announcements && announcements.enabled;
|
||||||
},
|
},
|
||||||
|
|
||||||
announcement() {
|
announcement() {
|
||||||
$('.announcement').show();
|
$('.announcement').show();
|
||||||
const notice = Notices.findOne();
|
const announcements = Announcements.findOne();
|
||||||
return notice && notice.body;
|
return announcements && announcements.body;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ template(name="setting")
|
||||||
li
|
li
|
||||||
a.js-setting-menu(data-id="account-setting") {{_ 'accounts'}}
|
a.js-setting-menu(data-id="account-setting") {{_ 'accounts'}}
|
||||||
li
|
li
|
||||||
a.js-setting-menu(data-id="notice-setting") {{_ 'admin-notice'}}
|
a.js-setting-menu(data-id="announcement-setting") {{_ 'admin-announcement'}}
|
||||||
.main-body
|
.main-body
|
||||||
if loading.get
|
if loading.get
|
||||||
+spinner
|
+spinner
|
||||||
|
@ -25,8 +25,8 @@ template(name="setting")
|
||||||
+email
|
+email
|
||||||
else if accountSetting.get
|
else if accountSetting.get
|
||||||
+accountSettings
|
+accountSettings
|
||||||
else if noticeSetting.get
|
else if announcementSetting.get
|
||||||
+administratorNoticeSettings
|
+announcementSettings
|
||||||
|
|
||||||
template(name="general")
|
template(name="general")
|
||||||
ul#registration-setting.setting-detail
|
ul#registration-setting.setting-detail
|
||||||
|
@ -101,18 +101,18 @@ template(name='accountSettings')
|
||||||
li
|
li
|
||||||
button.js-accounts-save.primary {{_ 'save'}}
|
button.js-accounts-save.primary {{_ 'save'}}
|
||||||
|
|
||||||
template(name='administratorNoticeSettings')
|
template(name='announcementSettings')
|
||||||
ul#notice-setting.setting-detail
|
ul#announcement-setting.setting-detail
|
||||||
li
|
li
|
||||||
a.flex.js-toggle-activemessage
|
a.flex.js-toggle-activemessage
|
||||||
.materialCheckBox(class="{{#if currentSetting.enabled}}is-checked{{/if}}")
|
.materialCheckBox(class="{{#if currentSetting.enabled}}is-checked{{/if}}")
|
||||||
|
|
||||||
span {{_ 'admin-notice-active'}}
|
span {{_ 'admin-announcement-active'}}
|
||||||
li
|
li
|
||||||
.admin-notice(class="{{#if currentSetting.enabled}}{{else}}hide{{/if}}")
|
.admin-announcement(class="{{#if currentSetting.enabled}}{{else}}hide{{/if}}")
|
||||||
ul
|
ul
|
||||||
li
|
li
|
||||||
.title {{_ 'admin-notice-title'}}
|
.title {{_ 'admin-announcement-title'}}
|
||||||
textarea#admin-notice.form-control= currentSetting.body
|
textarea#admin-announcement.form-control= currentSetting.body
|
||||||
li
|
li
|
||||||
button.js-notice-save.primary {{_ 'save'}}
|
button.js-announcement-save.primary {{_ 'save'}}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
Meteor.subscribe('setting');
|
Meteor.subscribe('setting');
|
||||||
Meteor.subscribe('mailServer');
|
Meteor.subscribe('mailServer');
|
||||||
Meteor.subscribe('accountSettings');
|
Meteor.subscribe('accountSettings');
|
||||||
Meteor.subscribe('notices');
|
Meteor.subscribe('announcements');
|
||||||
|
|
||||||
BlazeComponent.extendComponent({
|
BlazeComponent.extendComponent({
|
||||||
onCreated() {
|
onCreated() {
|
||||||
|
@ -10,7 +10,7 @@ BlazeComponent.extendComponent({
|
||||||
this.generalSetting = new ReactiveVar(true);
|
this.generalSetting = new ReactiveVar(true);
|
||||||
this.emailSetting = new ReactiveVar(false);
|
this.emailSetting = new ReactiveVar(false);
|
||||||
this.accountSetting = new ReactiveVar(false);
|
this.accountSetting = new ReactiveVar(false);
|
||||||
this.noticeSetting = new ReactiveVar(false);
|
this.announcementSetting = new ReactiveVar(false);
|
||||||
},
|
},
|
||||||
|
|
||||||
setError(error) {
|
setError(error) {
|
||||||
|
@ -67,7 +67,7 @@ BlazeComponent.extendComponent({
|
||||||
this.generalSetting.set('registration-setting' === targetID);
|
this.generalSetting.set('registration-setting' === targetID);
|
||||||
this.emailSetting.set('email-setting' === targetID);
|
this.emailSetting.set('email-setting' === targetID);
|
||||||
this.accountSetting.set('account-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(){
|
currentSetting(){
|
||||||
return Notices.findOne();
|
return Announcements.findOne();
|
||||||
},
|
},
|
||||||
|
|
||||||
saveMessage() {
|
saveMessage() {
|
||||||
const message = $('#admin-notice').val().trim();
|
const message = $('#admin-announcement').val().trim();
|
||||||
Notices.update(Notices.findOne()._id, {
|
Announcements.update(Announcements.findOne()._id, {
|
||||||
$set: { 'body': message },
|
$set: { 'body': message },
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -179,21 +179,21 @@ BlazeComponent.extendComponent({
|
||||||
toggleActive(){
|
toggleActive(){
|
||||||
this.setLoading(true);
|
this.setLoading(true);
|
||||||
const isActive = this.currentSetting().enabled;
|
const isActive = this.currentSetting().enabled;
|
||||||
Notices.update(Notices.findOne()._id, {
|
Announcements.update(Announcements.findOne()._id, {
|
||||||
$set:{ 'enabled': !isActive},
|
$set:{ 'enabled': !isActive},
|
||||||
});
|
});
|
||||||
this.setLoading(false);
|
this.setLoading(false);
|
||||||
if(isActive){
|
if(isActive){
|
||||||
$('.admin-notice').slideUp();
|
$('.admin-announcement').slideUp();
|
||||||
}else{
|
}else{
|
||||||
$('.admin-notice').slideDown();
|
$('.admin-announcement').slideDown();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
events() {
|
events() {
|
||||||
return [{
|
return [{
|
||||||
'click a.js-toggle-activemessage': this.toggleActive,
|
'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');
|
||||||
|
|
|
@ -65,7 +65,7 @@
|
||||||
span
|
span
|
||||||
padding: 0 0.5rem
|
padding: 0 0.5rem
|
||||||
|
|
||||||
.admin-notice,
|
.admin-announcement,
|
||||||
.invite-people
|
.invite-people
|
||||||
padding-left 20px;
|
padding-left 20px;
|
||||||
li
|
li
|
||||||
|
|
|
@ -54,9 +54,9 @@
|
||||||
"addMemberPopup-title": "Members",
|
"addMemberPopup-title": "Members",
|
||||||
"admin": "Admin",
|
"admin": "Admin",
|
||||||
"admin-desc": "Can view and edit cards, remove members, and change settings for the board.",
|
"admin-desc": "Can view and edit cards, remove members, and change settings for the board.",
|
||||||
"admin-notice": "Notice",
|
"admin-announcement": "Announcement",
|
||||||
"admin-notice-active": "Active message",
|
"admin-announcement-active": "Active System-Wide Announcement",
|
||||||
"admin-notice-title": "Message from service administrator",
|
"admin-announcement-title": "Announcement from Administrator",
|
||||||
"all-boards": "All boards",
|
"all-boards": "All boards",
|
||||||
"and-n-other-card": "And __count__ other card",
|
"and-n-other-card": "And __count__ other card",
|
||||||
"and-n-other-card_plural": "And __count__ other cards",
|
"and-n-other-card_plural": "And __count__ other cards",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
Notices = new Mongo.Collection('notices');
|
Announcements = new Mongo.Collection('announcements');
|
||||||
|
|
||||||
Notices.attachSchema(new SimpleSchema({
|
Announcements.attachSchema(new SimpleSchema({
|
||||||
enabled: {
|
enabled: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
defaultValue: false,
|
defaultValue: false,
|
||||||
|
@ -19,7 +19,7 @@ Notices.attachSchema(new SimpleSchema({
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
Notices.allow({
|
Announcements.allow({
|
||||||
update(userId) {
|
update(userId) {
|
||||||
const user = Users.findOne(userId);
|
const user = Users.findOne(userId);
|
||||||
return user && user.isAdmin;
|
return user && user.isAdmin;
|
||||||
|
@ -28,9 +28,9 @@ Notices.allow({
|
||||||
|
|
||||||
if (Meteor.isServer) {
|
if (Meteor.isServer) {
|
||||||
Meteor.startup(() => {
|
Meteor.startup(() => {
|
||||||
const notices = Notices.findOne({});
|
const announcements = Announcements.findOne({});
|
||||||
if(!notices){
|
if(!announcements){
|
||||||
Notices.insert({enabled: false, sort: 0});
|
Announcements.insert({enabled: false, sort: 0});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
3
server/publications/announcements.js
Normal file
3
server/publications/announcements.js
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
Meteor.publish('announcements', function() {
|
||||||
|
return Announcements.find();
|
||||||
|
});
|
|
@ -1,3 +0,0 @@
|
||||||
Meteor.publish('notices', function() {
|
|
||||||
return Notices.find();
|
|
||||||
});
|
|
Loading…
Add table
Add a link
Reference in a new issue