mirror of
https://github.com/vale981/Vulcan
synced 2025-03-11 04:56:40 -04:00
fixing users stuff
This commit is contained in:
parent
9f7e87f722
commit
400fe55dc1
7 changed files with 32 additions and 14 deletions
|
@ -10,7 +10,8 @@ Package.onUse(function (api) {
|
|||
|
||||
var packages = [
|
||||
'standard-app-packages',
|
||||
'accounts-base',
|
||||
'service-configuration',
|
||||
'accounts-ui',
|
||||
'accounts-base',
|
||||
'accounts-password',
|
||||
'accounts-twitter',
|
||||
|
|
|
@ -596,6 +596,21 @@ var migrationsList = {
|
|||
}
|
||||
console.log("---------------------");
|
||||
return i;
|
||||
},
|
||||
migrateDisplayName: function () {
|
||||
var i = 0;
|
||||
var allUsers = Meteor.users.find({"telescope.displayName": {$exists: false}});
|
||||
console.log('> Found '+allUsers.count()+' users.\n');
|
||||
|
||||
allUsers.forEach(function(user){
|
||||
i++;
|
||||
|
||||
console.log('> Updating user '+user._id+' (' + user.username + ')');
|
||||
var displayName = user.profile.name || user.profile.username;
|
||||
console.log('name: ', displayName);
|
||||
Meteor.users.update(user._id, {$set: {"telescope.displayName": displayName}});
|
||||
});
|
||||
return i;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -52,4 +52,7 @@
|
|||
margin-top: 15px;
|
||||
padding-top: 15px;
|
||||
text-align: center;
|
||||
}
|
||||
.at-pwd-link{
|
||||
margin-bottom: 20px;
|
||||
}
|
|
@ -28,8 +28,8 @@ function setupUser (user, options) {
|
|||
user.telescope.emailHash = Gravatar.hash(options.email);
|
||||
}
|
||||
|
||||
// set username on telescope
|
||||
user.telescope.username = user.username;
|
||||
// set displayName on telescope
|
||||
user.telescope.displayName = user.username;
|
||||
|
||||
// create slug from username
|
||||
user.telescope.slug = Telescope.utils.slugify(user.telescope.username);
|
||||
|
|
|
@ -6,16 +6,16 @@ Template.usersDashboard.helpers({
|
|||
showFilter: true,
|
||||
fields: [
|
||||
{ key: 'avatar', label: '', tmpl: Template.users_list_avatar, sortable: false },
|
||||
{ key: 'username', label: 'Username', tmpl: Template.users_list_username },
|
||||
{ key: 'profile.username', label: 'Display Name' },
|
||||
{ key: 'profile.email', label: 'Email', tmpl: Template.users_list_email },
|
||||
{ key: 'createdAt', label: 'Member Since', tmpl: Template.users_list_created_at, sort: 'descending' },
|
||||
{ key: 'postCount', label: 'Posts' },
|
||||
{ key: 'commentCount', label: 'Comments' },
|
||||
{ key: 'karma', label: 'Karma', fn: function(val){return Math.round(100*val)/100} },
|
||||
{ key: 'inviteCount', label: 'Invites' },
|
||||
{ key: 'isInvited', label: 'Invited', fn: function(val){return val ? 'Yes':'No'} },
|
||||
{ key: 'isAdmin', label: 'Admin', fn: function(val){return val ? 'Yes':'No'} },
|
||||
{ key: 'username', label: 'Username', tmpl: Template.users_list_username },
|
||||
{ key: 'telescope.displayName', label: 'Display Name' },
|
||||
{ key: 'telescope.email', label: 'Email', tmpl: Template.users_list_email },
|
||||
{ key: 'telescope.postCount', label: 'Posts' },
|
||||
{ key: 'telescope.commentCount', label: 'Comments' },
|
||||
{ key: 'telescope.karma', label: 'Karma', fn: function(val){return Math.round(100*val)/100} },
|
||||
{ key: 'telescope.inviteCount', label: 'Invites' },
|
||||
{ key: 'telescope.isInvited', label: 'Invited', fn: function(val){return val ? 'Yes':'No'} },
|
||||
{ key: 'actions', label: 'Actions', tmpl: Template.users_list_actions, sortable: false }
|
||||
]
|
||||
};
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
<template name="users_list_email">
|
||||
<a href="mailto:{{profile.email}}">{{profile.email}}</a>
|
||||
<a href="mailto:{{telescope.email}}">{{telescope.email}}</a>
|
||||
</template>
|
||||
|
|
|
@ -34,9 +34,8 @@ Telescope.schemas.userData = new SimpleSchema({
|
|||
type: Number,
|
||||
optional: true
|
||||
},
|
||||
displayName: {
|
||||
displayName: { // can contain spaces and special characters, doesn't need to be unique
|
||||
type: String,
|
||||
regEx: /^[a-zA-Z-]{2,25}$/,
|
||||
optional: true,
|
||||
editableBy: ["member", "admin"]
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue