Commit d5650319f2f5915e365f1e4b87fee898966bce4a

Authored by Leonardo Merlin
1 parent 9098b4a1

Event list always show the subscribe button

src/app/components/event-list/event-list.directive.js
... ... @@ -40,9 +40,15 @@
40 40 vm.isCollapsed = !vm.isCollapsed;
41 41 };
42 42  
43   - EventListController.prototype.subscribe = function (event_id) {
  43 + EventListController.prototype.subscribe = function (event) {
44 44 var vm = this;
45 45  
  46 + if(event.isOld){
  47 + vm.$log.debug('Event already happened. Abort.');
  48 + return;
  49 + }
  50 +
  51 + var event_id = event.id;
46 52 vm.$log.debug('event_id', event_id);
47 53  
48 54 if(!vm.$rootScope.currentUser){
... ...
src/app/components/event-list/event-list.html
... ... @@ -40,22 +40,22 @@
40 40 </span>
41 41 </div>
42 42 <div class="col-xs-12 col-sm-4 col-md-5 vcenter">
43   - <span class="description">{{::event.title}}</span>
  43 + <span class="description">{{::event.title.split('-')[0]}}</span>
44 44 </div>
45 45 <!-- <div class="col-xs-12 col-sm-4 col-md-3 text-center vcenter">
46 46 <span class="theme">{{::event.categories[0].name}}</span>
47 47 </div> -->
48 48 <div class="col-xs-12 col-sm-4 col-md-4 text-right vcenter" style="padding-right: 20px;">
49 49 <div class="row">
50   - <div class="col-xs-6 text-right" ng-class="{'col-xs-12': event.isOld}">
  50 + <div class="col-xs-6 text-right">
51 51 <div ng-if="event.followers_count > 50">
52 52 <b>{{::event.followers_count}}</b>
53 53 <br/>
54 54 <span>Inscritos</span>
55 55 </div>
56 56 </div>
57   - <div class="col-xs-6" ng-if="!event.isOld">
58   - <button type="button" class="btn color-theme-common-bg" ng-click="vm.subscribe(event.id)">
  57 + <div class="col-xs-6">
  58 + <button type="button" class="btn color-theme-common-bg btn-disabled" disabled ng-click="vm.subscribe(event)">
59 59 Inscreva-se
60 60 <span class="sr-only">no bate-papo com (ministro) no dia {event.start_date | date : "dd/MM/yyyy"}} as {{event.start_date | date : "HH:mm"}} horas</span>
61 61 </button>
... ...
src/app/components/event-list/event-list.scss
... ... @@ -31,7 +31,7 @@
31 31  
32 32 .row-level-1 {
33 33 // height: 48px;
34   - line-height: 30px;
  34 + line-height: 20px;
35 35 padding: 5px 0;
36 36 border-bottom: 1px solid #ccc;
37 37 }
... ...