mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
Work on the user account system
Allow a user to modifies its name, username, initials, and password. Fixes username handling on sandstorm. Fixes #149.
This commit is contained in:
parent
5f09c0ce40
commit
7f6929608c
34 changed files with 255 additions and 164 deletions
|
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
&.is-dragging-active
|
&.is-dragging-active
|
||||||
|
|
||||||
|
.list-composer,
|
||||||
.open-minicard-composer
|
.open-minicard-composer
|
||||||
display: none
|
display: none
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -103,25 +103,22 @@
|
||||||
.ps-scrollbar-y-rail
|
.ps-scrollbar-y-rail
|
||||||
transform: translateX(2px)
|
transform: translateX(2px)
|
||||||
|
|
||||||
.open-minicard-composer
|
.open-minicard-composer
|
||||||
border-radius: 2px
|
border-radius: 2px
|
||||||
color: #8c8c8c
|
color: #8c8c8c
|
||||||
display: block
|
display: block
|
||||||
padding: 7px 10px
|
padding: 7px 10px
|
||||||
position: relative
|
position: relative
|
||||||
text-decoration: none
|
text-decoration: none
|
||||||
animation: fadeIn 0.3s
|
animation: fadeIn 0.3s
|
||||||
|
|
||||||
i.fa
|
i.fa
|
||||||
margin-right: 7px
|
margin-right: 7px
|
||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
background: white
|
background: #fafafa
|
||||||
color: #222
|
color: #222
|
||||||
box-shadow: 0 1px 2px rgba(0,0,0,.2)
|
box-shadow: 0 1px 2px rgba(0,0,0,.2)
|
||||||
|
|
||||||
&::selection
|
|
||||||
background: transparent
|
|
||||||
|
|
||||||
@keyframes fadeIn
|
@keyframes fadeIn
|
||||||
from
|
from
|
||||||
|
|
|
||||||
|
|
@ -47,12 +47,14 @@
|
||||||
#header-user-bar
|
#header-user-bar
|
||||||
margin: 2px 0
|
margin: 2px 0
|
||||||
|
|
||||||
.member
|
.header-user-bar-avatar
|
||||||
width: 24px
|
|
||||||
height: @width
|
|
||||||
float: left
|
float: left
|
||||||
margin: 0
|
|
||||||
margin-top: 1px
|
.member
|
||||||
|
width: 24px
|
||||||
|
height: @width
|
||||||
|
margin: 0
|
||||||
|
margin-top: 1px
|
||||||
|
|
||||||
.header-user-bar-name
|
.header-user-bar-name
|
||||||
margin: 4px 8px 0 0
|
margin: 4px 8px 0 0
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,10 @@ head
|
||||||
link(rel="shortcut icon" href="/favicon.png")
|
link(rel="shortcut icon" href="/favicon.png")
|
||||||
|
|
||||||
template(name="userFormsLayout")
|
template(name="userFormsLayout")
|
||||||
h1.at-form-landing-logo
|
section.auth-layout
|
||||||
img(src="/logo.png" title="LibreBoard")
|
h1.at-form-landing-logo
|
||||||
+yield
|
img(src="/logo.png" title="LibreBoard")
|
||||||
|
+yield
|
||||||
|
|
||||||
template(name="defaultLayout")
|
template(name="defaultLayout")
|
||||||
#surface
|
#surface
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,19 @@ Popup.template.events({
|
||||||
},
|
},
|
||||||
'click .js-confirm': function() {
|
'click .js-confirm': function() {
|
||||||
this.__afterConfirmAction.call(this);
|
this.__afterConfirmAction.call(this);
|
||||||
|
},
|
||||||
|
// This handler intends to solve a pretty tricky bug with our popup
|
||||||
|
// transition. The transition is implemented using a large container
|
||||||
|
// (.content-container) that is moved on the x-axis (from 0 to n*PopupSize)
|
||||||
|
// inside a wrapper (.container-wrapper) with a hidden overflow. The problem
|
||||||
|
// is that sometimes the wrapper is scrolled -- even if there are no
|
||||||
|
// scrollbars. This happen for instance when the newly opened popup has some
|
||||||
|
// focused field, the browser will automatically scroll the wrapper, resulting
|
||||||
|
// in moving the whole popup container outside of the popup wrapper. To
|
||||||
|
// disable this behavior we have to manually reset the scrollLeft position
|
||||||
|
// whenever it is modified.
|
||||||
|
'scroll .content-wrapper': function(evt) {
|
||||||
|
evt.currentTarget.scrollLeft = 0;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,6 @@
|
||||||
border: 1px solid #dbdbdb
|
border: 1px solid #dbdbdb
|
||||||
border-bottom-color: #c2c2c2
|
border-bottom-color: #c2c2c2
|
||||||
box-shadow: 0 1px 6px rgba(0, 0, 0, .3)
|
box-shadow: 0 1px 6px rgba(0, 0, 0, .3)
|
||||||
display: none
|
|
||||||
overflow: hidden
|
|
||||||
position: absolute
|
position: absolute
|
||||||
width: 300px
|
width: 300px
|
||||||
z-index: 99999
|
z-index: 99999
|
||||||
|
|
@ -20,12 +18,10 @@
|
||||||
input[type="text"],
|
input[type="text"],
|
||||||
input[type="email"],
|
input[type="email"],
|
||||||
input[type="password"]
|
input[type="password"]
|
||||||
|
input[type="file"]
|
||||||
margin: 4px 0 12px
|
margin: 4px 0 12px
|
||||||
width: 100%
|
width: 100%
|
||||||
|
|
||||||
input[type="file"]
|
|
||||||
width: 240px
|
|
||||||
|
|
||||||
select
|
select
|
||||||
width: 100%
|
width: 100%
|
||||||
margin-bottom: 14px
|
margin-bottom: 14px
|
||||||
|
|
@ -35,9 +31,6 @@
|
||||||
margin: 4px 0 12px
|
margin: 4px 0 12px
|
||||||
width: 100%
|
width: 100%
|
||||||
|
|
||||||
img
|
|
||||||
max-width: 270px
|
|
||||||
|
|
||||||
.header
|
.header
|
||||||
height: 36px
|
height: 36px
|
||||||
position: relative
|
position: relative
|
||||||
|
|
@ -80,6 +73,7 @@
|
||||||
|
|
||||||
.content-wrapper
|
.content-wrapper
|
||||||
width: 100%
|
width: 100%
|
||||||
|
overflow: hidden
|
||||||
|
|
||||||
.content-container
|
.content-container
|
||||||
width: 5000px
|
width: 5000px
|
||||||
|
|
@ -92,7 +86,7 @@
|
||||||
float: left
|
float: left
|
||||||
|
|
||||||
&.no-height
|
&.no-height
|
||||||
height: 0
|
height: 20px
|
||||||
|
|
||||||
.quiet
|
.quiet
|
||||||
padding: 6px 6px 4px
|
padding: 6px 6px 4px
|
||||||
|
|
@ -113,6 +107,17 @@
|
||||||
height: 4px
|
height: 4px
|
||||||
width: 4px
|
width: 4px
|
||||||
|
|
||||||
|
.at-form
|
||||||
|
.at-error, .at-result
|
||||||
|
padding: 8px 12px
|
||||||
|
margin: -8px -10px 10px
|
||||||
|
|
||||||
|
.at-error
|
||||||
|
background: #ef9a9a
|
||||||
|
|
||||||
|
.at-result
|
||||||
|
background: #b2dfdb
|
||||||
|
|
||||||
.select-members-list
|
.select-members-list
|
||||||
margin-bottom: 8px
|
margin-bottom: 8px
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
.pop-over.clearfix(
|
.pop-over(
|
||||||
class="{{#unless title}}miniprofile{{/unless}}"
|
class="{{#unless title}}miniprofile{{/unless}}"
|
||||||
class=currentBoard.colorClass
|
class=currentBoard.colorClass
|
||||||
class="{{#unless title}}no-title{{/unless}}"
|
class="{{#unless title}}no-title{{/unless}}"
|
||||||
style="display:block; left:{{offset.left}}px; top:{{offset.top}}px;")
|
style="left:{{offset.left}}px; top:{{offset.top}}px;")
|
||||||
.header
|
.header
|
||||||
a.back-btn.js-back-view(class="{{#unless hasPopupParent}}is-hidden{{/unless}}")
|
a.back-btn.js-back-view(class="{{#unless hasPopupParent}}is-hidden{{/unless}}")
|
||||||
i.fa.fa-chevron-left
|
i.fa.fa-chevron-left
|
||||||
|
|
@ -20,3 +20,4 @@
|
||||||
Hopefully the @last helper will come soon (or at least @index)
|
Hopefully the @last helper will come soon (or at least @index)
|
||||||
.content(class="{{#unless $eq popupName ../popupName}}no-height{{/unless}}")
|
.content(class="{{#unless $eq popupName ../popupName}}no-height{{/unless}}")
|
||||||
+Template.dynamic(template=popupName data=dataContext)
|
+Template.dynamic(template=popupName data=dataContext)
|
||||||
|
.clearfix
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
<template name='message'>
|
<template name='message'>
|
||||||
<div class="big-message quiet {{ color }}">
|
<div class="big-message quiet {{ color }}">
|
||||||
<h1>{{_ label}}</h1>
|
<h1>{{_ label}}</h1>
|
||||||
{{#with pathFor route='Login'}}
|
{{#with pathFor route='atSignIn'}}
|
||||||
<p>{{{_ 'page-maybe-private' this}}}</p>
|
<p>{{{_ 'page-maybe-private' this}}}</p>
|
||||||
{{/with}}
|
{{/with}}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -6,12 +6,12 @@ BlazeComponent.extendComponent({
|
||||||
events: function() {
|
events: function() {
|
||||||
return [{
|
return [{
|
||||||
'click .js-toggle-label-filter': function(event) {
|
'click .js-toggle-label-filter': function(event) {
|
||||||
Filter.labelIds.toogle(this._id);
|
Filter.labelIds.toogle(this.currentData()._id);
|
||||||
Filter.resetExceptions();
|
Filter.resetExceptions();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
},
|
},
|
||||||
'click .js-toogle-member-filter': function(event) {
|
'click .js-toogle-member-filter': function(event) {
|
||||||
Filter.members.toogle(this._id);
|
Filter.members.toogle(this.currentData()._id);
|
||||||
Filter.resetExceptions();
|
Filter.resetExceptions();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
_.each(['signIn', 'signUp', 'resetPwd',
|
_.each(['signIn', 'signUp', 'resetPwd', 'forgotPwd', 'enrollAccount'],
|
||||||
'forgotPwd', 'enrollAccount', 'changePwd'], function(routeName) {
|
function(routeName) {
|
||||||
AccountsTemplates.configureRoute(routeName, {
|
AccountsTemplates.configureRoute(routeName, {
|
||||||
layoutTemplate: 'userFormsLayout'
|
layoutTemplate: 'userFormsLayout'
|
||||||
});
|
});
|
||||||
|
|
@ -20,9 +20,3 @@ Router.route('/profile/:username', {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Router.route('/settings', {
|
|
||||||
name: 'Settings',
|
|
||||||
template: 'settings',
|
|
||||||
layoutTemplate: 'AuthLayout'
|
|
||||||
});
|
|
||||||
|
|
|
||||||
|
|
@ -1,49 +1,50 @@
|
||||||
.at-form-landing-logo
|
.auth-layout
|
||||||
width: 275px
|
.at-form-landing-logo
|
||||||
margin: auto
|
|
||||||
margin-top: 50px
|
|
||||||
margin-top: 17vh
|
|
||||||
|
|
||||||
img
|
|
||||||
width: 275px
|
width: 275px
|
||||||
|
margin: auto
|
||||||
|
margin-top: 50px
|
||||||
|
margin-top: 17vh
|
||||||
|
|
||||||
.at-form
|
img
|
||||||
margin: auto
|
width: 275px
|
||||||
width: 275px
|
|
||||||
padding: 25px
|
|
||||||
margin-top: 20px
|
|
||||||
padding-bottom: 10px
|
|
||||||
background: #fff
|
|
||||||
border-radius: 3px
|
|
||||||
border: 1px solid #dbdbdb
|
|
||||||
border-bottom-color: #c2c2c2
|
|
||||||
box-shadow: 0 1px 6px rgba(0, 0, 0, .3)
|
|
||||||
|
|
||||||
.at-link
|
.at-form
|
||||||
color: darken(#27AE60, 40%)
|
margin: auto
|
||||||
|
width: 275px
|
||||||
|
padding: 25px
|
||||||
|
margin-top: 20px
|
||||||
|
padding-bottom: 10px
|
||||||
|
background: #fff
|
||||||
|
border-radius: 3px
|
||||||
|
border: 1px solid #dbdbdb
|
||||||
|
border-bottom-color: #c2c2c2
|
||||||
|
box-shadow: 0 1px 6px rgba(0, 0, 0, .3)
|
||||||
|
|
||||||
label
|
.at-link
|
||||||
margin-bottom: 3px
|
color: darken(#27AE60, 40%)
|
||||||
|
|
||||||
input
|
label
|
||||||
width: 100%
|
margin-bottom: 3px
|
||||||
|
|
||||||
.at-title
|
input
|
||||||
background: #F7F7F7
|
width: 100%
|
||||||
margin: -25px
|
|
||||||
padding: 15px 25px 5px
|
|
||||||
margin-bottom: 20px
|
|
||||||
border-bottom: 1px solid #dcdcdc
|
|
||||||
color: darken(white, 70%)
|
|
||||||
font-weight: bold
|
|
||||||
|
|
||||||
.at-signup-link,
|
.at-title
|
||||||
.at-signin-link,
|
background: #F7F7F7
|
||||||
.at-forgotPwd
|
margin: -25px
|
||||||
font-size: 0.9em
|
padding: 15px 25px 5px
|
||||||
margin-top: 15px
|
margin-bottom: 20px
|
||||||
color: darken(white, 70%)
|
border-bottom: 1px solid #dcdcdc
|
||||||
|
color: darken(white, 70%)
|
||||||
.at-signUp,
|
|
||||||
.at-signIn
|
|
||||||
font-weight: bold
|
font-weight: bold
|
||||||
|
|
||||||
|
.at-signup-link,
|
||||||
|
.at-signin-link,
|
||||||
|
.at-forgotPwd
|
||||||
|
font-size: 0.9em
|
||||||
|
margin-top: 15px
|
||||||
|
color: darken(white, 70%)
|
||||||
|
|
||||||
|
.at-signUp,
|
||||||
|
.at-signIn
|
||||||
|
font-weight: bold
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,44 @@
|
||||||
template(name="headerUserBar")
|
template(name="headerUserBar")
|
||||||
a#header-user-bar.js-open-header-member-menu
|
a#header-user-bar
|
||||||
.header-user-bar-name
|
.header-user-bar-name.js-open-header-member-menu
|
||||||
i.fa.fa-chevron-down
|
i.fa.fa-chevron-down
|
||||||
if currentUser.profile.name
|
if currentUser.profile.name
|
||||||
= currentUser.profile.name
|
= currentUser.profile.name
|
||||||
else
|
else
|
||||||
= currentUser.username
|
= currentUser.username
|
||||||
+userAvatar(user=currentUser)
|
.header-user-bar-avatar.js-change-avatar
|
||||||
|
+userAvatar(user=currentUser)
|
||||||
|
|
||||||
template(name="memberMenuPopup")
|
template(name="memberMenuPopup")
|
||||||
ul.pop-over-list
|
ul.pop-over-list
|
||||||
li: a(href="{{pathFor route='Profile' username=currentUser.username}}") {{_ 'profile'}}
|
with currentUser
|
||||||
li: a.js-language {{_ 'language'}}
|
li: a.js-edit-profile Edit Profile…
|
||||||
li: a(href = "{{pathFor route='Settings'}}") {{_ 'settings'}}
|
li: a.js-change-avatar Change Avatar…
|
||||||
|
li: a.js-change-password Change Password…
|
||||||
|
li: a.js-change-language Change Language…
|
||||||
hr
|
hr
|
||||||
ul.pop-over-list
|
ul.pop-over-list
|
||||||
li: a.js-logout {{_ 'log-out'}}
|
li: a.js-logout {{_ 'log-out'}}
|
||||||
|
|
||||||
template(name="setLanguagePopup")
|
template(name="editProfilePopup")
|
||||||
|
form
|
||||||
|
label
|
||||||
|
| {{_ "fullname"}}
|
||||||
|
input.js-profile-fullname(type="text" value=profile.name autofocus)
|
||||||
|
label
|
||||||
|
| {{_ "username"}}
|
||||||
|
input.js-profile-username(type="text" value=username)
|
||||||
|
label
|
||||||
|
| Initials
|
||||||
|
input.js-profile-initials(type="text" value=profile.initials)
|
||||||
|
input.primary.wide(type="submit" value="{{_ 'save'}}")
|
||||||
|
|
||||||
|
template(name="changeAvatarPopup")
|
||||||
|
|
||||||
|
template(name="changePasswordPopup")
|
||||||
|
+atForm(state='changePwd')
|
||||||
|
|
||||||
|
template(name="changeLanguagePopup")
|
||||||
ul.pop-over-list
|
ul.pop-over-list
|
||||||
each languages
|
each languages
|
||||||
li(class="{{# if isCurrentLanguage}}active{{/if}}")
|
li(class="{{# if isCurrentLanguage}}active{{/if}}")
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,64 @@
|
||||||
Template.headerUserBar.events({
|
Template.headerUserBar.events({
|
||||||
'click .js-open-header-member-menu': Popup.open('memberMenu')
|
'click .js-open-header-member-menu': Popup.open('memberMenu'),
|
||||||
|
'click .js-change-avatar': Popup.open('changeAvatar')
|
||||||
});
|
});
|
||||||
|
|
||||||
Template.setLanguagePopup.helpers({
|
Template.memberMenuPopup.events({
|
||||||
|
'click .js-edit-profile': Popup.open('editProfile'),
|
||||||
|
'click .js-change-avatar': Popup.open('changeAvatar'),
|
||||||
|
'click .js-change-password': Popup.open('changePassword'),
|
||||||
|
'click .js-change-language': Popup.open('changeLanguage'),
|
||||||
|
'click .js-logout': function(evt) {
|
||||||
|
evt.preventDefault();
|
||||||
|
|
||||||
|
AccountsTemplates.logout();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Template.editProfilePopup.events({
|
||||||
|
submit: function(evt, tpl) {
|
||||||
|
evt.preventDefault();
|
||||||
|
var fullname = $.trim(tpl.find('.js-profile-fullname').value);
|
||||||
|
var username = $.trim(tpl.find('.js-profile-username').value);
|
||||||
|
var initials = $.trim(tpl.find('.js-profile-initials').value);
|
||||||
|
Users.update(Meteor.userId(), {$set: {
|
||||||
|
'profile.fullname': fullname,
|
||||||
|
'profile.initials': initials
|
||||||
|
}});
|
||||||
|
// XXX We should report the error to the user.
|
||||||
|
if (username !== Meteor.user().username) {
|
||||||
|
Meteor.call('setUsername', username);
|
||||||
|
}
|
||||||
|
Popup.back();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// We display the form to change the password in a popup window that already
|
||||||
|
// have a title, so we unset the title automatically displayed by useraccounts.
|
||||||
|
AccountsTemplates.configure({
|
||||||
|
texts: {
|
||||||
|
title: {
|
||||||
|
changePwd: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
AccountsTemplates.configureRoute('changePwd', {
|
||||||
|
redirect: function() {
|
||||||
|
// XXX We should emit a notification once we have a notification system.
|
||||||
|
// Currently the user has no indication that his modification has been
|
||||||
|
// applied.
|
||||||
|
Popup.back();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 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() {
|
||||||
|
this.find('#at-field-current_password').focus();
|
||||||
|
});
|
||||||
|
|
||||||
|
Template.changeLanguagePopup.helpers({
|
||||||
languages: function() {
|
languages: function() {
|
||||||
return _.map(TAPi18n.getLanguages(), function(lang, tag) {
|
return _.map(TAPi18n.getLanguages(), function(lang, tag) {
|
||||||
return {
|
return {
|
||||||
|
|
@ -16,18 +72,7 @@ Template.setLanguagePopup.helpers({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Template.memberMenuPopup.events({
|
Template.changeLanguagePopup.events({
|
||||||
'click .js-language': Popup.open('setLanguage'),
|
|
||||||
'click .js-logout': function(evt) {
|
|
||||||
evt.preventDefault();
|
|
||||||
|
|
||||||
Meteor.logout(function() {
|
|
||||||
Router.go('Home');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
Template.setLanguagePopup.events({
|
|
||||||
'click .js-set-language': function(evt) {
|
'click .js-set-language': function(evt) {
|
||||||
Users.update(Meteor.userId(), {
|
Users.update(Meteor.userId(), {
|
||||||
$set: {
|
$set: {
|
||||||
|
|
|
||||||
|
|
@ -1,35 +1,19 @@
|
||||||
|
var passwordField = AccountsTemplates.removeField('password');
|
||||||
|
var emailField = AccountsTemplates.removeField('email');
|
||||||
|
AccountsTemplates.addFields([{
|
||||||
|
_id: 'username',
|
||||||
|
type: 'text',
|
||||||
|
displayName: 'username',
|
||||||
|
required: true,
|
||||||
|
minLength: 5
|
||||||
|
}, emailField, passwordField]);
|
||||||
|
|
||||||
AccountsTemplates.configure({
|
AccountsTemplates.configure({
|
||||||
confirmPassword: false,
|
confirmPassword: false,
|
||||||
enablePasswordChange: true,
|
enablePasswordChange: true,
|
||||||
sendVerificationEmail: true,
|
sendVerificationEmail: true,
|
||||||
showForgotPasswordLink: true
|
showForgotPasswordLink: true,
|
||||||
});
|
onLogoutHook: function() {
|
||||||
|
Router.go('Home');
|
||||||
AccountsTemplates.removeField('password');
|
|
||||||
AccountsTemplates.removeField('email');
|
|
||||||
AccountsTemplates.addFields([
|
|
||||||
{
|
|
||||||
_id: 'username',
|
|
||||||
type: 'text',
|
|
||||||
displayName: 'username',
|
|
||||||
required: true,
|
|
||||||
minLength: 5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
_id: 'email',
|
|
||||||
type: 'email',
|
|
||||||
required: true,
|
|
||||||
displayName: 'email',
|
|
||||||
re: /.+@(.+){2,}\.(.+){2,}/,
|
|
||||||
errStr: 'Invalid email'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
_id: 'password',
|
|
||||||
type: 'password',
|
|
||||||
placeholder: {
|
|
||||||
signUp: 'At least six characters'
|
|
||||||
},
|
|
||||||
required: true,
|
|
||||||
minLength: 6
|
|
||||||
}
|
}
|
||||||
]);
|
});
|
||||||
|
|
|
||||||
|
|
@ -202,9 +202,9 @@ $(document).on('click', function(evt) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Press escape to close the popup.
|
// Press escape to go back, or close the popup.
|
||||||
var bindPopup = function(f) { return _.bind(f, Popup); };
|
var bindPopup = function(f) { return _.bind(f, Popup); };
|
||||||
EscapeActions.register('popup',
|
EscapeActions.register('popup',
|
||||||
bindPopup(Popup.close),
|
bindPopup(Popup.back),
|
||||||
bindPopup(Popup.isOpen)
|
bindPopup(Popup.isOpen)
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,10 @@
|
||||||
&:hover
|
&:hover
|
||||||
color: white
|
color: white
|
||||||
|
|
||||||
a.fa, a i.fa
|
a
|
||||||
color: darken(white, 35%)
|
&.fa, i.fa
|
||||||
|
color: darken(white, 35%)
|
||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
color: darken(white, 60%)
|
&.fa, i.fa
|
||||||
|
color: darken(white, 60%)
|
||||||
|
|
|
||||||
|
|
@ -41,11 +41,35 @@ Users.helpers({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Meteor.methods({
|
||||||
|
setUsername: function(username) {
|
||||||
|
var nUsersWithUsername = Users.find({username: username}).count();
|
||||||
|
if (nUsersWithUsername > 0) {
|
||||||
|
throw new Meteor.Error('username-already-taken');
|
||||||
|
} else {
|
||||||
|
Users.update(this.userId, {$set: {
|
||||||
|
username: username
|
||||||
|
}});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
Users.before.insert(function(userId, doc) {
|
Users.before.insert(function(userId, doc) {
|
||||||
doc.profile = doc.profile || {};
|
doc.profile = doc.profile || {};
|
||||||
|
|
||||||
|
if (! doc.username && doc.profile.name) {
|
||||||
|
doc.username = doc.profile.name.toLowerCase().replace(/\s/g, '');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (Meteor.isServer) {
|
if (Meteor.isServer) {
|
||||||
|
// Let mongoDB ensure username unicity
|
||||||
|
Meteor.startup(function() {
|
||||||
|
Users._collection._ensureIndex({
|
||||||
|
username: 1
|
||||||
|
}, { unique: true });
|
||||||
|
});
|
||||||
|
|
||||||
// Each board document contains the de-normalized number of users that have
|
// Each board document contains the de-normalized number of users that have
|
||||||
// starred it. If the user star or unstar a board, we need to update this
|
// starred it. If the user star or unstar a board, we need to update this
|
||||||
// counter.
|
// counter.
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@
|
||||||
"createLabelPopup-title": "Create Label",
|
"createLabelPopup-title": "Create Label",
|
||||||
"deleteLabelPopup-title": "Delete Label?",
|
"deleteLabelPopup-title": "Delete Label?",
|
||||||
"changePermissionsPopup-title": "Change Permissions",
|
"changePermissionsPopup-title": "Change Permissions",
|
||||||
"setLanguagePopup-title": "Change Language",
|
"changeLanguagePopup-title": "Change Language",
|
||||||
"cardAttachmentsPopup-title": "Attach From…",
|
"cardAttachmentsPopup-title": "Attach From…",
|
||||||
"attachmentDeletePopup-title": "Delete Attachment?"
|
"attachmentDeletePopup-title": "Delete Attachment?"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@
|
||||||
"createLabelPopup-title": "Criar Etiqueta",
|
"createLabelPopup-title": "Criar Etiqueta",
|
||||||
"deleteLabelPopup-title": "Excluir Etiqueta?",
|
"deleteLabelPopup-title": "Excluir Etiqueta?",
|
||||||
"changePermissionsPopup-title": "Alterar Permissões",
|
"changePermissionsPopup-title": "Alterar Permissões",
|
||||||
"setLanguagePopup-title": "Alterar Idioma",
|
"changeLanguagePopup-title": "Alterar Idioma",
|
||||||
"cardAttachmentsPopup-title": "Anexar de…",
|
"cardAttachmentsPopup-title": "Anexar de…",
|
||||||
"attachmentDeletePopup-title": "Excluir Anexo?"
|
"attachmentDeletePopup-title": "Excluir Anexo?"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@
|
||||||
"createLabelPopup-title": "Create Label",
|
"createLabelPopup-title": "Create Label",
|
||||||
"deleteLabelPopup-title": "Delete Label?",
|
"deleteLabelPopup-title": "Delete Label?",
|
||||||
"changePermissionsPopup-title": "Change Permissions",
|
"changePermissionsPopup-title": "Change Permissions",
|
||||||
"setLanguagePopup-title": "Change Language",
|
"changeLanguagePopup-title": "Change Language",
|
||||||
"cardAttachmentsPopup-title": "Attach From…",
|
"cardAttachmentsPopup-title": "Attach From…",
|
||||||
"attachmentDeletePopup-title": "Delete Attachment?"
|
"attachmentDeletePopup-title": "Delete Attachment?"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@
|
||||||
"createLabelPopup-title": "创建标签",
|
"createLabelPopup-title": "创建标签",
|
||||||
"deleteLabelPopup-title": "删除标签?",
|
"deleteLabelPopup-title": "删除标签?",
|
||||||
"changePermissionsPopup-title": "更改权限",
|
"changePermissionsPopup-title": "更改权限",
|
||||||
"setLanguagePopup-title": "更改语言",
|
"changeLanguagePopup-title": "更改语言",
|
||||||
"cardAttachmentsPopup-title": "附加自...",
|
"cardAttachmentsPopup-title": "附加自...",
|
||||||
"attachmentDeletePopup-title": "删除附件?"
|
"attachmentDeletePopup-title": "删除附件?"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@
|
||||||
"createLabelPopup-title": "Create Label",
|
"createLabelPopup-title": "Create Label",
|
||||||
"deleteLabelPopup-title": "Delete Label?",
|
"deleteLabelPopup-title": "Delete Label?",
|
||||||
"changePermissionsPopup-title": "Change Permissions",
|
"changePermissionsPopup-title": "Change Permissions",
|
||||||
"setLanguagePopup-title": "Change Language",
|
"changeLanguagePopup-title": "Change Language",
|
||||||
"cardAttachmentsPopup-title": "Attach From…",
|
"cardAttachmentsPopup-title": "Attach From…",
|
||||||
"attachmentDeletePopup-title": "Delete Attachment?"
|
"attachmentDeletePopup-title": "Delete Attachment?"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@
|
||||||
"createLabelPopup-title": "Label erstellen",
|
"createLabelPopup-title": "Label erstellen",
|
||||||
"deleteLabelPopup-title": "Entferne Label?",
|
"deleteLabelPopup-title": "Entferne Label?",
|
||||||
"changePermissionsPopup-title": "Ändere Erlaubnisse",
|
"changePermissionsPopup-title": "Ändere Erlaubnisse",
|
||||||
"setLanguagePopup-title": "Ändere Sprache",
|
"changeLanguagePopup-title": "Ändere Sprache",
|
||||||
"cardAttachmentsPopup-title": "Attach From…",
|
"cardAttachmentsPopup-title": "Attach From…",
|
||||||
"attachmentDeletePopup-title": "Delete Attachment?"
|
"attachmentDeletePopup-title": "Delete Attachment?"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -181,8 +181,12 @@
|
||||||
"createLabelPopup-title": "Create Label",
|
"createLabelPopup-title": "Create Label",
|
||||||
"deleteLabelPopup-title": "Delete Label?",
|
"deleteLabelPopup-title": "Delete Label?",
|
||||||
"changePermissionsPopup-title": "Change Permissions",
|
"changePermissionsPopup-title": "Change Permissions",
|
||||||
"setLanguagePopup-title": "Change Language",
|
"changeLanguagePopup-title": "Change Language",
|
||||||
"cardAttachmentsPopup-title": "Attach From…",
|
"cardAttachmentsPopup-title": "Attach From…",
|
||||||
"attachmentDeletePopup-title": "Delete Attachment?",
|
"attachmentDeletePopup-title": "Delete Attachment?",
|
||||||
|
"memberMenuPopup-title": "Member Settings",
|
||||||
|
"editProfilePopup-title": "Edit Profile",
|
||||||
|
"changeAvatarPopup-title": "Change Avatar",
|
||||||
|
"changePasswordPopup-title": "Change Password",
|
||||||
"disambiguateMultiLabelPopup-title": "Disambiguate Label Action"
|
"disambiguateMultiLabelPopup-title": "Disambiguate Label Action"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@
|
||||||
"createLabelPopup-title": "Crear etiqueta",
|
"createLabelPopup-title": "Crear etiqueta",
|
||||||
"deleteLabelPopup-title": "Borrar etiqueta",
|
"deleteLabelPopup-title": "Borrar etiqueta",
|
||||||
"changePermissionsPopup-title": "Cambiar permisos",
|
"changePermissionsPopup-title": "Cambiar permisos",
|
||||||
"setLanguagePopup-title": "Cambiar idioma",
|
"changeLanguagePopup-title": "Cambiar idioma",
|
||||||
"cardAttachmentsPopup-title": "Adjuntar de...",
|
"cardAttachmentsPopup-title": "Adjuntar de...",
|
||||||
"attachmentDeletePopup-title": "¿Borrar adjunto?"
|
"attachmentDeletePopup-title": "¿Borrar adjunto?"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@
|
||||||
"createLabelPopup-title": "Luo tunniste",
|
"createLabelPopup-title": "Luo tunniste",
|
||||||
"deleteLabelPopup-title": "Poista tunniste?",
|
"deleteLabelPopup-title": "Poista tunniste?",
|
||||||
"changePermissionsPopup-title": "Vaihda oikeuksia",
|
"changePermissionsPopup-title": "Vaihda oikeuksia",
|
||||||
"setLanguagePopup-title": "Vaihda kieltä",
|
"changeLanguagePopup-title": "Vaihda kieltä",
|
||||||
"cardAttachmentsPopup-title": "Liitä mistä...",
|
"cardAttachmentsPopup-title": "Liitä mistä...",
|
||||||
"attachmentDeletePopup-title": "Poista liitetiedosto?"
|
"attachmentDeletePopup-title": "Poista liitetiedosto?"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@
|
||||||
"createLabelPopup-title": "Créer un étiquette",
|
"createLabelPopup-title": "Créer un étiquette",
|
||||||
"deleteLabelPopup-title": "Supprimer l'étiquette ?",
|
"deleteLabelPopup-title": "Supprimer l'étiquette ?",
|
||||||
"changePermissionsPopup-title": "Changer les permissions",
|
"changePermissionsPopup-title": "Changer les permissions",
|
||||||
"setLanguagePopup-title": "Changer la langue",
|
"changeLanguagePopup-title": "Changer la langue",
|
||||||
"cardAttachmentsPopup-title": "Joindre depuis…",
|
"cardAttachmentsPopup-title": "Joindre depuis…",
|
||||||
"attachmentDeletePopup-title": "Supprimer la pièce jointe ?"
|
"attachmentDeletePopup-title": "Supprimer la pièce jointe ?"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@
|
||||||
"createLabelPopup-title": "Create Label",
|
"createLabelPopup-title": "Create Label",
|
||||||
"deleteLabelPopup-title": "Delete Label?",
|
"deleteLabelPopup-title": "Delete Label?",
|
||||||
"changePermissionsPopup-title": "Change Permissions",
|
"changePermissionsPopup-title": "Change Permissions",
|
||||||
"setLanguagePopup-title": "Change Language",
|
"changeLanguagePopup-title": "Change Language",
|
||||||
"cardAttachmentsPopup-title": "Attach From…",
|
"cardAttachmentsPopup-title": "Attach From…",
|
||||||
"attachmentDeletePopup-title": "Delete Attachment?"
|
"attachmentDeletePopup-title": "Delete Attachment?"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@
|
||||||
"createLabelPopup-title": "Create Label",
|
"createLabelPopup-title": "Create Label",
|
||||||
"deleteLabelPopup-title": "Delete Label?",
|
"deleteLabelPopup-title": "Delete Label?",
|
||||||
"changePermissionsPopup-title": "Change Permissions",
|
"changePermissionsPopup-title": "Change Permissions",
|
||||||
"setLanguagePopup-title": "Change Language",
|
"changeLanguagePopup-title": "Change Language",
|
||||||
"cardAttachmentsPopup-title": "Attach From…",
|
"cardAttachmentsPopup-title": "Attach From…",
|
||||||
"attachmentDeletePopup-title": "Delete Attachment?"
|
"attachmentDeletePopup-title": "Delete Attachment?"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@
|
||||||
"createLabelPopup-title": "ラベルの作成",
|
"createLabelPopup-title": "ラベルの作成",
|
||||||
"deleteLabelPopup-title": "ラベルを削除しますか?",
|
"deleteLabelPopup-title": "ラベルを削除しますか?",
|
||||||
"changePermissionsPopup-title": "パーミッションの変更",
|
"changePermissionsPopup-title": "パーミッションの変更",
|
||||||
"setLanguagePopup-title": "言語の変更",
|
"changeLanguagePopup-title": "言語の変更",
|
||||||
"cardAttachmentsPopup-title": "Attach From…",
|
"cardAttachmentsPopup-title": "Attach From…",
|
||||||
"attachmentDeletePopup-title": "Delete Attachment?"
|
"attachmentDeletePopup-title": "Delete Attachment?"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@
|
||||||
"createLabelPopup-title": "라벨 생성",
|
"createLabelPopup-title": "라벨 생성",
|
||||||
"deleteLabelPopup-title": "라벨을 삭제합니까?",
|
"deleteLabelPopup-title": "라벨을 삭제합니까?",
|
||||||
"changePermissionsPopup-title": "권한 변경",
|
"changePermissionsPopup-title": "권한 변경",
|
||||||
"setLanguagePopup-title": "언어 변경",
|
"changeLanguagePopup-title": "언어 변경",
|
||||||
"cardAttachmentsPopup-title": "첨부할 위치...",
|
"cardAttachmentsPopup-title": "첨부할 위치...",
|
||||||
"attachmentDeletePopup-title": "첨부 파일을 삭제합니까?"
|
"attachmentDeletePopup-title": "첨부 파일을 삭제합니까?"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@
|
||||||
"createLabelPopup-title": "Создать метку",
|
"createLabelPopup-title": "Создать метку",
|
||||||
"deleteLabelPopup-title": "Удалить метку?",
|
"deleteLabelPopup-title": "Удалить метку?",
|
||||||
"changePermissionsPopup-title": "Изменить настройки доступа",
|
"changePermissionsPopup-title": "Изменить настройки доступа",
|
||||||
"setLanguagePopup-title": "Сменить язык",
|
"changeLanguagePopup-title": "Сменить язык",
|
||||||
"cardAttachmentsPopup-title": "Источник",
|
"cardAttachmentsPopup-title": "Источник",
|
||||||
"attachmentDeletePopup-title": "Удалить вложение?"
|
"attachmentDeletePopup-title": "Удалить вложение?"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@
|
||||||
"createLabelPopup-title": "Etiket Oluşturma",
|
"createLabelPopup-title": "Etiket Oluşturma",
|
||||||
"deleteLabelPopup-title": "Etiket Silinsin mi?",
|
"deleteLabelPopup-title": "Etiket Silinsin mi?",
|
||||||
"changePermissionsPopup-title": "Yetkileri Değiştirme",
|
"changePermissionsPopup-title": "Yetkileri Değiştirme",
|
||||||
"setLanguagePopup-title": "Dil Değiştir",
|
"changeLanguagePopup-title": "Dil Değiştir",
|
||||||
"cardAttachmentsPopup-title": "Şuradan Ekle...",
|
"cardAttachmentsPopup-title": "Şuradan Ekle...",
|
||||||
"attachmentDeletePopup-title": "Ek Dosya Silinsin Mi?"
|
"attachmentDeletePopup-title": "Ek Dosya Silinsin Mi?"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -88,10 +88,6 @@ if (isSandstorm && Meteor.isServer) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// The sandstom user package put the username in `profile.name`. We need to
|
|
||||||
// move this field value to follow our schema.
|
|
||||||
Users.update(doc._id, { $rename: { 'profile.name': 'username' }});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue