From 9bc14d24a40260910201cf938af5eb24b917f0db Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Sun, 26 Jul 2015 07:56:35 -0700 Subject: [PATCH] Display contact information for job and size thumbnail --- common/app/routes/Jobs/components/List.jsx | 11 -------- common/app/routes/Jobs/components/Show.jsx | 33 +++++++++++++++++++--- common/models/job.json | 10 +++++-- seed/jobs.json | 3 +- 4 files changed, 38 insertions(+), 19 deletions(-) delete mode 100644 common/app/routes/Jobs/components/List.jsx diff --git a/common/app/routes/Jobs/components/List.jsx b/common/app/routes/Jobs/components/List.jsx deleted file mode 100644 index 946a8380bd..0000000000 --- a/common/app/routes/Jobs/components/List.jsx +++ /dev/null @@ -1,11 +0,0 @@ -import React, { PropTypes } from 'react'; - -export default React.createClass({ - displayName: 'JobsList', - propTypes: { - foo: PropTypes.string - }, - render() { - return null; - } -}); diff --git a/common/app/routes/Jobs/components/Show.jsx b/common/app/routes/Jobs/components/Show.jsx index bd970d0a4f..716341fa15 100644 --- a/common/app/routes/Jobs/components/Show.jsx +++ b/common/app/routes/Jobs/components/Show.jsx @@ -1,6 +1,7 @@ import React, { PropTypes } from 'react'; import { contain } from 'thundercats-react'; -import { Accordion, Thumbnail, Panel } from 'react-bootstrap'; +import { Accordion, Thumbnail, Panel, Well } from 'react-bootstrap'; +import moment from 'moment'; export default contain( { @@ -13,8 +14,24 @@ export default contain( }, renderJobs(jobs =[]) { + const thumbnailStyle = { + backgroundColor: 'white', + maxHeight: '200px', + maxWidth: '200px' + }; return jobs.map(( - { id, company, position, description, logo }, + { + id, + company, + position, + description, + logo, + city, + state, + email, + phone, + postedOn + }, index ) => { const header = ( @@ -33,9 +50,17 @@ export default contain( eventKey={ index } header={ header } key={ id }> - + + + Location: { city }, { state } +
+ Contact: { email || phone || 'N/A' } +
+ Posted On: { moment(postedOn).format('MMMM Do, YYYY') } +

{ description }

- ); }); diff --git a/common/models/job.json b/common/models/job.json index beaf973805..12473628cc 100644 --- a/common/models/job.json +++ b/common/models/job.json @@ -16,7 +16,10 @@ "city": { "type": "string" }, - "contact": { + "email": { + "type": "string" + }, + "phone": { "type": "string" }, "state": { @@ -40,8 +43,9 @@ "isPaid": { "type": "boolean" }, - "createdOn": { - "type": "date" + "postedOn": { + "type": "date", + "defaultFn": "now" } }, "validations": [], diff --git a/seed/jobs.json b/seed/jobs.json index 041a54f16f..5850dc8aba 100644 --- a/seed/jobs.json +++ b/seed/jobs.json @@ -2,6 +2,7 @@ { "id": "bd7167d8c441cbafaeb5bdef", "email": "Ada_Gerlach@gmail.com", + "phone": "1-140-557-0727", "company": "Livestream", "country": "Singapore", "city": "Morar berg", @@ -23,7 +24,7 @@ }, { "id": "bd7167d8c443cbafaeb5bdef", - "email": "Ada_Gerlach@gmail.com", + "phone": "1-140-557-0727", "company": "Bookspan", "country": "Singapore", "city": "Morar berg",