Commit 261f3aa09ab8c0dc1087bc14f107fae66e4706a3

Authored by Leonardo Merlin
1 parent 4d6ba201

fix: show featured event into main area

src/app/pages/inicio/inicio.controller.js
@@ -79,7 +79,7 @@ @@ -79,7 +79,7 @@
79 vm.DialogaService.getEvents().then(function(data) { 79 vm.DialogaService.getEvents().then(function(data) {
80 vm.$log.debug('getEvents.success', data); 80 vm.$log.debug('getEvents.success', data);
81 vm.events = data.articles; 81 vm.events = data.articles;
82 - 82 + vm.featuredEvent = vm.events[0];
83 }, function(error) { 83 }, function(error) {
84 vm.$log.debug('Error on getEvents.', error); 84 vm.$log.debug('Error on getEvents.', error);
85 vm.eventsError = error; 85 vm.eventsError = error;
@@ -165,6 +165,15 @@ @@ -165,6 +165,15 @@
165 vm.article.videoIsLoaded = true; 165 vm.article.videoIsLoaded = true;
166 }; 166 };
167 167
  168 + InicioPageController.prototype.showEventVideo = function() {
  169 + var vm = this;
  170 +
  171 + hideBackground(0); // force to hide
  172 +
  173 + vm.featuredEvent.canView = true;
  174 + vm.featuredEvent.bodyTrusted = vm.$sce.trustAsHtml(vm.featuredEvent.body);
  175 + };
  176 +
168 InicioPageController.prototype.submitSearch = function() { 177 InicioPageController.prototype.submitSearch = function() {
169 var vm = this; 178 var vm = this;
170 179
src/app/pages/inicio/inicio.html
@@ -5,7 +5,12 @@ @@ -5,7 +5,12 @@
5 <div class="col-md-8" ng-class="{'col-md-offset-2': !pageInicio.featuredEvent}"> 5 <div class="col-md-8" ng-class="{'col-md-offset-2': !pageInicio.featuredEvent}">
6 <div class="video-player js-youtube"> 6 <div class="video-player js-youtube">
7 <div class="embed-responsive embed-responsive-16by9"> 7 <div class="embed-responsive embed-responsive-16by9">
8 - <div class="js-iframe" ng-if="pageInicio.article.videoIsLoaded" ng-bind-html="pageInicio.article.abstractTrusted"></div> 8 + <div ng-if="!pageInicio.featuredEvent || !pageInicio.featuredEvent.canView">
  9 + <div class="js-iframe" ng-if="pageInicio.article.videoIsLoaded" ng-bind-html="pageInicio.article.abstractTrusted"></div>
  10 + </div>
  11 + <div ng-if="pageInicio.featuredEvent && pageInicio.featuredEvent.canView">
  12 + <div class="js-iframe" ng-bind-html="pageInicio.featuredEvent.bodyTrusted"></div>
  13 + </div>
9 <div class="video-background" ng-click="pageInicio.showVideo()"> 14 <div class="video-background" ng-click="pageInicio.showVideo()">
10 <div class="video-thumbnail" aria-hidden="true" style="background-image:url(/assets/images/youtube-background.png)"></div> 15 <div class="video-thumbnail" aria-hidden="true" style="background-image:url(/assets/images/youtube-background.png)"></div>
11 <button class="video-play-button" aria-live="assertive" aria-label="Assistir o vídeo tutorial Dialoga Brasil"> 16 <button class="video-play-button" aria-live="assertive" aria-label="Assistir o vídeo tutorial Dialoga Brasil">
@@ -22,15 +27,16 @@ @@ -22,15 +27,16 @@
22 <h2 class="box-title">Bate papo com <b>MINISTROS/AS</b></h2> 27 <h2 class="box-title">Bate papo com <b>MINISTROS/AS</b></h2>
23 </div> 28 </div>
24 <div class="box-middle col-xs-12 col-sm-4 col-md-12"> 29 <div class="box-middle col-xs-12 col-sm-4 col-md-12">
25 - <div class="video" style="background-image: url(/assets/images/event-video-area.png)"> 30 + <div class="video"
  31 + ng-style="{'background-image': 'url(' + pageInicio.featuredEvent.image.url + ')'}"
  32 + ng-click="pageInicio.showEventVideo()"
  33 + >
26 </div> 34 </div>
27 </div> 35 </div>
28 <div class="box-bottom col-xs-12 col-sm-4 col-md-12"> 36 <div class="box-bottom col-xs-12 col-sm-4 col-md-12">
29 - <div class="date">DD/MM/YYYY</div> 37 + <div class="date">{{pageInicio.featuredEvent.start_date | date : "dd/MM/yyyy"}}</div>
30 <div class="live">AO VIVO</div> 38 <div class="live">AO VIVO</div>
31 - <p>  
32 - Lorem ipsum dolor sit amet, mei at facete constituto partiendo et.  
33 - </p> 39 + <div class="description" ng-bind-html="pageInicio.featuredEvent.abstract"></div>
34 </div> 40 </div>
35 <div class="clearfix"></div> 41 <div class="clearfix"></div>
36 </div> 42 </div>
src/app/pages/inicio/inicio.scss
@@ -53,9 +53,9 @@ @@ -53,9 +53,9 @@
53 padding: 0; 53 padding: 0;
54 54
55 .video { 55 .video {
  56 + cursor: pointer;
56 width: 100%; 57 width: 100%;
57 min-height: 125px; 58 min-height: 125px;
58 - background-color: #4A4A0E;  
59 background-size: cover; 59 background-size: cover;
60 background-position: center; 60 background-position: center;
61 } 61 }
@@ -84,7 +84,7 @@ @@ -84,7 +84,7 @@
84 border-radius: 20px; 84 border-radius: 20px;
85 } 85 }
86 86
87 - p { padding: 10px 0;} 87 + .description { padding: 10px 0;}
88 } 88 }
89 89
90 @media screen and (min-width: $screen-lg) { 90 @media screen and (min-width: $screen-lg) {