summaryrefslogtreecommitdiffstats
path: root/client/components/users/userHeader.js
diff options
context:
space:
mode:
authorRomulus Tsai 蔡仲明 <urakagi@gmail.com>2020-05-08 10:13:11 +0800
committerRomulus Tsai 蔡仲明 <urakagi@gmail.com>2020-05-08 10:13:11 +0800
commitc3458855bdb52c976ee6689ad5a0d4e92e96f2e3 (patch)
treed9dbbcc3087b5bfc520710b5f5624a3f4e2b78e6 /client/components/users/userHeader.js
parent444848876759173ad80203129250d2f0311f30fc (diff)
parentcfcc73724fcd394150d1b815d0a7a4c466e216b5 (diff)
downloadwekan-c3458855bdb52c976ee6689ad5a0d4e92e96f2e3.tar.gz
wekan-c3458855bdb52c976ee6689ad5a0d4e92e96f2e3.tar.bz2
wekan-c3458855bdb52c976ee6689ad5a0d4e92e96f2e3.zip
Merge branch 'master' into lib-change
Diffstat (limited to 'client/components/users/userHeader.js')
-rw-r--r--client/components/users/userHeader.js40
1 files changed, 37 insertions, 3 deletions
diff --git a/client/components/users/userHeader.js b/client/components/users/userHeader.js
index 847d30fb..b7bb284e 100644
--- a/client/components/users/userHeader.js
+++ b/client/components/users/userHeader.js
@@ -166,6 +166,8 @@ Template.changeLanguagePopup.helpers({
name = 'Igbo';
} else if (lang.name === 'oc') {
name = 'Occitan';
+ } else if (lang.name === '繁体中文(台湾)') {
+ name = '繁體中文(台灣)';
}
return { tag, name };
}).sort(function(a, b) {
@@ -222,6 +224,27 @@ Template.changeSettingsPopup.helpers({
return cookies.get('limitToShowCardsCount');
}
},
+ weekDays(startDay) {
+ return [
+ TAPi18n.__('sunday'),
+ TAPi18n.__('monday'),
+ TAPi18n.__('tuesday'),
+ TAPi18n.__('wednesday'),
+ TAPi18n.__('thursday'),
+ TAPi18n.__('friday'),
+ TAPi18n.__('saturday'),
+ ].map(function(day, index) {
+ return { name: day, value: index, isSelected: index === startDay };
+ });
+ },
+ startDayOfWeek() {
+ currentUser = Meteor.user();
+ if (currentUser) {
+ return currentUser.getStartDayOfWeek();
+ } else {
+ return cookies.get('startDayOfWeek');
+ }
+ },
});
Template.changeSettingsPopup.events({
@@ -245,20 +268,31 @@ Template.changeSettingsPopup.events({
cookies.set('hasHiddenSystemMessages', 'true');
}
},
- 'click .js-apply-show-cards-at'(event, templateInstance) {
+ 'click .js-apply-user-settings'(event, templateInstance) {
event.preventDefault();
const minLimit = parseInt(
templateInstance.$('#show-cards-count-at').val(),
10,
);
+ const startDay = parseInt(
+ templateInstance.$('#start-day-of-week').val(),
+ 10,
+ );
+ const currentUser = Meteor.user();
if (!isNaN(minLimit)) {
- currentUser = Meteor.user();
if (currentUser) {
Meteor.call('changeLimitToShowCardsCount', minLimit);
} else {
cookies.set('limitToShowCardsCount', minLimit);
}
- Popup.back();
}
+ if (!isNaN(startDay)) {
+ if (currentUser) {
+ Meteor.call('changeStartDayOfWeek', startDay);
+ } else {
+ cookies.set('startDayOfWeek', startDay);
+ }
+ }
+ Popup.back();
},
});