Improved admin view of pending candidates.

This commit is contained in:
Nick Winter 2014-04-23 10:21:58 -07:00
parent 20541f5520
commit d4cf31c8fe
5 changed files with 21 additions and 14 deletions

View file

@ -69,25 +69,18 @@ module.exports.thangNames = thangNames =
"Buffy"
"Allankrita"
]
"Peasant": [
"Peasant M": [
"Yorik"
"Hector"
"Thad"
"Victor"
"Lyle"
"Charles"
"Mary"
"Brandy"
"Gwendolin"
"Tabitha"
"Regan"
"Yusef"
"Hingle"
"Azgot"
"Piers"
"Carlton"
"Giselle"
"Bernadette"
"Hershell"
"Gawain"
"Durfkor"
@ -99,6 +92,13 @@ module.exports.thangNames = thangNames =
"Icey"
"Matilda"
"Mertia"
"Mary"
"Brandy"
"Gwendolin"
"Tabitha"
"Regan"
"Giselle"
"Bernadette"
]
"Archer F": [
"Phoebe"

View file

@ -8,7 +8,7 @@ class Vector
a.copy()[name](b, useZ)
isVector: true
apiProperties: ['x', 'y', 'magnitude', 'heading', 'distance', 'dot', 'equals', 'copy']
apiProperties: ['x', 'y', 'magnitude', 'heading', 'distance', 'dot', 'equals', 'copy', 'distanceSquared']
constructor: (@x=0, @y=0, @z=0) ->

View file

@ -28,6 +28,7 @@ block content
th(data-i18n="employers.candidate_last_updated") Last Updated
if me.isAdmin()
th ✓?
th ಥ_ಥ
tbody
for candidate, index in candidates
@ -57,4 +58,8 @@ block content
if candidate.get('jobProfileApproved')
td ✓
else
td ✗
td ✗
if profile.active
td ᶘ ᵒᴥᵒᶅ
else
td ⨂_⨂

View file

@ -77,7 +77,8 @@ grabUser = (session, callback) ->
totalEmailsSent = 0
emailUser = (user, callback) ->
return callback null, false if user.emails?.recruiting?.enabled is false # TODO: later, obey also "announcements" when that's untangled
#return callback null, false if user.emails?.anyNotes?.enabled is false # TODO: later, uncomment to obey also "anyNotes" when that's untangled
return callback null, false if user.emails?.recruitNotes?.enabled is false
return callback null, false if user.email in alreadyEmailed
return callback null, false if DEBUGGING and (totalEmailsSent > 1 or Math.random() > 0.1)
++totalEmailsSent

View file

@ -235,9 +235,10 @@ 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 = {'jobProfile.active': true, 'jobProfile.updated': {$gt: since}}
#query = {'jobProfile.updated': {$gt: since}}
#query = {'jobProfile.active': true, 'jobProfile.updated': {$gt: since}}
query = {'jobProfile.updated': {$gt: since}}
query.jobProfileApproved = true unless req.user.isAdmin()
query['jobProfile.active'] = true unless req.user.isAdmin()
selection = 'jobProfile'
selection += ' email' if authorized
selection += ' jobProfileApproved' if req.user.isAdmin()
@ -251,7 +252,7 @@ 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
subfields = ['country', 'city', 'lookingFor', 'jobTitle', 'skills', 'experience', 'updated']
subfields = ['country', 'city', 'lookingFor', 'jobTitle', 'skills', 'experience', 'updated', 'active']
if authorized
subfields = subfields.concat ['name']
obj.jobProfile = _.pick obj.jobProfile, subfields