Move featured candidates to top of sort

This commit is contained in:
Michael Schmatz 2014-07-07 21:29:48 -07:00
parent 08b9a8fdaa
commit e294f344c4

View file

@ -112,7 +112,7 @@ module.exports = class EmployersView extends View
@filters = @filters =
phoneScreenFilter: [true, false] phoneScreenFilter: [true, false]
visa: ['Authorized to work in the US', 'Need visa sponsorship'] visa: ['Authorized to work in the US', 'Need visa sponsorship']
schoolFilter: ['Top 20 Eng.', 'Other US', 'Other Intl.', 'Top School', 'Other'] schoolFilter: ['Top School', 'Other']
locationFilter: ['Bay Area', 'New York', 'Other US', 'International'] locationFilter: ['Bay Area', 'New York', 'Other US', 'International']
roleFilter: ['Web Developer', 'Software Developer', 'Mobile Developer'] roleFilter: ['Web Developer', 'Software Developer', 'Mobile Developer']
seniorityFilter: ['College Student', 'Recent Grad', 'Junior', 'Senior'] seniorityFilter: ['College Student', 'Recent Grad', 'Junior', 'Senior']
@ -122,9 +122,9 @@ module.exports = class EmployersView extends View
getRenderData: -> getRenderData: ->
ctx = super() ctx = super()
ctx.isEmployer = @isEmployer() ctx.isEmployer = @isEmployer()
ctx.candidates = _.sortBy @candidates.models, (c) -> c.get('jobProfile').curated?.featured ctx.candidates = _.sortBy @candidates.models, (c) -> -1 * c.get('jobProfile').experience
ctx.candidates = _.sortBy ctx.candidates, (c) -> -1 * c.get('jobProfile').experience
ctx.candidates = _.sortBy ctx.candidates, (c) -> not c.get('jobProfile').curated? ctx.candidates = _.sortBy ctx.candidates, (c) -> not c.get('jobProfile').curated?
ctx.candidates = _.sortBy ctx.candidates, (c) -> c.get('jobProfile').curated?.featured
ctx.activeCandidates = _.filter ctx.candidates, (c) -> c.get('jobProfile').active ctx.activeCandidates = _.filter ctx.candidates, (c) -> c.get('jobProfile').active
ctx.inactiveCandidates = _.reject ctx.candidates, (c) -> c.get('jobProfile').active ctx.inactiveCandidates = _.reject ctx.candidates, (c) -> c.get('jobProfile').active
ctx.featuredCandidates = _.filter ctx.activeCandidates, (c) -> c.get('jobProfileApproved') ctx.featuredCandidates = _.filter ctx.activeCandidates, (c) -> c.get('jobProfileApproved')