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 79 vm.DialogaService.getEvents().then(function(data) {
80 80 vm.$log.debug('getEvents.success', data);
81 81 vm.events = data.articles;
82   -
  82 + vm.featuredEvent = vm.events[0];
83 83 }, function(error) {
84 84 vm.$log.debug('Error on getEvents.', error);
85 85 vm.eventsError = error;
... ... @@ -165,6 +165,15 @@
165 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 177 InicioPageController.prototype.submitSearch = function() {
169 178 var vm = this;
170 179  
... ...
src/app/pages/inicio/inicio.html
... ... @@ -5,7 +5,12 @@
5 5 <div class="col-md-8" ng-class="{'col-md-offset-2': !pageInicio.featuredEvent}">
6 6 <div class="video-player js-youtube">
7 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 14 <div class="video-background" ng-click="pageInicio.showVideo()">
10 15 <div class="video-thumbnail" aria-hidden="true" style="background-image:url(/assets/images/youtube-background.png)"></div>
11 16 <button class="video-play-button" aria-live="assertive" aria-label="Assistir o vídeo tutorial Dialoga Brasil">
... ... @@ -22,15 +27,16 @@
22 27 <h2 class="box-title">Bate papo com <b>MINISTROS/AS</b></h2>
23 28 </div>
24 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 34 </div>
27 35 </div>
28 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 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 40 </div>
35 41 <div class="clearfix"></div>
36 42 </div>
... ...
src/app/pages/inicio/inicio.scss
... ... @@ -53,9 +53,9 @@
53 53 padding: 0;
54 54  
55 55 .video {
  56 + cursor: pointer;
56 57 width: 100%;
57 58 min-height: 125px;
58   - background-color: #4A4A0E;
59 59 background-size: cover;
60 60 background-position: center;
61 61 }
... ... @@ -84,7 +84,7 @@
84 84 border-radius: 20px;
85 85 }
86 86  
87   - p { padding: 10px 0;}
  87 + .description { padding: 10px 0;}
88 88 }
89 89  
90 90 @media screen and (min-width: $screen-lg) {
... ...