Skip to content

Commit

Permalink
Started publications page. Component for side bar nav. Some team page…
Browse files Browse the repository at this point in the history
… content updates
  • Loading branch information
Sarah Allen committed Jun 18, 2015
1 parent 1c7893f commit 5a23bed
Show file tree
Hide file tree
Showing 11 changed files with 244 additions and 77 deletions.
2 changes: 1 addition & 1 deletion app/main.cjsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ routes = <Route handler={App}>
<Route name="about" handler={require './pages/about'} ignoreScrollBehavior>
<DefaultRoute name="aboutIndex" handler={require './pages/about'} />
<Route name="team" path="team" handler={require './pages/team-page'} />
<Route name="publications" path="publications" handler={require './pages/about'} />
<Route name="publications" path="publications" handler={require './pages/publications-page'} />
</Route>

<Route name="reset-password" handler={require './pages/reset-password'} />
Expand Down
15 changes: 8 additions & 7 deletions app/pages/about.cjsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Translate = require 'react-translate-component'
{Link} = require 'react-router'
Markdown = require '../components/markdown'
TeamPage = require './team-page'
PublicationsPage = require './publications-page'

counterpart.registerTranslations 'en',
about:
Expand Down Expand Up @@ -68,8 +69,6 @@ counterpart.registerTranslations 'en',
Many of the most interesting discoveries from Zooniverse projects
have come from discussion between volunteers and researchers.
We encourage all users to join the conversation on the discussion boards for more in-depth participation.'''
team: 'the team!'
publications: 'publications'

module.exports = React.createClass
displayName: 'AboutPage'
Expand All @@ -90,7 +89,6 @@ module.exports = React.createClass
componentWillUnmount: ->
document.documentElement.classList.remove 'on-secondary-page'

# May pull out hero and nav section out into its own reusable component
render: ->
<div className="secondary-page about-page">
<section className="hero about-hero">
Expand All @@ -104,10 +102,13 @@ module.exports = React.createClass
</div>
</section>
<section className="about-page-content content-container">
{if @state.activeTab is 'team'
<TeamPage />
else
<Markdown>{counterpart "about.pageContent.#{@state.activeTab}"}</Markdown>
{switch @state.activeTab
when 'team'
<TeamPage />
when 'publications'
<PublicationsPage />
else
<Markdown>{counterpart "about.pageContent.#{@state.activeTab}"}</Markdown>
}
</section>
</div>
154 changes: 154 additions & 0 deletions app/pages/publications-page.cjsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
counterpart = require 'counterpart'
React = require 'react'
Translate = require 'react-translate-component'
AboutSideBar = require '../partials/about-side-bar'
apiClient = require '../api/client'
PromiseRenderer = require '../components/promise-renderer'

counterpart.registerTranslations 'en',
publications:
nav:
space: 'Space'
climate: 'Climate'
humanities: 'Humanities'
nature: 'Nature'
biology: 'Biology'
physics: 'Physics'
meta: 'Meta'
showAll: 'Show All'

publicationCategories =
space: [
{citation: "Galaxy Zoo: the effect of bar-driven fueling on the presence of an active galactic nucleus in disc galaxies, Galloway+ 2015."
href: "http://arxiv.org/abs/1502.01033"
slug: "galaxy-zoo"
},
{citation: "Galaxy Zoo: Evidence for Diverse Star Formation Histories through the Green Valley, Smethurst+ 2015."
href: "http://mnras.oxfordjournals.org/content/450/1/435.full.pdf+html"
slug: "galaxy-zoo"
},
{citation: "Galaxy Zoo: the dependence of the star formation-stellar mass relation on spiral disc morphology, Willett+ 2015."
href: "http://mnras.oxfordjournals.org/cgi/content/full/stv307?ijkey=n2t0XjSn37YTbrU&keytype=ref"
slug: "galaxy-zoo"
},
{citation: "Galaxy Zoo: Are Bars Responsible for the Feeding of Active Galactic Nuclei at 0.2 < z < 1.0?, Cheung+ 2014."
href: "http://adsabs.harvard.edu/abs/2014arXiv1409.5434C"
slug: "galaxy-zoo"
},
{citation: "Galaxy Zoo: The Ultraviolet Attenuation Law in Backlit Spiral Galaxies, Keel+ 2014."
href: "http://arxiv.org/abs/1401.0773"
slug: "galaxy-zoo"
},
{citation: "HST Imaging of Fading AGN Candidates I: Host-Galaxy Properties and Origin of the Extended Gas, Keel+ 2014."
href: "http://arxiv.org/abs/1408.5159"
slug: "galaxy-zoo"
},
{citation: "Galaxy Zoo: an independent look at the evolution of the bar fraction over the last eight billion years from HST-COSMOS, Melvin+ 2014."
href: "http://mnras.oxfordjournals.org/content/438/4/2882"
slug: "galaxy-zoo"
},
{citation: "The green valley is a red herring: Galaxy Zoo reveals two evolutionary pathways towards quenching of star formation in early- and late-type galaxies, Schawinski+ 2014."
href: "http://arxiv.org/abs/1402.4814"
slug: "galaxy-zoo"
},
{citation: "Galaxy Zoo: CANDELS barred discs and bar fractions, Simmons+ 2014."
href: "http://mnras.oxfordjournals.org/content/445/4/3466"
slug: "galaxy-zoo"
},
{citation: "Galaxy Zoo: quantifying morphological indicators of galaxy interaction, Casteels+ 2013."
href: "http://adsabs.harvard.edu/abs/2013MNRAS.429.1051C"
slug: "galaxy-zoo"
},
{citation: "Galaxy Zoo: Observing Secular Evolution Through Bars, Cheung+ 2013."
href: "http://arxiv.org/abs/1310.2941"
slug: "galaxy-zoo"
},
{citation: "Galaxy Zoo: A Catalog of Overlapping Galaxy Pairs for Dust Studies, Keel+ 2013."
href: "http://adsabs.harvard.edu/abs/2013PASP..125....2K"
slug: "galaxy-zoo"
},
{citation: "The different star-formation histories of blue and red spiral and elliptical galaxies, Tojeiro+ 2013."
href: "http://adsabs.harvard.edu/abs/2013arXiv1303.3551T"
slug: "galaxy-zoo"
},
{citation: "Galaxy Zoo 2: detailed morphological classifications for 304,122 galaxies from the Sloan Digital Sky Survey, Willett+ 2013."
href: "http://arxiv.org/abs/1308.3496"
slug: "galaxy-zoo"
},
{citation: "Galaxy Zoo: building the low-mass end of the red sequence with local post-starburst galaxies, Wong+ 2013."
href: "http://adsabs.harvard.edu/abs/2012MNRAS.420.1684W"
slug: "galaxy-zoo"
},
{citation: "Spheroidal post-mergers in the local Universe, Carpineti+ 2012."
href: "http://adsabs.harvard.edu/abs/2012MNRAS.420.2139C"
slug: "galaxy-zoo"
},
{citation: "Polar ring galaxies in the Galaxy Zoo, Finkelman+ 2012."
href: "http://adsabs.harvard.edu/abs/2012MNRAS.422.2386F"
slug: "galaxy-zoo"
},
{citation: "The fraction of early-type galaxies in low-redshift groups and clusters of galaxies, Hoyle+ 2012."
href: "http://adsabs.harvard.edu/abs/2012MNRAS.423.3478H"
slug: "galaxy-zoo"
},
{citation: "Galaxy Zoo: dust and molecular gas in early-type galaxies with prominent dust lanes, Kaviraj+ 2012."
href: "http://adsabs.harvard.edu/abs/2012MNRAS.423...49K"
slug: "galaxy-zoo"
},
{citation: "The Galaxy Zoo survey for giant AGN-ionized clouds: past and present black hole accretion events, Keel+ 2012."
href: "http://adsabs.harvard.edu/abs/2012MNRAS.420..878K"
slug: "galaxy-zoo"
}
{citation: "Galaxy Zoo and ALFALFA: atomic gas and the regulation of star formation in barred disc galaxies, Masters+ 2012."
href: "http://adsabs.harvard.edu/abs/2012MNRAS.424.2180M"
slug: "galaxy-zoo"
},
{citation: "Galaxy Zoo: dust lane early-type galaxies are tracers of recent gas-rich minor mergers, Shabala+ 2012."
href: "http://adsabs.harvard.edu/abs/2012MNRAS.423...59S"
slug: "galaxy-zoo"
}
],
# climate: [
# ],
# humanities: [
# ],
# nature: [
# ],
# biology: [
# ],
# physics: [
# ],
# meta: [
# ]

module.exports = React.createClass
displayName: 'PublicationsPage'

getInitialState: ->
currentSort: 'showAll'

render: ->
sideBarNavList = counterpart "publications.nav"
<div className="publications-page">
<AboutSideBar showList={@showPublicationsList} sideBarNav={sideBarNavList} currentSort={@state.currentSort} translations={counterpart "publications"} />
<section className="publications-list">
{for category, publications of publicationCategories
if @state.currentSort is category
<ul key={category}>
{for publication, i in publications
<li key="publication-#{i}" className="publication-item">
<PromiseRenderer promise={apiClient.type('projects').get(slug: publication.slug).get('avatar')} pending={null}
then={(avatar) => <img src={avatar.src} alt="Project avatar" />}
catch={=> <img src="./assets/simple-pattern.jpg" alt="Placeholder avatar" />} />
<strong>{publication.citation}</strong><br />
<a href={publication.href} target="_blank">Available here.</a>
</li>
}
</ul>
}
</section>
</div>

showPublicationsList: (navItem) ->
currentButton = React.findDOMNode(@refs[navItem])
@setState currentSort: navItem
52 changes: 14 additions & 38 deletions app/pages/team-page.cjsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
counterpart = require 'counterpart'
React = require 'react'
Translate = require 'react-translate-component'
Markdown = require '../components/markdown'
AboutSideBar = require '../partials/about-side-bar'

counterpart.registerTranslations 'en',
team:
Expand Down Expand Up @@ -35,8 +35,8 @@ counterpart.registerTranslations 'en',
her PhD in Ecology, Evolution, and Behavior at the University of Minnesota in 2014,
and has since joined the Zooniverse as a Postdoc in Ecology and Citizen Science.'''
andreaSimenstad:
title: 'Title'
bio: '''Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.'''
title: 'Developer'
bio: '''Andrea joined Zooniverse as a developer at the University of Minnesota in 2015. When she is not captivated by code, she can be found enjoying snow on skis and exploring lakes by kayak. She graduated from Carleton College with a degree in Cognitive Science.'''
brianCarstensen:
title: 'UX Developer'
bio: '''Brian Carstensen recently moved from Chicago to Oxford. Brian has a degree
Expand All @@ -59,8 +59,8 @@ counterpart.registerTranslations 'en',
bio: '''Chris Snyder began working on the Zooniverse team in fall 2012 as a web developer. In July 2013,
he became the technical project manager. He received a degree in computer science from the University of Dayton.'''
christopherDoogue:
title: 'Title'
bio: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.'
title: 'Project Assistant'
bio: '''Chris has been happily supporting the Zooniverse Oxford team since Sep. 2014. He has been with the Department of Astrophysics for over 2 years administratively supporting various projects. A former trained actor, he has the ability to look like he's smiling in the face of adversity!'''
colemanKrawczyk:
title: 'Data Scientist'
bio: '''Coleman is helping to create new data analysis and visualization tools for existing Zooniverse
Expand Down Expand Up @@ -133,9 +133,6 @@ counterpart.registerTranslations 'en',
michaelParrish:
title: 'Rails/Backend Developer'
bio: '''Software developer at the Zooniverse. Dog, fishing, snakes, and bourbon.'''
perryRoper:
title: 'Title'
bio: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.'
rebeccaSmethurst:
title: 'Researcher'
bio: '''Becky is an astrophysicist working towards her doctorate in Oxford. She is
Expand All @@ -160,11 +157,11 @@ counterpart.registerTranslations 'en',
A former researcher and software developer at NASA Ames, he received degrees in both
computer science and mechanical engineering.'''
simoneDuca:
title: 'Title'
bio: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.'
title: 'Web Developer'
bio: '''Simone is a front end web developer at the Zooniverse. He has a Phd in logic and philosophy from Bristol and loves cooking.'''
veronicaMaidel:
title: 'Title'
bio: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.'
title: 'Data Scientist'
bio: '''Veronica is a Data Scientist who works on discovering patterns in Zooniverse data, by manipulating it and using it to create machine learning models. She received a PhD in Information Science and Technology from Syracuse University.'''
victoriaVanHyning:
title: 'Researcher'
bio: '''Victoria is a Digital Humanities postdoc for the Zooniverse. She holds a masters
Expand Down Expand Up @@ -346,12 +343,6 @@ teamMembers =
bio: counterpart "team.content.michaelParrish.bio"
image: "./assets/team/michael.png"
location: "chicago"
perryRoper:
name: "Perry Roper"
title: counterpart "team.content.perryRoper.title"
bio: counterpart "team.content.perryRoper.bio"
image: "http://placehold.it/80x80"
location: "oxford"
rebeccaSmethurst:
name: "Rebecca Smethurst"
twitter: "becky1505"
Expand Down Expand Up @@ -411,20 +402,10 @@ module.exports = React.createClass
getInitialState: ->
currentSort: 'showAll'

