Created
June 2, 2015 09:54
-
-
Save pierr/41ea2fa0a8f6d8e4d974 to your computer and use it in GitHub Desktop.
detail.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*global React, Focus */ | |
//Récupération des dépendances. | |
var createDetail = Focus.components.page.createDetail; | |
var Detail = Focus.components.common.detail.component; | |
//Blocs composants la page. | |
var MovieDetails = require('./movieDetails'); | |
var Castings = require('./castings'); | |
var MovieProducers = require('./movieProducers'); | |
var MovieDirectors = require('./movieDirectors'); | |
var MoviePictures = require('./moviePictures'); | |
//Composants du cartouche | |
var SummaryMovie = React.createClass({ | |
render: function(){return (<div>SUMMARY {this.props.id || 'no Id'} ..............</div>); } | |
}); | |
var CartridgeMovie = require('./cartridge'); | |
/** | |
* Page représentant le détail de la fiche d'un film. | |
*/ | |
module.exports = createDetail({ | |
displayName: 'MovieView', | |
cartridgeConfiguration: function() { | |
var props = {id: this.props.id, hasForm: false}; | |
return { | |
summary: {component: SummaryMovie, props: props}, | |
cartridge: {component: CartridgeMovie, props: props}, | |
actions: { | |
primary: [ | |
{label: 'imprimer', onClick: ()=>{console.log('action'); }, className: 'print'}, | |
{label: 'archiver', onClick: ()=>{console.log('archiver'); }, className: 'archive'} | |
], | |
secondary: [ | |
{label: 'imprimer Secondaire', onClick: ()=>{console.log('action'); }, className: 'print'}, | |
{label: 'archiver', onClick: ()=>{console.log('archiver'); }, className: 'archive'}] | |
} | |
}; | |
}, | |
render: function renderMovieView() { | |
return ( | |
<Detail> | |
<MovieDetails id={this.props.id}/> | |
<Castings id={this.props.id}/> | |
<MovieProducers id={this.props.id}/> | |
<MovieDirectors id={this.props.id}/> | |
<MoviePictures id={this.props.id}/> | |
</Detail> | |
); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment