mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-02-17 08:50:58 -05:00
Improved admin view of pending candidates.
This commit is contained in:
parent
20541f5520
commit
d4cf31c8fe
5 changed files with 21 additions and 14 deletions
|
@ -69,25 +69,18 @@ module.exports.thangNames = thangNames =
|
||||||
"Buffy"
|
"Buffy"
|
||||||
"Allankrita"
|
"Allankrita"
|
||||||
]
|
]
|
||||||
"Peasant": [
|
"Peasant M": [
|
||||||
"Yorik"
|
"Yorik"
|
||||||
"Hector"
|
"Hector"
|
||||||
"Thad"
|
"Thad"
|
||||||
"Victor"
|
"Victor"
|
||||||
"Lyle"
|
"Lyle"
|
||||||
"Charles"
|
"Charles"
|
||||||
"Mary"
|
|
||||||
"Brandy"
|
|
||||||
"Gwendolin"
|
|
||||||
"Tabitha"
|
|
||||||
"Regan"
|
|
||||||
"Yusef"
|
"Yusef"
|
||||||
"Hingle"
|
"Hingle"
|
||||||
"Azgot"
|
"Azgot"
|
||||||
"Piers"
|
"Piers"
|
||||||
"Carlton"
|
"Carlton"
|
||||||
"Giselle"
|
|
||||||
"Bernadette"
|
|
||||||
"Hershell"
|
"Hershell"
|
||||||
"Gawain"
|
"Gawain"
|
||||||
"Durfkor"
|
"Durfkor"
|
||||||
|
@ -99,6 +92,13 @@ module.exports.thangNames = thangNames =
|
||||||
"Icey"
|
"Icey"
|
||||||
"Matilda"
|
"Matilda"
|
||||||
"Mertia"
|
"Mertia"
|
||||||
|
"Mary"
|
||||||
|
"Brandy"
|
||||||
|
"Gwendolin"
|
||||||
|
"Tabitha"
|
||||||
|
"Regan"
|
||||||
|
"Giselle"
|
||||||
|
"Bernadette"
|
||||||
]
|
]
|
||||||
"Archer F": [
|
"Archer F": [
|
||||||
"Phoebe"
|
"Phoebe"
|
||||||
|
|
|
@ -8,7 +8,7 @@ class Vector
|
||||||
a.copy()[name](b, useZ)
|
a.copy()[name](b, useZ)
|
||||||
|
|
||||||
isVector: true
|
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) ->
|
constructor: (@x=0, @y=0, @z=0) ->
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@ block content
|
||||||
th(data-i18n="employers.candidate_last_updated") Last Updated
|
th(data-i18n="employers.candidate_last_updated") Last Updated
|
||||||
if me.isAdmin()
|
if me.isAdmin()
|
||||||
th ✓?
|
th ✓?
|
||||||
|
th ಥ_ಥ
|
||||||
|
|
||||||
tbody
|
tbody
|
||||||
for candidate, index in candidates
|
for candidate, index in candidates
|
||||||
|
@ -58,3 +59,7 @@ block content
|
||||||
td ✓
|
td ✓
|
||||||
else
|
else
|
||||||
td ✗
|
td ✗
|
||||||
|
if profile.active
|
||||||
|
td ᶘ ᵒᴥᵒᶅ
|
||||||
|
else
|
||||||
|
td ⨂_⨂
|
|
@ -77,7 +77,8 @@ grabUser = (session, callback) ->
|
||||||
|
|
||||||
totalEmailsSent = 0
|
totalEmailsSent = 0
|
||||||
emailUser = (user, callback) ->
|
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 user.email in alreadyEmailed
|
||||||
return callback null, false if DEBUGGING and (totalEmailsSent > 1 or Math.random() > 0.1)
|
return callback null, false if DEBUGGING and (totalEmailsSent > 1 or Math.random() > 0.1)
|
||||||
++totalEmailsSent
|
++totalEmailsSent
|
||||||
|
|
|
@ -235,9 +235,10 @@ UserHandler = class UserHandler extends Handler
|
||||||
getCandidates: (req, res) ->
|
getCandidates: (req, res) ->
|
||||||
authorized = req.user.isAdmin() or ('employer' in req.user.get('permissions'))
|
authorized = req.user.isAdmin() or ('employer' in req.user.get('permissions'))
|
||||||
since = (new Date((new Date()) - 2 * 30.4 * 86400 * 1000)).toISOString()
|
since = (new Date((new Date()) - 2 * 30.4 * 86400 * 1000)).toISOString()
|
||||||
query = {'jobProfile.active': true, 'jobProfile.updated': {$gt: since}}
|
#query = {'jobProfile.active': true, 'jobProfile.updated': {$gt: since}}
|
||||||
#query = {'jobProfile.updated': {$gt: since}}
|
query = {'jobProfile.updated': {$gt: since}}
|
||||||
query.jobProfileApproved = true unless req.user.isAdmin()
|
query.jobProfileApproved = true unless req.user.isAdmin()
|
||||||
|
query['jobProfile.active'] = true unless req.user.isAdmin()
|
||||||
selection = 'jobProfile'
|
selection = 'jobProfile'
|
||||||
selection += ' email' if authorized
|
selection += ' email' if authorized
|
||||||
selection += ' jobProfileApproved' if req.user.isAdmin()
|
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']
|
fields = if authorized then ['jobProfile', 'jobProfileApproved', 'photoURL', '_id'] else ['jobProfile']
|
||||||
obj = _.pick document.toObject(), fields
|
obj = _.pick document.toObject(), fields
|
||||||
obj.photoURL ||= obj.jobProfile.photoURL if authorized
|
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
|
if authorized
|
||||||
subfields = subfields.concat ['name']
|
subfields = subfields.concat ['name']
|
||||||
obj.jobProfile = _.pick obj.jobProfile, subfields
|
obj.jobProfile = _.pick obj.jobProfile, subfields
|
||||||
|
|
Loading…
Reference in a new issue