From 29d54f46aa79a5f3fe067717fa418092e150eb47 Mon Sep 17 00:00:00 2001 From: Thuan Pham Quoc Date: Tue, 7 Nov 2017 14:01:27 +0700 Subject: Added people list in admin panel , just raw data right now, will add more features soon --- client/components/settings/peopleBody.jade | 36 +++++++++++++++++++++++++++ client/components/settings/peopleBody.js | 26 +++++++++++++++++++ client/components/settings/peopleBody.styl | 12 +++++++++ client/components/settings/settingHeader.jade | 9 ++++--- 4 files changed, 79 insertions(+), 4 deletions(-) create mode 100644 client/components/settings/peopleBody.jade create mode 100644 client/components/settings/peopleBody.js create mode 100644 client/components/settings/peopleBody.styl (limited to 'client') diff --git a/client/components/settings/peopleBody.jade b/client/components/settings/peopleBody.jade new file mode 100644 index 00000000..726cc5ed --- /dev/null +++ b/client/components/settings/peopleBody.jade @@ -0,0 +1,36 @@ +template(name="people") + .setting-content + unless currentUser.isAdmin + | {{_ 'error-notAuthorized'}} + else + .content-title + span {{_ 'people'}} + .content-body + .side-menu + ul + li.active + a.js-setting-menu(data-id="people-setting") {{_ 'people'}} + .main-body + if loading.get + +spinner + else if people.get + +peopleGeneral + +template(name="peopleGeneral") + table + tbody + each user in peopleList + tr + th {{_ 'username'}} + th {{_ 'fullname'}} + th {{_ 'isAdmin'}} + th {{_ 'email'}} + th {{_ 'verified'}} + th {{_ 'createdAt'}} + tr + td {{ user.username }} + td {{ user.profile.fullname }} + td {{ user.isAdmin }} + td {{ user.emails.[0].address }} + td {{ user.emails.[0].verified }} + td {{ user.createdAt }} diff --git a/client/components/settings/peopleBody.js b/client/components/settings/peopleBody.js new file mode 100644 index 00000000..058cb8d5 --- /dev/null +++ b/client/components/settings/peopleBody.js @@ -0,0 +1,26 @@ +Meteor.subscribe('people'); + +BlazeComponent.extendComponent({ + onCreated() { + this.error = new ReactiveVar(''); + this.loading = new ReactiveVar(false); + this.people = new ReactiveVar(true); + }, + + setError(error) { + this.error.set(error); + }, + + setLoading(w) { + this.loading.set(w); + }, + + peopleList() { + this.users = Users.find({}); + + this.users.forEach((user) => { + console.log(JSON.stringify(user)); + }); + return this.users; + }, +}).register('people'); diff --git a/client/components/settings/peopleBody.styl b/client/components/settings/peopleBody.styl new file mode 100644 index 00000000..dc3210ad --- /dev/null +++ b/client/components/settings/peopleBody.styl @@ -0,0 +1,12 @@ +table + font-family: arial, sans-serif; + border-collapse: collapse; + width: 100%; + + td, th + border: 1px solid #d2d0d0; + text-align: left; + padding: 8px; + + tr:nth-child(even) + background-color: #dddddd; diff --git a/client/components/settings/settingHeader.jade b/client/components/settings/settingHeader.jade index c22cf5c6..e9ea218a 100644 --- a/client/components/settings/settingHeader.jade +++ b/client/components/settings/settingHeader.jade @@ -9,13 +9,14 @@ template(name="settingHeaderBar") a.setting-header-btn.settings(href="{{pathFor 'setting'}}") i.fa(class="fa-cog") span {{_ 'settings'}} + a.setting-header-btn.informations(href="{{pathFor 'information'}}") i.fa(class="fa-info-circle") span {{_ 'info'}} -//TODO -// a.setting-header-btn.people -// i.fa(class="fa-users") -// span {{_ 'people'}} + + a.setting-header-btn.people(href="{{pathFor 'people'}}") + i.fa(class="fa-users") + span {{_ 'people'}} else a.setting-header-btn.js-log-in( -- cgit v1.2.3-1-g7c22 From 1f6545e411fbe98fc1a0b1d5361c7a2bcc74056a Mon Sep 17 00:00:00 2001 From: Thuan Pham Quoc Date: Tue, 7 Nov 2017 22:26:21 +0700 Subject: Added edit user from admin panel --- client/components/settings/peopleBody.jade | 76 ++++++++++++++++++---- client/components/settings/peopleBody.js | 101 ++++++++++++++++++++++++++--- 2 files changed, 155 insertions(+), 22 deletions(-) (limited to 'client') diff --git a/client/components/settings/peopleBody.jade b/client/components/settings/peopleBody.jade index 726cc5ed..3ed2e4c8 100644 --- a/client/components/settings/peopleBody.jade +++ b/client/components/settings/peopleBody.jade @@ -19,18 +19,66 @@ template(name="people") template(name="peopleGeneral") table tbody + tr + th {{_ 'username'}} + th {{_ 'fullname'}} + th {{_ 'isAdmin'}} + th {{_ 'email'}} + th {{_ 'verified'}} + th {{_ 'createdAt'}} + th {{_ 'active'}} + th each user in peopleList - tr - th {{_ 'username'}} - th {{_ 'fullname'}} - th {{_ 'isAdmin'}} - th {{_ 'email'}} - th {{_ 'verified'}} - th {{_ 'createdAt'}} - tr - td {{ user.username }} - td {{ user.profile.fullname }} - td {{ user.isAdmin }} - td {{ user.emails.[0].address }} - td {{ user.emails.[0].verified }} - td {{ user.createdAt }} + +peopleRow(userId=user._id) + +template(name="peopleRow") + tr + td.username {{ userData.username }} + td {{ userData.profile.fullname }} + td + if userData.isAdmin + | true + else + | false + td {{ userData.emails.[0].address }} + td + if userData.emails.[0].verified + | true + else + | false + td {{ userData.createdAt }} + td + if userData.active + | true + else + | false + td + a.edit-user + | edit + +template(name="editUserPopup") + form + label.hide.userId(type="text" value=user._id) + label + | {{_ 'fullname'}} + input.js-profile-fullname(type="text" value=user.profile.fullname autofocus) + label + | {{_ 'username'}} + span.error.hide.username-taken + | {{_ 'error-username-taken'}} + input.js-profile-username(type="text" value=user.username) + label + | {{_ 'initials'}} + input.js-profile-initials(type="text" value=user.profile.initials) + label + | {{_ 'email'}} + span.error.hide.email-taken + | {{_ 'error-email-taken'}} + input.js-profile-email(type="email" value="{{user.emails.[0].address}}") + label + | {{_ 'isAdmin'}} + select.select-role.js-profile-isadmin + option(value="false") No + option(value="true" selected="{{user.isAdmin}}") Yes + + input.primary.wide(type="submit" value="{{_ 'save'}}") diff --git a/client/components/settings/peopleBody.js b/client/components/settings/peopleBody.js index 058cb8d5..85376ebb 100644 --- a/client/components/settings/peopleBody.js +++ b/client/components/settings/peopleBody.js @@ -6,21 +6,106 @@ BlazeComponent.extendComponent({ this.loading = new ReactiveVar(false); this.people = new ReactiveVar(true); }, - setError(error) { this.error.set(error); }, - setLoading(w) { this.loading.set(w); }, - peopleList() { - this.users = Users.find({}); - - this.users.forEach((user) => { - console.log(JSON.stringify(user)); + return Users.find({}, { + fields: {_id: true}, }); - return this.users; }, }).register('people'); + +Template.peopleRow.helpers({ + userData() { + const userCollection = this.esSearch ? ESSearchResults : Users; + return userCollection.findOne(this.userId); + }, +}); + +Template.editUserPopup.helpers({ + user() { + return Users.findOne(this.userId); + }, +}); + +BlazeComponent.extendComponent({ + onCreated() { + }, + user() { + return Users.findOne(this.userId); + }, + events() { + return [{ + 'click a.edit-user': Popup.open('editUser'), + }]; + }, +}).register('peopleRow'); + +Template.editUserPopup.events({ + submit(evt, tpl) { + evt.preventDefault(); + const user = Users.findOne(this.userId); + const fullname = tpl.find('.js-profile-fullname').value.trim(); + const username = tpl.find('.js-profile-username').value.trim(); + const initials = tpl.find('.js-profile-initials').value.trim(); + const isAdmin = tpl.find('.js-profile-isadmin').value.trim(); + const email = tpl.find('.js-profile-email').value.trim(); + console.log('isAdmin', isAdmin); + let isChangeUserName = false; + let isChangeEmail = false; + Users.update(this.userId, { + $set: { + 'profile.fullname': fullname, + 'profile.initials': initials, + 'isAdmin': true, + }, + }); + + isChangeUserName = username !== user.username; + isChangeEmail = email.toLowerCase() !== user.emails[0].address.toLowerCase(); + if (isChangeUserName && isChangeEmail) { + Meteor.call('setUsernameAndEmail', username, email.toLowerCase(), function (error) { + const usernameMessageElement = tpl.$('.username-taken'); + const emailMessageElement = tpl.$('.email-taken'); + if (error) { + const errorElement = error.error; + if (errorElement === 'username-already-taken') { + usernameMessageElement.show(); + emailMessageElement.hide(); + } else if (errorElement === 'email-already-taken') { + usernameMessageElement.hide(); + emailMessageElement.show(); + } + } else { + usernameMessageElement.hide(); + emailMessageElement.hide(); + Popup.back(); + } + }); + } else if (isChangeUserName) { + Meteor.call('setUsername', username, function (error) { + const messageElement = tpl.$('.username-taken'); + if (error) { + messageElement.show(); + } else { + messageElement.hide(); + Popup.back(); + } + }); + } else if (isChangeEmail) { + Meteor.call('setEmail', email.toLowerCase(), function (error) { + const messageElement = tpl.$('.email-taken'); + if (error) { + messageElement.show(); + } else { + messageElement.hide(); + Popup.back(); + } + }); + } else Popup.back(); + }, +}); -- cgit v1.2.3-1-g7c22 From 3bead1bf78758e81a97150053c5df8e6be2d6fe1 Mon Sep 17 00:00:00 2001 From: Thuan Pham Quoc Date: Wed, 8 Nov 2017 11:27:59 +0700 Subject: Added pagination to people management in admin panel --- client/components/settings/peopleBody.jade | 13 ++++++---- client/components/settings/peopleBody.js | 38 +++++++++++++++++++++++++++++- client/components/settings/peopleBody.styl | 3 +++ 3 files changed, 49 insertions(+), 5 deletions(-) (limited to 'client') diff --git a/client/components/settings/peopleBody.jade b/client/components/settings/peopleBody.jade index 3ed2e4c8..34004d31 100644 --- a/client/components/settings/peopleBody.jade +++ b/client/components/settings/peopleBody.jade @@ -46,12 +46,12 @@ template(name="peopleRow") | true else | false - td {{ userData.createdAt }} + td {{ moment userData.createdAt 'LLL' }} td - if userData.active - | true - else + if userData.loginDisabled | false + else + | true td a.edit-user | edit @@ -80,5 +80,10 @@ template(name="editUserPopup") select.select-role.js-profile-isadmin option(value="false") No option(value="true" selected="{{user.isAdmin}}") Yes + label + | {{_ 'isActive'}} + select.select-active.js-profile-isactive + option(value="false") Yes + option(value="true" selected="{{user.loginDisabled}}") No input.primary.wide(type="submit" value="{{_ 'save'}}") diff --git a/client/components/settings/peopleBody.js b/client/components/settings/peopleBody.js index 85376ebb..d59dc38b 100644 --- a/client/components/settings/peopleBody.js +++ b/client/components/settings/peopleBody.js @@ -1,10 +1,46 @@ -Meteor.subscribe('people'); +const usersPerPage = 25; BlazeComponent.extendComponent({ + mixins() { + return [Mixins.InfiniteScrolling]; + }, onCreated() { this.error = new ReactiveVar(''); this.loading = new ReactiveVar(false); this.people = new ReactiveVar(true); + + this.page = new ReactiveVar(1); + this.loadNextPageLocked = false; + this.callFirstWith(null, 'resetNextPeak'); + this.autorun(() => { + const limit = this.page.get() * usersPerPage; + + this.subscribe('people', limit, () => { + this.loadNextPageLocked = false; + const nextPeakBefore = this.callFirstWith(null, 'getNextPeak'); + this.calculateNextPeak(); + const nextPeakAfter = this.callFirstWith(null, 'getNextPeak'); + if (nextPeakBefore === nextPeakAfter) { + this.callFirstWith(null, 'resetNextPeak'); + } + }); + }); + }, + loadNextPage() { + if (this.loadNextPageLocked === false) { + this.page.set(this.page.get() + 1); + this.loadNextPageLocked = true; + } + }, + calculateNextPeak() { + const element = this.find('.main-body'); + if (element) { + const altitude = element.scrollHeight; + this.callFirstWith(this, 'setNextPeak', altitude); + } + }, + reachNextPeak() { + this.loadNextPage(); }, setError(error) { this.error.set(error); diff --git a/client/components/settings/peopleBody.styl b/client/components/settings/peopleBody.styl index dc3210ad..2e89ea3b 100644 --- a/client/components/settings/peopleBody.styl +++ b/client/components/settings/peopleBody.styl @@ -1,3 +1,6 @@ +.main-body + overflow: scroll; + table font-family: arial, sans-serif; border-collapse: collapse; -- cgit v1.2.3-1-g7c22 From e3b7f85cc35b650e72259909608237ea0347a7fb Mon Sep 17 00:00:00 2001 From: Thuan Pham Quoc Date: Wed, 8 Nov 2017 11:34:05 +0700 Subject: Updated users methods to get user id from client on updating user data, is aimed to support admin update other user profile --- client/components/users/userHeader.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'client') diff --git a/client/components/users/userHeader.js b/client/components/users/userHeader.js index 90205ee1..481b13c3 100644 --- a/client/components/users/userHeader.js +++ b/client/components/users/userHeader.js @@ -42,7 +42,7 @@ Template.editProfilePopup.events({ isChangeUserName = username !== Meteor.user().username; isChangeEmail = email.toLowerCase() !== Meteor.user().emails[0].address.toLowerCase(); if (isChangeUserName && isChangeEmail) { - Meteor.call('setUsernameAndEmail', username, email.toLowerCase(), function(error) { + Meteor.call('setUsernameAndEmail', username, email.toLowerCase(), Meteor.userId(), function (error) { const usernameMessageElement = tpl.$('.username-taken'); const emailMessageElement = tpl.$('.email-taken'); if (error) { @@ -61,7 +61,7 @@ Template.editProfilePopup.events({ } }); } else if (isChangeUserName) { - Meteor.call('setUsername', username, function(error) { + Meteor.call('setUsername', username, Meteor.userId(), function (error) { const messageElement = tpl.$('.username-taken'); if (error) { messageElement.show(); @@ -71,7 +71,7 @@ Template.editProfilePopup.events({ } }); } else if (isChangeEmail) { - Meteor.call('setEmail', email.toLowerCase(), function(error) { + Meteor.call('setEmail', email.toLowerCase(), Meteor.userId(), function (error) { const messageElement = tpl.$('.email-taken'); if (error) { messageElement.show(); @@ -105,7 +105,7 @@ Template.editNotificationPopup.events({ // XXX For some reason the useraccounts autofocus isnt working in this case. // See https://github.com/meteor-useraccounts/core/issues/384 -Template.changePasswordPopup.onRendered(function() { +Template.changePasswordPopup.onRendered(function () { this.find('#at-field-current_password').focus(); }); @@ -116,7 +116,7 @@ Template.changeLanguagePopup.helpers({ tag: code, name: lang.name === 'br' ? 'Brezhoneg' : lang.name, }; - }).sort(function(a, b) { + }).sort(function (a, b) { if (a.name === b.name) { return 0; } else { -- cgit v1.2.3-1-g7c22 From fa1d8cd5ef0834f882e6d34d356d5fea55eb6ea1 Mon Sep 17 00:00:00 2001 From: Thuan Pham Quoc Date: Wed, 8 Nov 2017 11:34:37 +0700 Subject: Added update all user profile from admin panel --- client/components/settings/peopleBody.js | 39 ++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 15 deletions(-) (limited to 'client') diff --git a/client/components/settings/peopleBody.js b/client/components/settings/peopleBody.js index d59dc38b..d0da60d0 100644 --- a/client/components/settings/peopleBody.js +++ b/client/components/settings/peopleBody.js @@ -89,22 +89,25 @@ Template.editUserPopup.events({ const username = tpl.find('.js-profile-username').value.trim(); const initials = tpl.find('.js-profile-initials').value.trim(); const isAdmin = tpl.find('.js-profile-isadmin').value.trim(); + const isActive = tpl.find('.js-profile-isactive').value.trim(); const email = tpl.find('.js-profile-email').value.trim(); - console.log('isAdmin', isAdmin); let isChangeUserName = false; let isChangeEmail = false; + Users.update(this.userId, { $set: { 'profile.fullname': fullname, 'profile.initials': initials, - 'isAdmin': true, + 'isAdmin': isAdmin === 'true', + 'loginDisabled': isActive === 'true', }, }); isChangeUserName = username !== user.username; isChangeEmail = email.toLowerCase() !== user.emails[0].address.toLowerCase(); + if (isChangeUserName && isChangeEmail) { - Meteor.call('setUsernameAndEmail', username, email.toLowerCase(), function (error) { + Meteor.call('setUsernameAndEmail', username, email.toLowerCase(), this.userId, function (error) { const usernameMessageElement = tpl.$('.username-taken'); const emailMessageElement = tpl.$('.email-taken'); if (error) { @@ -119,29 +122,35 @@ Template.editUserPopup.events({ } else { usernameMessageElement.hide(); emailMessageElement.hide(); - Popup.back(); + Popup.close(); } }); } else if (isChangeUserName) { - Meteor.call('setUsername', username, function (error) { - const messageElement = tpl.$('.username-taken'); + Meteor.call('setUsername', username, this.userId, function (error) { + const usernameMessageElement = tpl.$('.username-taken'); if (error) { - messageElement.show(); + const errorElement = error.error; + if (errorElement === 'username-already-taken') { + usernameMessageElement.show(); + } } else { - messageElement.hide(); - Popup.back(); + usernameMessageElement.hide(); + Popup.close(); } }); } else if (isChangeEmail) { - Meteor.call('setEmail', email.toLowerCase(), function (error) { - const messageElement = tpl.$('.email-taken'); + Meteor.call('setEmail', email.toLowerCase(), this.userId, function (error) { + const emailMessageElement = tpl.$('.email-taken'); if (error) { - messageElement.show(); + const errorElement = error.error; + if (errorElement === 'email-already-taken') { + emailMessageElement.show(); + } } else { - messageElement.hide(); - Popup.back(); + emailMessageElement.hide(); + Popup.close(); } }); - } else Popup.back(); + } else Popup.close(); }, }); -- cgit v1.2.3-1-g7c22 From 309c1d08ff2537342765d471e7b680d23cdb1aed Mon Sep 17 00:00:00 2001 From: Brooks Becton Date: Tue, 14 Nov 2017 20:41:05 -0600 Subject: Added markdown support to card-titles, minicard-titles, checklist title, and checklist items --- client/components/cards/cardDetails.jade | 7 ++++--- client/components/cards/cardDetails.js | 2 +- client/components/cards/checklists.jade | 16 ++++++++++++---- client/components/cards/checklists.js | 2 +- client/components/cards/minicard.jade | 4 +++- 5 files changed, 21 insertions(+), 10 deletions(-) (limited to 'client') diff --git a/client/components/cards/cardDetails.jade b/client/components/cards/cardDetails.jade index ce93d6fd..b6572251 100644 --- a/client/components/cards/cardDetails.jade +++ b/client/components/cards/cardDetails.jade @@ -9,9 +9,10 @@ template(name="cardDetails") a.fa.fa-navicon.card-details-menu.js-open-card-details-menu h2.card-details-title.js-card-title( class="{{#if canModifyCard}}js-open-inlined-form is-editable{{/if}}") - = title - if isWatching - i.fa.fa-eye.card-details-watch + +viewer + = title + if isWatching + i.fa.fa-eye.card-details-watch if archived p.warning {{_ 'card-archived'}} diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js index 836a2353..1fd8e205 100644 --- a/client/components/cards/cardDetails.js +++ b/client/components/cards/cardDetails.js @@ -197,7 +197,7 @@ Template.editCardTitleForm.onRendered(function () { Template.editCardTitleForm.events({ 'keydown .js-edit-card-title' (evt) { // If enter key was pressed, submit the data - if (evt.keyCode === 13) { + if (evt.keyCode === 13 && !event.shiftKey) { $('.js-submit-edit-card-title-form').click(); } }, diff --git a/client/components/cards/checklists.jade b/client/components/cards/checklists.jade index 9ff52d8e..42fe3bd4 100644 --- a/client/components/cards/checklists.jade +++ b/client/components/cards/checklists.jade @@ -28,9 +28,13 @@ template(name="checklistDetail") span.checklist-stat(class="{{#if checklist.isFinished}}is-finished{{/if}}") {{checklist.finishedCount}}/{{checklist.itemCount}} if canModifyCard - h2.title.js-open-inlined-form.is-editable {{checklist.title}} + h2.title.js-open-inlined-form.is-editable + +viewer + = checklist.title else - h2.title {{checklist.title}} + h2.title + +viewer + = checklist.title +checklistItems(checklist = checklist) template(name="checklistDeleteDialog") @@ -83,7 +87,11 @@ template(name='itemDetail') .item.js-checklist-item if canModifyCard .check-box.materialCheckBox(class="{{#if item.isFinished }}is-checked{{/if}}") - .item-title.js-open-inlined-form.is-editable(class="{{#if item.isFinished }}is-checked{{/if}}") {{item.title}} + .item-title.js-open-inlined-form.is-editable(class="{{#if item.isFinished }}is-checked{{/if}}") + +viewer + = item.title else .materialCheckBox(class="{{#if item.isFinished }}is-checked{{/if}}") - .item-title(class="{{#if item.isFinished }}is-checked{{/if}}") {{item.title}} + .item-title(class="{{#if item.isFinished }}is-checked{{/if}}") + +viewer + = item.title diff --git a/client/components/cards/checklists.js b/client/components/cards/checklists.js index 1cd77c9f..c1667be9 100644 --- a/client/components/cards/checklists.js +++ b/client/components/cards/checklists.js @@ -147,7 +147,7 @@ BlazeComponent.extendComponent({ pressKey(event) { //If user press enter key inside a form, submit it, so user doesn't have to leave keyboard to submit a form. - if (event.keyCode === 13) { + if (event.keyCode === 13 && !event.shiftKey) { event.preventDefault(); const $form = $(event.currentTarget).closest('form'); $form.find('button[type=submit]').click(); diff --git a/client/components/cards/minicard.jade b/client/components/cards/minicard.jade index 6fd83386..3e582b6f 100644 --- a/client/components/cards/minicard.jade +++ b/client/components/cards/minicard.jade @@ -6,7 +6,9 @@ template(name="minicard") .minicard-labels each labels .minicard-label(class="card-label-{{color}}" title="{{name}}") - .minicard-title= title + .minicard-title + +viewer + = title .dates if startAt .date -- cgit v1.2.3-1-g7c22 From ffb8b72b6967ffa7545d2c8e693c4606c66085a4 Mon Sep 17 00:00:00 2001 From: Brooks Becton Date: Tue, 14 Nov 2017 20:57:36 -0600 Subject: Updated comments about pressing enter on forms --- client/components/cards/cardDetails.js | 1 + client/components/cards/checklists.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'client') diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js index 1fd8e205..3825bda8 100644 --- a/client/components/cards/cardDetails.js +++ b/client/components/cards/cardDetails.js @@ -197,6 +197,7 @@ Template.editCardTitleForm.onRendered(function () { Template.editCardTitleForm.events({ 'keydown .js-edit-card-title' (evt) { // If enter key was pressed, submit the data + // Unless the shift key is also being pressed if (evt.keyCode === 13 && !event.shiftKey) { $('.js-submit-edit-card-title-form').click(); } diff --git a/client/components/cards/checklists.js b/client/components/cards/checklists.js index c1667be9..d3a946f0 100644 --- a/client/components/cards/checklists.js +++ b/client/components/cards/checklists.js @@ -146,7 +146,8 @@ BlazeComponent.extendComponent({ }, pressKey(event) { - //If user press enter key inside a form, submit it, so user doesn't have to leave keyboard to submit a form. + //If user press enter key inside a form, submit it + //Unless the user is also holding down the 'shift' key if (event.keyCode === 13 && !event.shiftKey) { event.preventDefault(); const $form = $(event.currentTarget).closest('form'); -- cgit v1.2.3-1-g7c22 From 622292e40e1ae934a6da5226740ef94de0f6f4b8 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Sun, 19 Nov 2017 01:05:09 +0200 Subject: Make Admin Panel People page text translateable --- client/components/settings/peopleBody.jade | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'client') diff --git a/client/components/settings/peopleBody.jade b/client/components/settings/peopleBody.jade index 34004d31..d6568720 100644 --- a/client/components/settings/peopleBody.jade +++ b/client/components/settings/peopleBody.jade @@ -22,7 +22,7 @@ template(name="peopleGeneral") tr th {{_ 'username'}} th {{_ 'fullname'}} - th {{_ 'isAdmin'}} + th {{_ 'admin'}} th {{_ 'email'}} th {{_ 'verified'}} th {{_ 'createdAt'}} @@ -37,24 +37,24 @@ template(name="peopleRow") td {{ userData.profile.fullname }} td if userData.isAdmin - | true + | {{_ 'yes'}} else - | false + | {{_ 'no'}} td {{ userData.emails.[0].address }} td if userData.emails.[0].verified - | true + | {{_ 'yes'}} else - | false + | {{_ 'no'}} td {{ moment userData.createdAt 'LLL' }} td if userData.loginDisabled - | false + | {{_ 'no'}} else - | true + | {{_ 'yes'}} td a.edit-user - | edit + | {{_ 'edit'}} template(name="editUserPopup") form @@ -76,14 +76,14 @@ template(name="editUserPopup") | {{_ 'error-email-taken'}} input.js-profile-email(type="email" value="{{user.emails.[0].address}}") label - | {{_ 'isAdmin'}} + | {{_ 'admin'}} select.select-role.js-profile-isadmin - option(value="false") No - option(value="true" selected="{{user.isAdmin}}") Yes + option(value="false") {{_ 'no'}} + option(value="true" selected="{{user.isAdmin}}") {{_ 'yes'}} label - | {{_ 'isActive'}} + | {{_ 'active'}} select.select-active.js-profile-isactive - option(value="false") Yes - option(value="true" selected="{{user.loginDisabled}}") No + option(value="false") {{_ 'yes'}} + option(value="true" selected="{{user.loginDisabled}}") {{_ 'no'}} input.primary.wide(type="submit" value="{{_ 'save'}}") -- cgit v1.2.3-1-g7c22 From 6fc992e6d7adb15d537dfe25e04e7f5da0f5e9a8 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Sun, 19 Nov 2017 01:05:43 +0200 Subject: Change admin panel header order to info people version. --- client/components/settings/settingHeader.jade | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'client') diff --git a/client/components/settings/settingHeader.jade b/client/components/settings/settingHeader.jade index e9ea218a..c2d4db3a 100644 --- a/client/components/settings/settingHeader.jade +++ b/client/components/settings/settingHeader.jade @@ -10,14 +10,14 @@ template(name="settingHeaderBar") i.fa(class="fa-cog") span {{_ 'settings'}} - a.setting-header-btn.informations(href="{{pathFor 'information'}}") - i.fa(class="fa-info-circle") - span {{_ 'info'}} - a.setting-header-btn.people(href="{{pathFor 'people'}}") i.fa(class="fa-users") span {{_ 'people'}} + a.setting-header-btn.informations(href="{{pathFor 'information'}}") + i.fa(class="fa-info-circle") + span {{_ 'info'}} + else a.setting-header-btn.js-log-in( title="{{_ 'log-in'}}") -- cgit v1.2.3-1-g7c22 From 99be745f0299b32a8a7b30204b43bff7fd5ba638 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Sun, 19 Nov 2017 18:04:02 +0200 Subject: Fix: Invitation /sign-up page did not show input for invitation code. Thanks to xet7 ! --- client/components/settings/invitationCode.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'client') diff --git a/client/components/settings/invitationCode.js b/client/components/settings/invitationCode.js index a403d8ab..c02f860f 100644 --- a/client/components/settings/invitationCode.js +++ b/client/components/settings/invitationCode.js @@ -1,6 +1,6 @@ Template.invitationCode.onRendered(() => { const setting = Settings.findOne(); - if (!setting || !setting.disableRegistration) { + if (setting || setting.disableRegistration) { $('#invitationcode').hide(); } }); -- cgit v1.2.3-1-g7c22