componentDidMount: ->
button = React.findDOMNode(@refs.showAll)
@updateButtonState button

render: ->
sideBarNav = counterpart "team.nav"
<div className="team-page">
<aside className="side-bar">
<nav ref="sideBarNav">
{for navItem of sideBarNav
<button key={navItem} ref={navItem} className="secret-button" onClick={@showPeopleList.bind(null, navItem)}><Translate content="team.nav.#{navItem}" /></button>
}
</nav>
</aside>
sideBarNavList = counterpart "team.nav"
<div className="team-page secondary-page-copy">
<AboutSideBar showList={@showPeopleList} sideBarNav={sideBarNavList} currentSort={@state.currentSort} translations={counterpart "team"} />
<section className="team-member-list">
<h2>{if @state.currentSort is 'showAll'
<Translate content="team.content.header.showAll" />
Expand All @@ -436,7 +417,7 @@ module.exports = React.createClass
<div key={teamMember} className="team-member">
<img src={details.image} alt="#{details.name}" />
<div className="team-member-details">
<h4>{details.name}, {details.title} {if details.twitter then <a href="http://twitter.com/#{details.twitter}" target="_blank"><i className="fa fa-twitter"></i></a> }</h4>
<h3>{details.name}, {details.title} {if details.twitter then <a href="http://twitter.com/#{details.twitter}" target="_blank"><i className="fa fa-twitter"></i></a> }</h3>
<p>{details.bio}</p>
</div>
</div>
Expand All @@ -446,11 +427,6 @@ module.exports = React.createClass

showPeopleList: (navItem) ->
currentButton = React.findDOMNode(@refs[navItem])
@setState currentSort: navItem, @updateButtonState(currentButton)
@setState currentSort: navItem

updateButtonState: (currentButton) ->
buttons = React.findDOMNode(@refs.sideBarNav).childNodes
for button in buttons
button.classList.remove 'active'
currentButton.classList.add 'active'

31 changes: 31 additions & 0 deletions app/partials/about-side-bar.cjsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
counterpart = require 'counterpart'
React = require 'react'
Translate = require 'react-translate-component'

module.exports = React.createClass
displayName: 'AboutSideBar'

componentDidMount: ->
@updateButtonState @props.currentSort

componentWillReceiveProps: (nextProps) ->
if nextProps.currentSort isnt @props.currentSort
@updateButtonState(nextProps.currentSort)

render: ->
counterpart.registerTranslations 'en', @props.translations.nav

<aside className="secondary-page-side-bar">
<nav ref="sideBarNav">
{for navItem of @props.sideBarNav
<button key={navItem} ref={navItem} className="secret-button side-bar-button" onClick={@props.showList.bind(null, navItem)}><Translate content="#{navItem}" /></button>
}
</nav>
</aside>

updateButtonState: (currentSort) ->
buttons = React.findDOMNode(@refs.sideBarNav).childNodes
currentButton = React.findDOMNode(@refs[currentSort])
for button in buttons
button.classList.remove 'active'
currentButton.classList.add 'active'
1 change: 1 addition & 0 deletions css/common.styl
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,4 @@ $generic-heading
letter-spacing: 0.1em
opacity: 0.7
text-transform: uppercase

7 changes: 4 additions & 3 deletions css/main-header.styl
Original file line number Diff line number Diff line change
Expand Up @@ -163,17 +163,18 @@
background-size: cover
box-sizing: border-box
height: 250px
padding: 9em 3vw 1em
padding: 13.5em 3vw 1em

.hero-container
margin: 0 auto
max-width: 960px

h1
color: white
font-size: 2.25em
font-size: 3.375em
font-weight: 400
margin-bottom: 0.675em
line-height: 1.5em
margin-bottom: 0.75em

.hero-nav
a
Expand Down
1 change: 1 addition & 0 deletions css/main.styl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
@require "./owned-list-pages"
@require "./about-page"
@require "./team-page"
@require "./publications-page"

@require "./project-page"
@require './dashboard'
Expand Down
2 changes: 2 additions & 0 deletions css/publications-page.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.publications-page
display: block
Loading

0 comments on commit 5a23bed

Please sign in to comment.