diff --git a/app/schemas/models/user.coffee b/app/schemas/models/user.coffee index d07cc9ccd..28ab6d5c4 100644 --- a/app/schemas/models/user.coffee +++ b/app/schemas/models/user.coffee @@ -80,7 +80,7 @@ UserSchema = c.object {}, school: c.shortString {title: 'School', description: 'Name of your school.'} degree: c.shortString {title: 'Degree', description: 'What was your degree and field of study? Ex. Ph.D. Human-Computer Interaction (incomplete)'} duration: c.shortString {title: 'Dates', description: 'When? Ex.: "Aug 2004 - May 2008".'} - projects: c.array {title: 'Projects', description: 'Highlight your projects to amaze employers.'}, + projects: c.array {title: 'Projects', description: 'Highlight your projects to amaze employers.', maxItems: 3}, c.object {title: 'Project', description: 'A project you created.', required: ['name', 'description', 'picture'], default: {name: 'My Project', description: 'A project I worked on.', link: 'http://example.com', picture: ''}}, name: c.shortString {title: 'Project Name', description: 'What was the project called?', default: 'My Project'} description: {type: 'string', title: 'Description', description: 'Briefly describe the project.', maxLength: 400, default: 'A project I worked on.', format: 'markdown'} diff --git a/app/views/account/job_profile_view.coffee b/app/views/account/job_profile_view.coffee index d5e112acc..8a9fdc799 100644 --- a/app/views/account/job_profile_view.coffee +++ b/app/views/account/job_profile_view.coffee @@ -15,7 +15,7 @@ module.exports = class JobProfileView extends CocoView afterRender: -> super() return if @loading() - @buildJobProfileTreema() + _.defer => @buildJobProfileTreema() # Not sure why, but the Treemas don't fully build without this if you reload the page. buildJobProfileTreema: -> visibleSettings = @editableSettings.concat @readOnlySettings diff --git a/app/views/account/settings_view.coffee b/app/views/account/settings_view.coffee index 5e1d606da..e1f2685c1 100644 --- a/app/views/account/settings_view.coffee +++ b/app/views/account/settings_view.coffee @@ -43,7 +43,7 @@ module.exports = class SettingsView extends View @jobProfileView = new JobProfileView() @listenTo @jobProfileView, 'change', @save @insertSubView @jobProfileView - @buildPictureTreema() + _.defer => @buildPictureTreema() # Not sure why, but the Treemas don't fully build without this if you reload the page. chooseTab: (category) -> id = "##{category}-pane" @@ -81,7 +81,6 @@ module.exports = class SettingsView extends View schema = _.cloneDeep me.schema() schema.properties = _.pick me.schema().properties, 'photoURL' schema.required = ['photoURL'] - console.log 'have data', data, 'schema', schema treemaOptions = filePath: "db/user/#{me.id}" schema: schema @@ -94,6 +93,7 @@ module.exports = class SettingsView extends View @$el.find('.gravatar-fallback').toggle not me.get 'photoURL' onPictureChanged: (e) => + console.log "on Picture TChoinagaegd" @trigger 'change' @$el.find('.gravatar-fallback').toggle not me.get 'photoURL' diff --git a/server/users/user_handler.coffee b/server/users/user_handler.coffee index 0c128e31a..e8fe2bc96 100644 --- a/server/users/user_handler.coffee +++ b/server/users/user_handler.coffee @@ -156,7 +156,7 @@ UserHandler = class UserHandler extends Handler getSimulatorLeaderboard: (req, res) -> @validateSimulateLeaderboardRequestParameters(req) - + query = {} sortOrder = -1 limit = if req.query.limit > 30 then 30 else req.query.limit @@ -167,7 +167,7 @@ UserHandler = class UserHandler extends Handler sortOrder = 1 if req.query.order is 1 else query.simulatedBy = {"$exists": true} - + leaderboardQuery = User.find(query).select("name simulatedBy simulatedFor").sort({"simulatedBy":sortOrder}).limit(limit) leaderboardQuery.exec (err, otherUsers) -> otherUsers = _.reject otherUsers, _id: req.user._id if req.query.scoreOffset isnt -1 @@ -248,8 +248,7 @@ UserHandler = class UserHandler extends Handler getCandidates: (req, res) -> authorized = req.user.isAdmin() or ('employer' in req.user.get('permissions')) since = (new Date((new Date()) - 2 * 30.4 * 86400 * 1000)).toISOString() - #query = {'jobProfileApproved': true, 'jobProfile.active': true, 'jobProfile.updated': {$gt: since}} - query = {'jobProfile.active': true, 'jobProfile.updated': {$gt: since}} # testing + query = {'jobProfile.active': true, 'jobProfile.updated': {$gt: since}} query.jobProfileApproved = true unless req.user.isAdmin() selection = 'jobProfile' selection += ' email' if authorized @@ -263,7 +262,6 @@ UserHandler = class UserHandler extends Handler fields = if authorized then ['jobProfile', 'jobProfileApproved', 'photoURL', '_id'] else ['jobProfile'] obj = _.pick document.toObject(), fields obj.photoURL ||= obj.jobProfile.photoURL if authorized - obj.photoURL ||= @buildGravatarURL document if authorized subfields = ['country', 'city', 'lookingFor', 'jobTitle', 'skills', 'experience', 'updated'] if authorized subfields = subfields.concat ['name']