@@ -15,20 +15,22 @@ export default Ember.Controller.extend({
1515 actorNames : Ember . computed . map ( 'model.actors' , function ( actor ) {
1616 return actor . get ( 'name' ) . split ( ' ' ) [ 0 ] + ' ' ;
1717 } ) ,
18- hasGoodRating : Ember . computed . gt ( 'model.review' , 9 ) ,
18+ /* hasGoodRating: Ember.computed.gt('model.review', 9), */
19+ hasGoodRating : function ( ) {
20+ var rate = this . get ( 'container' ) . lookup ( 'application:main' ) . get ( 'awardRate' ) ;
21+ return this . get ( 'model.review' ) >= rate ;
22+ } . property ( 'model.review' ) ,
1923 checkReviewChanged : function ( e ) {
20- if ( e . target . router . activeTransition === null ) {
21- console . log ( 'Observers' ) ;
22- var amount = this . get ( 'reviewCountChanged' ) ;
23- console . log ( amount ) ;
24- amount ++ ;
25- this . set ( 'reviewCountChanged' , amount ) ;
26- if ( amount === 3 ) {
27- alert ( 'OBSERVERS - Wait! Do you have any doubts about the movie? then... watch it again! :)' ) ;
24+ if ( e . target . router . activeTransition === null ) {
25+ var amount = this . get ( 'reviewCountChanged' ) ;
26+ amount ++ ;
27+ this . set ( 'reviewCountChanged' , amount ) ;
28+ if ( amount === 3 ) {
29+ alert ( this . get ( 'i18n' ) . current . reviewChangedValidation ) ;
30+ this . set ( 'reviewCountChanged' , 0 ) ;
31+ }
32+ } else {
2833 this . set ( 'reviewCountChanged' , 0 ) ;
2934 }
30- } else {
31- this . set ( 'reviewCountChanged' , 0 ) ;
32- }
33- } . observes ( 'model.review' )
35+ } . observes ( 'model.review' )
3436} ) ;
0 commit comments