<commit_before>import React from 'react'
import map from 'lodash/collection/map'
import {oxford, pluralize} from 'humanize-plus'

import CourseTitle from './courseTitle'
import studentActions from '../flux/studentActions'
import {semesterName} from 'sto-helpers'

function findSemesterList() {
	return [
		{id: 1, title: 'Fall 2012-13'},
		{id: 2, title: 'Interim 2012-13'},
		{id: 3, title: 'Spring 2012-13'},
	]
}

let ExpandedCourse = React.createClass({
	propTypes: {
		info: React.PropTypes.object,
		student: React.PropTypes.object,
		schedule: React.PropTypes.object,
	},

	removeFromSemester() {
		studentActions.removeCourse(this.props.student.id, this.props.schedule.id, this.props.info.clbid)
	},

	render() {
		let course = this.props.info
		let tools = []

		// /////

		let title = React.createElement(CourseTitle, this.props)

		let identifier = React.createElement('span',
			{className: 'identifier'},
			course.dept, ' ', course.num, course.sect)

		let professors = React.createElement('span',
			{className: 'professors'},
			oxford(course.profs))

		let summary = React.createElement('p',
			{className: 'summary'},
			identifier, professors)

		// /////

		let offerings = React.createElement('p',
			{className: 'offerings'},
			map(course.times,
				(time, idx) => React.createElement('span', {key: time + idx}, time)))

		let gereqs = React.createElement('ul',
			{className: 'gereqs'},
			map(course.gereqs,
				(ge, idx) => React.createElement('li', {key: ge + idx}, ge)))

		let description = React.createElement('p',
			{className: 'description'},
			course.desc)

		let credits = React.createElement('span',
			{className: 'credits'},
			`${course.credits} ${pluralize(course.credits, 'credit')}`)

		let classInstanceOffered = React.createElement('span',
			{className: 'instance'},
			`${semesterName(course.sem)} ${course.year}`)

		let info = React.createElement('p',
			{className: 'info'},
			credits, classInstanceOffered)

		let details = React.createElement('div',
			{className: 'details'},
			offerings, gereqs, description, info)

		// /////

		let semesterList = React.createElement('select',
			{className: 'semester-select', key: 'semester-select'},
			map(findSemesterList(), (s =>
				React.createElement('option', {value: s.id, key: s.id}, s.title))))
		tools.push(semesterList)

		let deleteButton = React.createElement('button', {className: 'remove-course', onClick: this.removeFromSemester, key: 'remove-course'}, 'Remove Course')
		if (this.props.schedule) {
			tools.push(deleteButton)
		}

		let toolsEls = React.createElement('div',
			{className: 'tools', onClick: (ev) => {ev.stopPropagation()}},
			tools)

		// /////

		return React.createElement('div', {className: 'info-rows'}, title, summary, details, toolsEls)
	},
})

export default ExpandedCourse<commit_msg>Split expandedCourse return across several lines<commit_after>import React from 'react'
import map from 'lodash/collection/map'
import {oxford, pluralize} from 'humanize-plus'

import CourseTitle from './courseTitle'
import studentActions from '../flux/studentActions'
import {semesterName} from 'sto-helpers'

function findSemesterList() {
	return [
		{id: 1, title: 'Fall 2012-13'},
		{id: 2, title: 'Interim 2012-13'},
		{id: 3, title: 'Spring 2012-13'},
	]
}

let ExpandedCourse = React.createClass({
	propTypes: {
		info: React.PropTypes.object,
		student: React.PropTypes.object,
		schedule: React.PropTypes.object,
	},

	removeFromSemester() {
		studentActions.removeCourse(this.props.student.id, this.props.schedule.id, this.props.info.clbid)
	},

	render() {
		let course = this.props.info
		let tools = []

		// /////

		let title = React.createElement(CourseTitle, this.props)

		let identifier = React.createElement('span',
			{className: 'identifier'},
			course.dept, ' ', course.num, course.sect)

		let professors = React.createElement('span',
			{className: 'professors'},
			oxford(course.profs))

		let summary = React.createElement('p',
			{className: 'summary'},
			identifier, professors)

		// /////

		let offerings = React.createElement('p',
			{className: 'offerings'},
			map(course.times,
				(time, idx) => React.createElement('span', {key: time + idx}, time)))

		let gereqs = React.createElement('ul',
			{className: 'gereqs'},
			map(course.gereqs,
				(ge, idx) => React.createElement('li', {key: ge + idx}, ge)))

		let description = React.createElement('p',
			{className: 'description'},
			course.desc)

		let credits = React.createElement('span',
			{className: 'credits'},
			`${course.credits} ${pluralize(course.credits, 'credit')}`)

		let classInstanceOffered = React.createElement('span',
			{className: 'instance'},
			`${semesterName(course.sem)} ${course.year}`)

		let info = React.createElement('p',
			{className: 'info'},
			credits, classInstanceOffered)

		let details = React.createElement('div',
			{className: 'details'},
			offerings, gereqs, description, info)

		// /////

		let semesterList = React.createElement('select',
			{className: 'semester-select', key: 'semester-select'},
			map(findSemesterList(), (s =>
				React.createElement('option', {value: s.id, key: s.id}, s.title))))
		tools.push(semesterList)

		let deleteButton = React.createElement('button', {className: 'remove-course', onClick: this.removeFromSemester, key: 'remove-course'}, 'Remove Course')
		if (this.props.schedule) {
			tools.push(deleteButton)
		}

		let toolsEls = React.createElement('div',
			{className: 'tools', onClick: (ev) => {ev.stopPropagation()}},
			tools)

		// /////

		return React.createElement('div',
			{className: 'info-rows'},
			title, summary, details, toolsEls)
	},
})

export default ExpandedCourse
{'fraction_non_alphanumeric': 0.16950940742043258, 'fraction_numerical': 0.0073852646386495515, 'mean_word_length': 4.276437847866419, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1659696', 'n_tokens_mistral': 2076, 'n_tokens_neox': 1778, 'n_words': 406}