Skip to content

Commit

Permalink
Merge pull request #25034 from code-dot-org/regional-partner-search-r…
Browse files Browse the repository at this point in the history
…efinements

PL regional partner search: refinements
  • Loading branch information
breville committed Sep 26, 2018
2 parents 0054ea4 + 89084af commit d0a6de7
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 29 deletions.
86 changes: 61 additions & 25 deletions apps/src/templates/RegionalPartnerSearch.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,30 @@
import React, { PropTypes, Component } from 'react';
import { connect } from 'react-redux';
import {WorkshopApplicationStates} from '@cdo/apps/generated/pd/sharedWorkshopConstants';

import UnsafeRenderedMarkdown from '@cdo/apps/templates/UnsafeRenderedMarkdown';
import $ from 'jquery';

const styles = {
heading: {
marginBottom: 5
},
form: {
marginTop: 20
},
schoolZipLabel: {
width: 150,
},
zipSubmit: {
marginTop: 20
},
noPartner: {
marginTop: 20
},
workshop: {
marginBottom: 20
}
};

class RegionalPartnerSearch extends Component {
static propTypes = {
responsiveSize: PropTypes.oneOf(['lg', 'md', 'sm', 'xs']).isRequired
Expand Down Expand Up @@ -57,31 +78,43 @@ class RegionalPartnerSearch extends Component {
const appState = partnerInfo && partnerInfo.application_state.state;
const appsOpenDate = partnerInfo && partnerInfo.application_state.earliest_open_date;

const applicationLink = (partnerInfo && partnerInfo.link_to_partner_application) ||
"https://studio.code.org/pd/application/teacher";
let applicationLink, applicationLinkTarget;
if (partnerInfo && partnerInfo.link_to_partner_application) {
applicationLink = partnerInfo.link_to_partner_application;
applicationLinkTarget = "_blank";
} else {
applicationLink = "https://studio.code.org/pd/application/teacher";
applicationLinkTarget = null;
}

return (
<div>
<h2>Ready to apply?</h2>
<h2 style={styles.heading}>Ready to apply?</h2>
<div>Our Regional Partners offer local workshops throughout the United States. Enter your location to find a workshop near you.</div>

<form onSubmit={this.handleZipSubmit}>
<label>
School Zip Code:
<input type="text" value={this.state.zipValue} onChange={this.handleZipChange} />
</label>
<div>
<form onSubmit={this.handleZipSubmit} style={styles.form}>
<label style={styles.schoolZipLabel}>School Zip Code:</label>
<input type="text" value={this.state.zipValue} onChange={this.handleZipChange} />
<div style={styles.zipSubmit}>
<input type="submit" value="Submit" />
</div>
</form>

{this.state.noPartner || partnerInfo && (
<h3>Regional Partner hosting the Professional Development Program in this region:</h3>
<h3>Code.org Regional Partner for your region:</h3>
)}

{this.state.noPartner && (
<div>
<div>There is no Regional Partner in your region. While we cannot guarantee availability, you can still apply should a space in a nearby region become available.</div>
<div>Applications open January 15, 2019</div>
<div style={styles.noPartner}>
<p>We do not yet have a Regional Partner in your area. However, we have a number of partners in nearby states or regions who may have space available in their program. If you are willing to travel, please fill out the application. We'll let you know if we can find you a nearby spot in the program!</p>
<p>If we find a spot, we'll let you know the workshop dates and program fees (if applicable) so you can decide at that point if it is something your school can cover.</p>
<p>
All of our curriculum, tools, and courses are also available for your school at no cost.
{' '}
<a href="https://code.org/educate/curriculum/3rd-party">Or, contact one of these computer science providers</a>
{' '}
for other Professional Development options in your area.</p>
<p>Applications open January 15, 2019.</p>
</div>
)}

Expand All @@ -102,34 +135,37 @@ class RegionalPartnerSearch extends Component {
</div>
)}

<h3>Summer workshop(s):</h3>
<h3>Workshop information:</h3>
{workshopCollections[0].workshops.length === 0 && workshopCollections[1].workshops.length === 0 && (
<div>Summer workshop dates and locations are TBD</div>
<div>Workshop date and location information coming soon.</div>
)}

{workshopCollections.map((collection, collectionIndex) => collection.workshops.length > 0 && (
<div key={collectionIndex}>
<h4>{collection.heading}</h4>
{collection.workshops.map((workshop, index) => (
<div key={index}>
<div key={index} style={styles.workshop}>
<div>{workshop.workshop_date_range_string}</div>
<div>{workshop.location_name}</div>
<div>{workshop.location_address}</div>
</div>
))}
</div>
))}
<div>In addition to the summer workshop, the professional learning program includes 4 workshops (dates TBD) and online support throughout the the year.</div>

<h3>Cost and scholarship information:</h3>
<div>In addition to attending a five-day summer workshop, the professional learning program includes up to 4 one-day, in-person academic year workshops during the 2019-20 school year. Academic year workshop dates will be finalized and shared by your Regional Partner.</div>

{partnerInfo.cost_scholarship_information && (
<div>{partnerInfo.cost_scholarship_information}</div>
<div>
<h3>Cost and scholarship information:</h3>
<UnsafeRenderedMarkdown markdown={partnerInfo.cost_scholarship_information}/>
</div>
)}

{partnerInfo.additional_program_information && (
<div>
<h3>Additional Program Information:</h3>
<div>{partnerInfo.additional_program_information}</div>
<h3>Additional program information:</h3>
<UnsafeRenderedMarkdown markdown={partnerInfo.additional_program_information}/>
</div>
)}

Expand All @@ -138,18 +174,18 @@ class RegionalPartnerSearch extends Component {
)}

{appState === WorkshopApplicationStates.currently_open && (
<a href={applicationLink}>
<a href={applicationLink} target={applicationLinkTarget}>
<button>Start application</button>
</a>
)}

{appState === WorkshopApplicationStates.opening_at && (
<div>Applications open {appsOpenDate}</div>
<div>Applications will open on {appsOpenDate}.</div>
)}

{appState === WorkshopApplicationStates.opening_sometime && (
<div>
<div>Applications will be open soon.</div>
<h3>Program information and the application for this region will be available soon!</h3>
<a href="https://studio.code.org/pd/regional_partner_contact/new">
<button>
Tell me when applications open
Expand Down
4 changes: 3 additions & 1 deletion dashboard/test/factories/pd_factories.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@

factory :regional_partner_alabama, parent: :regional_partner_with_summer_workshops do
mappings {[create(:pd_regional_partner_mapping, state: "AL")]}
cost_scholarship_information "Some **important** information about scholarships."
additional_program_information "And some _additional_ program information."
end

factory :regional_partner_illinois, parent: :regional_partner_with_summer_workshops do
Expand Down Expand Up @@ -124,7 +126,7 @@
end

factory :regional_partner_beverly_hills, parent: :regional_partner_with_summer_workshops do
mappings {[create(:pd_regional_partner_mapping, zip_code: "90210")]}
mappings {[create(:pd_regional_partner_mapping, zip_code: "90210", state: nil)]}
end

factory :pd_ended_workshop, parent: :pd_workshop, class: 'Pd::Workshop' do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ social:
## New to computer science? No worries!

Whether you are new to teaching computer science (CS) or have experience teaching other CS courses, the Code.org Professional Learning Program offers year round support. We've designed this program to promote growth by providing space for you to become comfortable with curricular materials, CS content, and pedagogy.
<br>

<br>
The program supports teachers with diverse teaching backgrounds as they prepare to teach either of the following courses:

[col-50]
Expand Down Expand Up @@ -68,9 +68,11 @@ The Code.org Professional Learning Program is open to teachers who are intereste
<img src="/images/professional-learning/pl_timeline.png" width="100%"/>

## Ready to apply?
Regional Partners throughout the US are hosting the professional learning program in your area.
Regional Partners throughout the US are hosting the professional learning program in your area.

Enter your zip code below to get details about the professional learning program in your local region.
<br/>

<%= view :regional_partner_search %>

<%= view :answerdash %>

0 comments on commit d0a6de7

Please sign in to comment.