Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Commit

Permalink
Merge pull request #330 from Rostlab/character-infos
Browse files Browse the repository at this point in the history
Added more character-infos to the detail page.
  • Loading branch information
yashha committed Apr 8, 2016
2 parents 58de543 + 0615b5a commit a7f1336
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/components/common/CharacterDetails/CharacterDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,24 @@ let {Component} = React;
export default class CharacterDetails extends Component {

render() {
var details = ["age","house","titles","dateOfDeath","placeOfDeath","books"];
var details = ["age","titles","house","culture","spouse","mother","father","dateOfDeath","placeOfDeath","books","actor"];
var detail;
var result = [];
var meta = "";
for(detail of details){
if(detail in this.props.data && this.props.data[detail].length > 1){
switch (detail) {
case "age" : meta = "Age"; break;
case "house" : meta = "House"; break;
case "titles" : meta = "Titles"; break;
case "house" : meta = "House"; break;
case "culture" : meta = "Culture"; break;
case "spouse" : meta = "Spouse"; break;
case "mother" : meta = "Mother"; break;
case "father" : meta = "Father"; break;
case "dateOfDeath" : meta = "Date of death"; break;
case "placeOfDeath" : meta = "Place of death"; break;
case "books" : meta = "Books"; break;
case "actor" : meta = "Actor"; break;
default: break;
}
result.push({key: meta, value: (this.props.data[detail]).toString().replace(new RegExp(',', 'g'), ', ').replace(new RegExp(''', 'g'), '\'')});
Expand Down

0 comments on commit a7f1336

Please sign in to comment.