Skip to content
This repository was archived by the owner on Sep 28, 2023. It is now read-only.

Feature basic workshop #160

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions app/components/Navigation/Navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Grid, Row, Col } from 'react-flexbox-grid';
import Button from '../../components/Button/Button';
import classnames from 'classnames';
import { connect } from 'react-redux';
import { Menu } from 'react-feather';
import { Menu } from 'react-feather';
import JavazoneLogo from '../../assets/2018/javazone2018_logo_small.svg';
import './Navigation.less';

Expand Down Expand Up @@ -140,6 +140,7 @@ class Navigation extends React.Component<NavigationProps, NavigationState> {
<NavItem active={this.isActiveNavItem("/tickets")} link="/tickets">TICKETS</NavItem>
<NavItem active={this.isActiveNavItem("/speakers")} link="/speakers">SPEAKERS</NavItem>
<NavItem active={this.isActiveNavItem("/program")} link="/program">PROGRAM</NavItem>
<NavItem active={this.isActiveNavItem("/workshops")} link="/workshops">WORKSHOPS</NavItem>
<NavItem active={this.isActiveNavItem("/partners")} link="/partners">PARTNERS</NavItem>
<NavItem active={this.isActiveNavItem("/journeyzone")} link="/journeyzone">JOURNEYZONE</NavItem>
{/*
Expand Down Expand Up @@ -196,4 +197,4 @@ function mapStateToProps(store: Object) {
}
}

export default connect(mapStateToProps)(Navigation);
export default connect(mapStateToProps)(Navigation);
12 changes: 11 additions & 1 deletion app/pages/Program/ProgramDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Page from '../../components/Page/Page.js';
import Loader from '../../components/Loader/Loader.js';
import { Section } from '../../components/Section/Section.js';
import PageHeader from '../../components/PageHeader/PageHeader.js';
import { Link } from '../../components/link';
import { LeftBlock } from '../../components/Block/Block.js';
import { PageHeading, Container } from '../../components/page';
import { Block, Header, Content } from '../../components/block';
Expand Down Expand Up @@ -76,6 +77,7 @@ class ProgramDetails extends React.Component<ProgramDetailsProps, ProgramDetails
const audience = this.state.session.intendedAudience;
const language = this.state.session.language;
const format = this.transformFormat(this.state.session.format);
const registerLoc = this.state.session.registerLoc;
if (this.state.session.title === undefined) {
return (
<Page name='programDetails'>
Expand Down Expand Up @@ -105,6 +107,7 @@ class ProgramDetails extends React.Component<ProgramDetailsProps, ProgramDetails
{audience}
</p>
</LeftBlock>

<LeftBlock header="Language">
<p class="too-small">
{language === 'en' ? 'English' : 'Norwegian'}
Expand All @@ -115,6 +118,13 @@ class ProgramDetails extends React.Component<ProgramDetailsProps, ProgramDetails
{format}
</p>
</LeftBlock>
{registerLoc ?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: You can use a inline conditional if with the following syntax if you only care about one branch:
{condition && <div />

<LeftBlock header="Want to attend?">
<p>
<Link href={registerLoc}>Register here</Link>
</p>
</LeftBlock> : null
}
</Section>
</Page>
)
Expand All @@ -139,4 +149,4 @@ function mapDispatchToProps(dispatch: Dispatch<*>) {

export default {
component: connect(mapStateToProps, mapDispatchToProps)(ProgramDetails)
};
};
46 changes: 22 additions & 24 deletions app/pages/Workshops/Workshops.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function workshopUrl(workshop) {
if (!workshop) {
return '#';
}
return `https://javazone.no/moosehead/#/register/${workshop.id}`;
return `https://moosehead.javazone.no/#/register/${workshop.mooseheadId}`;
}

function workshopClass(workshop) {
Expand All @@ -67,39 +67,39 @@ function workshopClass(workshop) {
}

switch (workshop.status) {
case 'FREE_SPOTS':
case 'FREE_SPOTS':
return 'button--green';
case 'FEW_SPOTS':
case 'FEW_SPOTS':
return 'button--yellow';
case 'FULL':
case 'FULL':
return 'button--red';
case 'VERY_FULL':
case 'VERY_FULL':
return 'button--red';
case 'CLOSED':
case 'CLOSED':
return 'button--disabled';
default:
default:
return 'button--disabled';
}
}

function workshopStatus(workshop) {
if (!workshop) {
return 'Opens at September 1st, 12.00';
return 'Opens at August 6th, 13:00';
}

switch (workshop.status) {
case 'FREE_SPOTS':
case 'FREE_SPOTS':
return 'Registration open';
case 'FEW_SPOTS':
case 'FEW_SPOTS':
return 'Few spots left';
case 'FULL':
case 'FULL':
return 'Waiting list';
case 'VERY_FULL':
case 'VERY_FULL':
return 'No more spots';
case 'CLOSED':
case 'CLOSED':
return 'Registration closed';
default:
return 'Opens at September 1st, 12.00';
default:
return 'Opens at August 6th, 13:00';
}
}

Expand Down Expand Up @@ -135,14 +135,12 @@ function SimpleSessionList(props: SimpleSessionListProps) {
</Col>
</Row>
<Row>
<span>Status: </span> {workshopStatus(workshop)}
<p>&nbsp;</p>
</Row>
</Col>
{workshop.status === 'CLOSED'
? null
: <Col>
<Row>
<Button alternate link={workshopUrl(workshop)} >Register</Button>
</Col>}
</Row>
</Col>
</Row>
</div>
})
Expand All @@ -167,14 +165,14 @@ class Workshops extends React.Component<WorkshopsProps, WorkshopsState> {
super(props);
}

componentWillMount() {
componentDidMount() {
this.props.getWorkshops();
this.props.getSessions();
}

render() {
const filteredWorkshops = this.props.sessions.filter(session => session.format === 'workshop');
const content = this.props.failure
const content = this.props.failure
? <Section class="program-loader" dark><Loader /></Section>
: <SimpleSessionList workshops={filteredWorkshops} />;
return (
Expand All @@ -183,7 +181,7 @@ class Workshops extends React.Component<WorkshopsProps, WorkshopsState> {
<Section>
<CenterBlock>
<p>
For those of you who want to make the most of their JavaZone ticket we offer a selection of hands-on workshops that take place the day before JavaZone officially begins. To ensure a positive learning experience we’ve limited the spaces on each workshop, so you’ll have to register to secure your place. Registration opens at noon on Friday the 1st of September, so put a reminder in your calendar!
For those of you who want to make the most of their JavaZone ticket we offer a selection of hands-on workshops that take place the day before JavaZone officially begins. To ensure a positive learning experience we’ve limited the spaces on each workshop, so you’ll have to register to secure your place. Registration opens at 13:00 on Monday August 6th, so put a reminder in your calendar!
</p>
</CenterBlock>
</Section>
Expand Down
2 changes: 1 addition & 1 deletion app/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const routes = compile({
'/academy/bergen': academyLocation(academyData.bergen),
'/kids': kids,
'/speakers': speakers,
//'/workshops': workshops,
'/workshops': workshops,
'/speakers/monetary-policy': monetaryPolicy,
'/speakers/tips': tipsAndTricks,
'/tickets': tickets,
Expand Down