Commit d5650319f2f5915e365f1e4b87fee898966bce4a
1 parent
9098b4a1
Exists in
master
and in
8 other branches
Event list always show the subscribe button
Showing
3 changed files
with
12 additions
and
6 deletions
Show diff stats
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> | ... | ... |