Add howToApply

This commit is contained in:
Berkeley Martinez
2015-10-20 16:03:22 -07:00
parent 24927748e0
commit dc2df4537d
2 changed files with 47 additions and 12 deletions

View File

@ -36,7 +36,8 @@ const checkValidity = [
'url', 'url',
'logo', 'logo',
'company', 'company',
'isHighlighted' 'isHighlighted',
'howToApply'
]; ];
const hightlightCopy = ` const hightlightCopy = `
Highlight my post to make it stand out. (+$50) Highlight my post to make it stand out. (+$50)
@ -47,17 +48,22 @@ const foo = `
`; `;
const isFullStackCopy = ` const isFullStackCopy = `
Applicants must have Free Code Camps Full Stack Certification to apply.* Applicants must have earned Free Code Camps Full Stack Certification to apply.*
`; `;
const isFrontEndCopy = ` const isFrontEndCopy = `
Applicants must have Free Code Camps Front End Certification to apply.* Applicants must have earned Free Code Camps Front End Certification to apply.*
`; `;
const isRemoteCopy = ` const isRemoteCopy = `
This job can be performed remotely. This job can be performed remotely.
`; `;
const howToApplyCopy = dedent`
Examples: click here to apply yourcompany.com/jobs/33
Or email jobs@yourcompany.com
`;
const checkboxClass = dedent` const checkboxClass = dedent`
text-left text-left
jobs-checkbox-spacer jobs-checkbox-spacer
@ -100,7 +106,8 @@ export default contain({
isHighlighted, isHighlighted,
isFullStackCert, isFullStackCert,
isFrontEndCert, isFrontEndCert,
isRemoteOk isRemoteOk,
howToApply
} = form; } = form;
return { return {
position: formatValue(position, makeRequired(isAscii)), position: formatValue(position, makeRequired(isAscii)),
@ -113,7 +120,8 @@ export default contain({
isHighlighted: formatValue(isHighlighted, null, 'bool'), isHighlighted: formatValue(isHighlighted, null, 'bool'),
isFullStackCert: formatValue(isFullStackCert, null, 'bool'), isFullStackCert: formatValue(isFullStackCert, null, 'bool'),
isFrontEndCert: formatValue(isFrontEndCert, null, 'bool'), isFrontEndCert: formatValue(isFrontEndCert, null, 'bool'),
isRemoteOk: formatValue(isRemoteOk, null, 'bool') isRemoteOk: formatValue(isRemoteOk, null, 'bool'),
howToApply: formatValue(howToApply, makeRequired(isAscii))
}; };
}, },
subscribeOnWillMount() { subscribeOnWillMount() {
@ -135,7 +143,8 @@ export default contain({
isHighlighted: PropTypes.object, isHighlighted: PropTypes.object,
isFullStackCert: PropTypes.object, isFullStackCert: PropTypes.object,
isFrontEndCert: PropTypes.object, isFrontEndCert: PropTypes.object,
isRemoteOk: PropTypes.object isRemoteOk: PropTypes.object,
howToApply: PropTypes.object
}, },
mixins: [History], mixins: [History],
@ -170,7 +179,8 @@ export default contain({
isHighlighted, isHighlighted,
isFullStackCert, isFullStackCert,
isFrontEndCert, isFrontEndCert,
isRemoteOk isRemoteOk,
howToApply
} = this.props; } = this.props;
// sanitize user output // sanitize user output
@ -185,7 +195,8 @@ export default contain({
isHighlighted: !!isHighlighted.value, isHighlighted: !!isHighlighted.value,
isFrontEndCert: !!isFrontEndCert.value, isFrontEndCert: !!isFrontEndCert.value,
isFullStackCert: !!isFullStackCert.value, isFullStackCert: !!isFullStackCert.value,
isRemoteOk: !!isRemoteOk.value isRemoteOk: !!isRemoteOk.value,
howToApply: inHTMLData(howToApply.value)
}; };
const job = Object.keys(jobValues).reduce((accu, prop) => { const job = Object.keys(jobValues).reduce((accu, prop) => {
@ -225,6 +236,7 @@ export default contain({
isFrontEndCert, isFrontEndCert,
isFullStackCert, isFullStackCert,
isRemoteOk, isRemoteOk,
howToApply,
jobActions: { handleForm } jobActions: { handleForm }
} = this.props; } = this.props;
const { handleChange } = this; const { handleChange } = this;
@ -238,7 +250,6 @@ export default contain({
md={ 10 } md={ 10 }
mdOffset={ 1 }> mdOffset={ 1 }>
<Panel className='text-center'> <Panel className='text-center'>
<h1>Create Your Job Post</h1>
<form <form
className='form-horizontal' className='form-horizontal'
onSubmit={ this.handleSubmit }> onSubmit={ this.handleSubmit }>
@ -312,8 +323,25 @@ export default contain({
<small>* { foo }</small> <small>* { foo }</small>
</Row> </Row>
<div className='spacer' /> <div className='spacer' />
<Row>
<div>
<h2>How should they apply?</h2>
</div>
<Input
bsStyle={ howToApply.bsStyle }
label=' '
labelClassName={ labelClass }
onChange={ (e) => handleChange('howToApply', e) }
placeholder={ howToApplyCopy }
required={ true }
rows='2'
type='textarea'
value={ howToApply.value }
wrapperClassName={ inputClass } />
</Row>
<div className='divider'> <div className='spacer' />
<div>
<h2>Tell us about your organization</h2> <h2>Tell us about your organization</h2>
</div> </div>
<Input <Input
@ -386,7 +414,7 @@ export default contain({
} /> } />
</Row> </Row>
</Well> </Well>
<div className='spacer' />
<Row> <Row>
<Col <Col
className='text-left' className='text-left'

View File

@ -22,7 +22,8 @@
"type": "string" "type": "string"
}, },
"email": { "email": {
"type": "string" "type": "string",
"required": true
}, },
"phone": { "phone": {
"type": "string" "type": "string"
@ -38,6 +39,7 @@
}, },
"locale": { "locale": {
"type": "string", "type": "string",
"required": true,
"description": "format: city, state" "description": "format: city, state"
}, },
"location": { "location": {
@ -81,6 +83,11 @@
"type": "boolean", "type": "boolean",
"default": false, "default": false,
"description": "Camper may work remotely" "description": "Camper may work remotely"
},
"howToApply": {
"type": "string",
"required": true,
"description": "How do campers apply to job"
} }
}, },
"validations": [], "validations": [],