This commit is contained in:
Scott Erickson 2014-04-15 12:27:46 -07:00
commit 69fba34f64
4 changed files with 7 additions and 9 deletions

View file

@ -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'}

View file

@ -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

View file

@ -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'

View file

@ -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']