Merge branch 'master' into production

This commit is contained in:
Michael Schmatz 2014-07-07 21:43:54 -07:00
commit fd532145c1
2 changed files with 30 additions and 15 deletions

View file

@ -28,50 +28,50 @@ block content
h4 Visa
label
input(type="checkbox" name="visa" value="Authorized to work in the US")
| US Authorized
| US Authorized (#{candidatesInFilter("visa","Authorized to work in the US")})
br
label
input(type="checkbox" name="visa" value="Need visa sponsorship")
| Not Authorized
| Not Authorized (#{candidatesInFilter("visa","Need visa sponsorship")})
.filter_section#school_filter
h4 Education
label
input(type="checkbox" name="schoolFilter" value="Top School")
| Top School
| Top School (#{candidatesInFilter("schoolFilter","Top School")})
br
label
input(type="checkbox" name="schoolFilter" value="Other")
| Other
| Other (#{candidatesInFilter("schoolFilter","Other")})
.filter_section#role_filter
h4 Role
label
input(type="checkbox" name="roleFilter" value="Web Developer")
| Web Developer
| Web Developer (#{candidatesInFilter("roleFilter","Web Developer")})
br
label
input(type="checkbox" name="roleFilter" value="Software Developer")
| Software Developer
| Software Developer (#{candidatesInFilter("roleFilter","Software Developer")})
br
label
input(type="checkbox" name="roleFilter" value="Mobile Developer")
| Mobile Developer
| Mobile Developer (#{candidatesInFilter("roleFilter","Mobile Developer")})
.filter_section#seniority_filter
h4 Seniority
label
input(type="checkbox" name="seniorityFilter" value="Senior")
| Senior
| Senior (#{candidatesInFilter("seniorityFilter","Senior")})
br
label
input(type="checkbox" name="seniorityFilter" value="Junior")
| Junior
| Junior (#{candidatesInFilter("seniorityFilter","Junior")})
br
label
input(type="checkbox" name="seniorityFilter" value="Recent Grad")
| Recent Grad
| Recent Grad (#{candidatesInFilter("seniorityFilter","Recent Grad")})
br
label
input(type="checkbox" name="seniorityFilter" value="College Student")
| College Student
| College Student (#{candidatesInFilter("seniorityFilter","College Student")})
//input#select_all_checkbox(type="checkbox" name="select_all" checked)
//| Select all

View file

@ -112,19 +112,33 @@ module.exports = class EmployersView extends View
@filters =
phoneScreenFilter: [true, false]
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']
roleFilter: ['Web Developer', 'Software Developer', 'Mobile Developer']
seniorityFilter: ['College Student', 'Recent Grad', 'Junior', 'Senior']
@defaultFilters = _.cloneDeep @filters
candidatesInFilter: (filterName, filterValue) =>
candidates = @getActiveAndApprovedCandidates()
if filterName and filterValue
if filterName is 'visa'
return (_.filter candidates, (c) -> c.get('jobProfile').visa is filterValue).length
else
return (_.filter candidates, (c) -> c.get('jobProfile').curated?[filterName] is filterValue).length
else
return Math.floor(Math.random() * 500)
getActiveAndApprovedCandidates: =>
candidates = _.filter @candidates.models, (c) -> c.get('jobProfile').active
return _.filter candidates, (c) -> c.get('jobProfileApproved')
getRenderData: ->
ctx = super()
ctx.isEmployer = @isEmployer()
ctx.candidates = _.sortBy @candidates.models, (c) -> c.get('jobProfile').curated?.featured
ctx.candidates = _.sortBy ctx.candidates, (c) -> -1 * c.get('jobProfile').experience
#If you change the candidates displayed, change candidatesInFilter()
ctx.candidates = _.sortBy @candidates.models, (c) -> -1 * c.get('jobProfile').experience
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.inactiveCandidates = _.reject ctx.candidates, (c) -> c.get('jobProfile').active
ctx.featuredCandidates = _.filter ctx.activeCandidates, (c) -> c.get('jobProfileApproved')
@ -134,6 +148,7 @@ module.exports = class EmployersView extends View
ctx.featuredCandidates = ctx.featuredCandidates.slice(0,7)
if me.isAdmin()
ctx.featuredCandidates = ctx.candidates
ctx.candidatesInFilter = @candidatesInFilter
ctx.otherCandidates = _.reject ctx.activeCandidates, (c) -> c.get('jobProfileApproved')
ctx.remarks = {}
ctx.remarks[remark.get('user')] = remark for remark in @remarks.models