diff --git a/rpg-docs/Model/Users/Users.js b/rpg-docs/Model/Users/Users.js index 95d0c399..f6037e34 100644 --- a/rpg-docs/Model/Users/Users.js +++ b/rpg-docs/Model/Users/Users.js @@ -1,35 +1,44 @@ Schema = {}; Schema.User = new SimpleSchema({ - username: { - type: String, - regEx: /^[a-z0-9A-Z_]{3,15}$/ - }, - emails: { - type: [Object], - // this must be optional if you also use other login services like facebook, - // but if you use only accounts-password, then it can be required - optional: true - }, - "emails.$.address": { - type: String, - regEx: SimpleSchema.RegEx.Email - }, - "emails.$.verified": { - type: Boolean - }, - createdAt: { - type: Date - }, - services: { - type: Object, - optional: true, - blackbox: true - }, - roles: { - type: [String], - optional: true - } + username: { + type: String, + regEx: /^[a-z0-9A-Z_]{3,15}$/, + optional: true + }, + emails: { + type: [Object], + // this must be optional if you also use other login services like facebook, + // but if you use only accounts-password, then it can be required + optional: true + }, + "emails.$.address": { + type: String, + regEx: SimpleSchema.RegEx.Email + }, + "emails.$.verified": { + type: Boolean + }, + createdAt: { + type: Date + }, + services: { + type: Object, + optional: true, + blackbox: true + }, + roles: { + type: [String], + optional: true + } }); Meteor.users.attachSchema(Schema.User); + +Meteor.users.allow({ + update: function (userId, doc, fields, modifier) { + return userId === doc._id && + fields.length === 1 && + fields[0] === 'username'; + } +}); diff --git a/rpg-docs/Routes/Routes.js b/rpg-docs/Routes/Routes.js index 8a4eb705..10b33a8a 100644 --- a/rpg-docs/Routes/Routes.js +++ b/rpg-docs/Routes/Routes.js @@ -5,8 +5,7 @@ Router.configure({ Router.map( function () { /* - this.route('home', - { + this.route('home', { path: '/', waitOn: function(){ return Meteor.subscribe("characterList", Meteor.userId()); @@ -18,8 +17,7 @@ Router.map( function () { } });*/ //add a home route and change characterList route - this.route('characterList', - { + this.route('characterList', { path: '/', waitOn: function(){ return Meteor.subscribe("characterList", Meteor.userId()); @@ -66,4 +64,8 @@ Router.map( function () { this.route('loading', { path: '/loading' }); + + this.route('profile', { + path: '/account' + }); }); \ No newline at end of file diff --git a/rpg-docs/client/views/GeneralCSS/general.css b/rpg-docs/client/views/GeneralCSS/general.css index eca9cbb5..08e4c1e5 100644 --- a/rpg-docs/client/views/GeneralCSS/general.css +++ b/rpg-docs/client/views/GeneralCSS/general.css @@ -94,7 +94,7 @@ paper-button { color: rgba(0, 0, 0, 0.54); } -.statCard { +.statCard, .clickable { cursor: pointer; } diff --git a/rpg-docs/client/views/characterList/characterList.html b/rpg-docs/client/views/characterList/characterList.html index 1a5b4bed..e3a89a6f 100644 --- a/rpg-docs/client/views/characterList/characterList.html +++ b/rpg-docs/client/views/characterList/characterList.html @@ -17,13 +17,15 @@ {{> gridPadding class="characterCard" num=12}} {{else}} -
{{address}}
+