Merge branch 'employer-redesign' of https://github.com/codecombat/codecombat into employer-redesign

This commit is contained in:
George Saines 2014-07-03 15:17:41 -07:00
commit 6d438319ab
4 changed files with 41 additions and 8 deletions

View file

@ -33,6 +33,13 @@
#filter-button, #create-alert-button
float: right
#login-link, #logout-button
float: right
color: #333333
display: inline-block
:visited
color: #333333
#tagline, .hiring-call-to-action
width: 100%
text-align: center
@ -112,6 +119,8 @@
tr
.candidate-picture
height: 50px
border-radius: 5px
.candidate-description
width: 100%
vertical-align: bottom

View file

@ -1,11 +1,17 @@
extends /templates/recruitment_base
block content
if me.get('anonymous')
a#login-link Login
br
if !isEmployer && !me.isAdmin()
#tagline
h1(data-i18n="employers.hire_developers_not_credentials") Hire developers, not credentials.
button.btn.get-started-button Get started
else
if !me.get('anonymous')
a#logout-button(data-i18n="login.log_out") Logout
br
#filter
.panel-group#filter_panel
.panel.panel-default
@ -86,8 +92,8 @@ block content
br
input(type="checkbox" name="seniorityFilter" value="Management" checked)
| Management
input#select_all_checkbox(type="checkbox" name="select_all" checked)
| Select all
//input#select_all_checkbox(type="checkbox" name="select_all" checked)
//| Select all
button.btn#filter-button Filter
//button.btn#create-alert-button Create Alert
if candidates.length

View file

@ -24,6 +24,9 @@ module.exports = class EmployersView extends View
'change #filters input': 'onFilterChanged'
'click #filter-button': 'applyFilters'
'change #select_all_checkbox': 'handleSelectAllChange'
'click .get-started-button': 'openSignupModal'
'click .navbar-brand': 'restoreBodyColor'
'click #login-link': 'onClickAuthbutton'
constructor: (options) ->
super options
@ -38,7 +41,13 @@ module.exports = class EmployersView extends View
afterInsert: ->
super()
_.delay @checkForEmployerSignupHash, 500
#fairly hacky, change this in the future
@originalBackgroundColor = $("body").css 'background-color'
$("body").css 'background-color', '#B4B4B4'
restoreBodyColor: ->
$("body").css 'background-color', @originalBackgroundColor
onFilterChanged: ->
@resetFilters()
that = @
@ -53,6 +62,13 @@ 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]
openSignupModal: ->
@openModalView new EmployerSignupView
handleSelectAllChange: (e) ->
checkedState = e.currentTarget.checked
$("#filters :input").each ->
@ -95,7 +111,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 +121,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
@ -259,7 +277,7 @@ module.exports = class EmployersView extends View
onCandidateClicked: (e) ->
id = $(e.target).closest('tr').data('candidate-id')
if id
if id and (@isEmployer() or me.isAdmin())
if window.history
oldState = _.cloneDeep window.history.state ? {}
oldState["lastViewedCandidateID"] = id

View file

@ -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']