Finish copy, add flags

This commit is contained in:
Berkeley Martinez
2015-10-20 15:01:05 -07:00
parent 1319a563c7
commit ac8a1a3f6f
4 changed files with 75 additions and 88 deletions

View File

@ -19,7 +19,7 @@ export default contain(
},
render() {
const { id } = this.props;
const { id, isHighlighted } = this.props;
return (
<div>
<Row>
@ -58,7 +58,10 @@ export default contain(
<input
name='hosted_button_id'
type='hidden'
value='ZVU498PLMPHKU' />
value={ isHighlighted ?
'' :
'ZVU498PLMPHKU'
} />
<input
name='custom'
type='hidden'

View File

@ -22,7 +22,6 @@ import {
import {
isAscii,
isEmail,
isMobilePhone,
isURL
} from 'validator';
@ -33,7 +32,6 @@ const checkValidity = [
'locale',
'description',
'email',
'phone',
'url',
'logo',
'company',
@ -43,16 +41,20 @@ const hightlightCopy = `
Highlight my post to make it stand out. (+$50)
`;
const foo = `
This will narrow the field substantially with higher quality applicants
`;
const isFullStackCopy = `
Only allow full stack certified students to apply.
Applicants must have Free Code Camps Full Stack Certification to apply.*
`;
const isFrontEndCopy = `
Only allow front end certified students to apply.
Applicants must have Free Code Camps Front End Certification to apply.*
`;
const isRemoteCopy = `
This job can be done remotely.
This job can be performed remotely.
`;
const checkboxClass = dedent`
@ -78,10 +80,6 @@ function isValidURL(data) {
return isURL(data, { 'require_protocol': true });
}
function isValidPhone(data) {
return isMobilePhone(data, 'en-US');
}
function makeRequired(validator) {
return (val) => !!val && validator(val);
}
@ -95,7 +93,6 @@ export default contain({
locale,
description,
email,
phone,
url,
logo,
company,
@ -109,7 +106,6 @@ export default contain({
locale: formatValue(locale, makeRequired(isAscii)),
description: formatValue(description, makeRequired(isAscii)),
email: formatValue(email, makeRequired(isEmail)),
phone: formatValue(phone, isValidPhone),
url: formatValue(url, isValidURL),
logo: formatValue(logo, isValidURL),
company: formatValue(company, makeRequired(isAscii)),
@ -132,7 +128,6 @@ export default contain({
locale: PropTypes.object,
description: PropTypes.object,
email: PropTypes.object,
phone: PropTypes.object,
url: PropTypes.object,
logo: PropTypes.object,
company: PropTypes.object,
@ -168,7 +163,6 @@ export default contain({
locale,
description,
email,
phone,
url,
logo,
company,
@ -184,7 +178,6 @@ export default contain({
locale: inHTMLData(locale.value),
description: inHTMLData(description.value),
email: inHTMLData(email.value),
phone: inHTMLData(phone.value),
url: uriInSingleQuotedAttr(url.value),
logo: uriInSingleQuotedAttr(logo.value),
company: inHTMLData(company.value),
@ -224,7 +217,6 @@ export default contain({
locale,
description,
email,
phone,
url,
logo,
company,
@ -285,67 +277,6 @@ export default contain({
type='textarea'
value={ description.value }
wrapperClassName={ inputClass } />
<div className='divider'>
<h2>Tell us about your organization</h2>
</div>
<Input
bsStyle={ company.bsStyle }
label='Company Name'
labelClassName={ labelClass }
onChange={ (e) => handleChange('company', e) }
type='text'
value={ company.value }
wrapperClassName={ inputClass } />
<Input
bsStyle={ email.bsStyle }
label='Email'
labelClassName={ labelClass }
onChange={ (e) => handleChange('email', e) }
placeholder='you@yourcompany.com'
required={ true }
type='email'
value={ email.value }
wrapperClassName={ inputClass } />
<Input
bsStyle={ phone.bsStyle }
label='Phone'
labelClassName={ labelClass }
onChange={ (e) => handleChange('phone', e) }
placeholder='555-867-5309'
type='tel'
value={ phone.value }
wrapperClassName={ inputClass } />
<Input
bsStyle={ url.bsStyle }
label='URL'
labelClassName={ labelClass }
onChange={ (e) => handleChange('url', e) }
placeholder='http://freecodecamp.com'
type='url'
value={ url.value }
wrapperClassName={ inputClass } />
<Input
bsStyle={ logo.bsStyle }
label='Logo'
labelClassName={ labelClass }
onChange={ (e) => handleChange('logo', e) }
placeholder='http://freecatphotoapp.com/logo.png'
type='url'
value={ logo.value }
wrapperClassName={ inputClass } />
<div className='divider' />
<Input
checked={ isHighlighted.value }
label={ hightlightCopy }
onChange={
({ target: { checked } }) => handleForm({
isHighlighted: !!checked
})
}
type='checkbox'
wrapperClassName={ checkboxClass } />
<Input
checked={ isFrontEndCert.value }
label={ isFrontEndCopy }
@ -376,6 +307,62 @@ export default contain({
}
type='checkbox'
wrapperClassName={ checkboxClass } />
<Row>
<small>* { foo }</small>
</Row>
<div className='spacer' />
<div className='divider'>
<h2>Tell us about your organization</h2>
</div>
<Input
bsStyle={ company.bsStyle }
label='Company Name'
labelClassName={ labelClass }
onChange={ (e) => handleChange('company', e) }
type='text'
value={ company.value }
wrapperClassName={ inputClass } />
<Input
bsStyle={ email.bsStyle }
label='Email'
labelClassName={ labelClass }
onChange={ (e) => handleChange('email', e) }
placeholder='This is how we will contact you'
required={ true }
type='email'
value={ email.value }
wrapperClassName={ inputClass } />
<Input
bsStyle={ url.bsStyle }
label='URL'
labelClassName={ labelClass }
onChange={ (e) => handleChange('url', e) }
placeholder='http://yourcompany.com'
type='url'
value={ url.value }
wrapperClassName={ inputClass } />
<Input
bsStyle={ logo.bsStyle }
label='Logo'
labelClassName={ labelClass }
onChange={ (e) => handleChange('logo', e) }
placeholder='http://yourcompany.com/logo.png'
type='url'
value={ logo.value }
wrapperClassName={ inputClass } />
<div className='spacer' />
<Input
checked={ isHighlighted.value }
label={ hightlightCopy }
onChange={
({ target: { checked } }) => handleForm({
isHighlighted: !!checked
})
}
type='checkbox'
wrapperClassName={ checkboxClass } />
<div className='spacer' />
<Row>
<Col

View File

@ -5,25 +5,22 @@ import { Button, Panel, Col, Row } from 'react-bootstrap';
export default React.createClass({
displayName: 'NewJobCompleted',
propTypes: {
},
render() {
return (
<div>
<div className='text-center'>
<Panel>
<Row>
<h1 className='text-center'>
Job under review
<h1>
Your Position has Been Submitted
</h1>
</Row>
<Row>
<Col
md={ 6 }
mdOffset={ 3 }>
Congrats! Your job has been posted and is under review.
Once we review you job post we will publish it and you will receive
an email from us with a link to the listing.
Well review your listing and email you when its live.
<br />
Thank you for listing this job with Free Code Camp.
</Col>
</Row>
<div className='spacer' />

View File

@ -36,7 +36,7 @@ export default contain(
render() {
const { appActions, job, jobActions } = this.props;
if (!job || !job.position || job.description) {
if (!job || !job.position || !job.description) {
return <JobNotFound />;
}