diff --git a/app/views/employers_view.coffee b/app/views/employers_view.coffee index 973ebc107..7d154b76a 100644 --- a/app/views/employers_view.coffee +++ b/app/views/employers_view.coffee @@ -53,6 +53,11 @@ module.exports = class EmployersView extends View that.filters[name] = _.union that.filters[name], [value] else that.filters[name] = _.difference that.filters[name], [value] + + for filterName, filterValues of @filters + if filterValues.length is 0 + @filters[filterName] = @defaultFilters[filterName] + handleSelectAllChange: (e) -> checkedState = e.currentTarget.checked $("#filters :input").each -> @@ -95,7 +100,8 @@ module.exports = class EmployersView extends View locationFilter: ['Bay Area', 'New York', 'Other US', 'International'] roleFilter: ['Web Developer', 'Software Developer', 'iOS Developer', 'Android Developer', 'Project Manager'] seniorityFilter: ['College Student', 'Recent Grad', 'Junior', 'Senior', 'Management'] - + @defaultFilters = _.cloneDeep @filters + getRenderData: -> ctx = super() @@ -104,8 +110,9 @@ module.exports = class EmployersView extends View 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') - #ctx.featuredCandidates = _.filter ctx.featuredCandidates, (c) -> c.get('jobProfile').curated - #ctx.featuredCandidates = ctx.featuredCandidates.slice(0,8) + unless @isEmployer() or me.isAdmin() + ctx.featuredCandidates = _.filter ctx.featuredCandidates, (c) -> c.get('jobProfile').curated + ctx.featuredCandidates = ctx.featuredCandidates.slice(0,7) ctx.otherCandidates = _.reject ctx.activeCandidates, (c) -> c.get('jobProfileApproved') ctx.remarks = {} ctx.remarks[remark.get('user')] = remark for remark in @remarks.models diff --git a/server/users/user_handler.coffee b/server/users/user_handler.coffee index 7bd483678..0ed4f6a51 100644 --- a/server/users/user_handler.coffee +++ b/server/users/user_handler.coffee @@ -321,9 +321,9 @@ UserHandler = class UserHandler extends Handler @sendSuccess(res, candidates) formatCandidate: (authorized, document) -> - fields = if authorized then ['name', 'jobProfile', 'jobProfileApproved', 'photoURL', '_id'] else ['jobProfile', 'jobProfileApproved'] + fields = if authorized then ['name', 'jobProfile', 'jobProfileApproved', 'photoURL', '_id'] else ['_id','jobProfile', 'jobProfileApproved'] 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', 'active', 'shortDescription', 'curated', 'visa'] if authorized subfields = subfields.concat ['name']