Skip to content

Commit

Permalink
Language fix & percentage ui fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Murali Suresh committed Jan 26, 2017
1 parent a5c48ff commit 4d49b15
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 28 deletions.
38 changes: 26 additions & 12 deletions reactJS/app/components/EventPageComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ let styles = {
},
m_style: {

},
percentange_box: {
padding: "10px",
backgroundColor: "rgb(245, 245, 245)",
borderRadius: "10px"
},
selected_circle: {
textShadow: "rgb(59, 255, 59) 0px 0px 5px"
Expand Down Expand Up @@ -373,8 +378,7 @@ class EventPageComponent extends Component {
"44" : "wi wi-cloud",
"45" : "wi wi-storm-showers",
"46" : "wi wi-rain-mix",
"47" : "wi wi-storm-showers",
"3200" : "wi wi-na"
"47" : "wi wi-storm-showers"
};
if (this.props.weather.length === 0) {
// when weather information from yahoo is not available. render dates alone.
Expand Down Expand Up @@ -757,16 +761,14 @@ class EventPageComponent extends Component {

}


free_count=String((free_count*100)/total) + "%";
maybe_count=String((maybe_count*100)/total)+ "%";
busy_count=String((busy_count*100)/total)+ "%";
free_count=parseFloat(((free_count*100)/total).toFixed(1)).toString() + "%";
maybe_count=parseFloat(((maybe_count*100)/total).toFixed(1)).toString() + "%";
busy_count=parseFloat(((busy_count*100)/total).toFixed(1)).toString() + "%";

let weatherdates = this.renderWithOrWithoutWeather();

return (


<div className = 'row'>
<div className='col-sm-offset-2 col-sm-8 col-xs-12'>
<Card expandable={true}>
Expand All @@ -780,10 +782,22 @@ class EventPageComponent extends Component {
/>
<CardText expandable={true}>

<div className = 'row center-xs'>
<div className = 'col-xs-4'>Free: {free_count}</div>
<div className = 'col-xs-4'>Maybe: {maybe_count}</div>
<div className = 'col-xs-4'>Busy: {busy_count}</div>
<div className = 'row center-xs' style={styles.percentange_box}>
<div className = 'col-xs-4'>
<FontIcon className = 'material-icons' color = {green500} > panorama_fish_eye </FontIcon>
<br></br>
<span>{free_count}</span>
</div>
<div className = 'col-xs-4'>
<FontIcon className = 'material-icons' color = {yellow800} > change_history </FontIcon>
<br></br>
<span>{maybe_count}</span>
</div>
<div className = 'col-xs-4'>
<FontIcon className = 'material-icons' color = {red500} > clear </FontIcon>
<br></br>
<span>{busy_count}</span>
</div>
</div>
<br></br>
<div className = 'row'><div style={styles.chipwrapper}>{this.MobileAttendeeChips("free",freelist)}{this.MobileAttendeeChips("maybe",maybelist)}{this.MobileAttendeeChips("busy",busylist)}</div></div>
Expand Down Expand Up @@ -929,7 +943,7 @@ class EventPageComponent extends Component {
{this.dateToggleSection(false)}
<br />
<div className='row center-xs'>
<RaisedButton label='Register' labelColor={grey50} style={buttonStyle} backgroundColor={grey900} disabled={this.checkDisableFlag()} onTouchTap={this.registerAttendee} />
<RaisedButton label={this.props.languageJson.register} labelColor={grey50} style={buttonStyle} backgroundColor={grey900} disabled={this.checkDisableFlag()} onTouchTap={this.registerAttendee} />
</div>
</div>
);
Expand Down
16 changes: 3 additions & 13 deletions reactJS/app/components/RegisterComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,6 @@ class RegisterComponent extends Component {
(this.props.dateArray.indexOf(date.format('ddd, MMM Do YYYY')) == -1)
? this.props.dispatch(storeDateArray(date.format('ddd, MMM Do YYYY')))
: this.props.dispatch(popDateArray(date.format('ddd, MMM Do YYYY')));

// Limit the date selection as 6

// if (this.props.dateArray.length <= 5) {
// (this.props.dateArray.indexOf(date.format('ddd, MMM Do YYYY')) == -1)
// ? this.props.dispatch(storeDateArray(date.format('ddd, MMM Do YYYY')))
// : console.log("Duplicate date");
// } else {
// this.props.dispatch(storeDateArrayErrorLabel(this.props.languageJson.dateArrayExcessErrorLabel));
// }
}

storeLocation(location) {
Expand Down Expand Up @@ -269,10 +259,10 @@ class RegisterComponent extends Component {
margin: '12px 16px',
marginTop: '25px'
}}>
{step > 0 && (<FlatButton label="Back" disabled={stepIndex === 0} disableTouchRipple={true} disableFocusRipple={true} onTouchTap={this.stepDecrease}/>)}
{step > 0 && (<FlatButton label={this.props.languageJson.back} disabled={stepIndex === 0} disableTouchRipple={true} disableFocusRipple={true} onTouchTap={this.stepDecrease}/>)}
<RaisedButton label={stepIndex === 2
? 'Register'
: 'Next'} disableTouchRipple={true} disableFocusRipple={true} primary={true} onTouchTap={this.stepIncrease} style={{
? this.props.languageJson.register
: this.props.languageJson.next} disableTouchRipple={true} disableFocusRipple={true} primary={true} onTouchTap={this.stepIncrease} style={{
marginRight: 12
}}/>
</div>
Expand Down
5 changes: 3 additions & 2 deletions reactJS/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"header": "Coming Or Not?",
"nameErrorLabel": "Only 40 characters permitted!!!",
"purposeErrorLabel": "Only 100 characters permitted!!!",
"dateArrayExcessErrorLabel": "Only 6 dates permitted",
"dateArrayEmptyErrorLabel": "No dates selected!!",
"nameErrorLabelRequired": "We need your name",
"purposeErrorLabelRequired": "Example: Funeral party",
Expand All @@ -12,9 +11,11 @@
"calendarLabel": "Select the Dates for the Event",
"geosuggestPlaceholder": "Enter the restaurant location here!",
"register": "Register",
"next": "Next",
"back": "Back",
"shareLabel": "Share the Event Url with your friends",
"eventPageButton": "Event Page",
"attendeeNameErrorLabel": "Name field is required!!",
"attendeeNameErrorLabel": "Name field is required",
"attendeeNameErrorLabelDuplicate": "Name already exists!! Please enter another name",
"dateSelectionLabel": "Enter your convenient Dates",
"dateCastSelectionLabel": "Cast your attendance for the above days by pressing the button",
Expand Down
25 changes: 24 additions & 1 deletion reactJS/jp.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
{

"header": "Coming Or Not?",
"nameErrorLabel": "Only 40 characters permitted!!!",
"purposeErrorLabel": "Only 100 characters permitted!!!",
"dateArrayEmptyErrorLabel": "No dates selected!!",
"nameErrorLabelRequired": "あなたの名前が必要です",
"purposeErrorLabelRequired": "例:葬式",
"name": "主催者名 *",
"attendeeName": "",
"purpose": "イベント名 *",
"calendarLabel": "Select the Dates for the Event",
"geosuggestPlaceholder": "Enter the restaurant location here!",
"register": "登録",
"next": "次へ",
"back": "戻る",
"shareLabel": "Share the Event Url with your friends",
"eventPageButton": "イベントページ",
"attendeeNameErrorLabel": "あなたの名前が必要です",
"attendeeNameErrorLabelDuplicate": "Name already exists!! Please enter another name",
"dateSelectionLabel": "Enter your convenient Dates",
"dateCastSelectionLabel": "Cast your attendance for the above days by pressing the button",
"eventInformationPartOne": " is organizing ",
"eventInformationPartTwo": ". Please cast your available Dates!!",
"eventTableLabel": "The Event Table",
"numberOfPeopleLabel": "No of people casted votes: "
}

0 comments on commit 4d49b15

Please sign in to comment.