Commit 83328847592b460a75075c95cc96968d2ebdadcc
1 parent
25d25c66
Exists in
master
and in
8 other branches
Add 'participe' action to proposal-related
Showing
2 changed files
with
15 additions
and
1 deletions
Show diff stats
src/app/components/proposal-related/proposal-related.directive.js
| ... | ... | @@ -9,10 +9,11 @@ |
| 9 | 9 | function proposalRelated() { |
| 10 | 10 | |
| 11 | 11 | /** @ngInject */ |
| 12 | - function ProposalRelatedController($log) { | |
| 12 | + function ProposalRelatedController($state, $log) { | |
| 13 | 13 | $log.debug('ProposalRelatedController'); |
| 14 | 14 | |
| 15 | 15 | var vm = this; |
| 16 | + vm.$state = $state; | |
| 16 | 17 | vm.$log = $log; |
| 17 | 18 | |
| 18 | 19 | vm.init(); |
| ... | ... | @@ -23,6 +24,16 @@ |
| 23 | 24 | // var vm = this; |
| 24 | 25 | }; |
| 25 | 26 | |
| 27 | + ProposalRelatedController.prototype.showContent = function (program) { | |
| 28 | + var vm = this; | |
| 29 | + | |
| 30 | + vm.$state.go('programa-conteudo', { | |
| 31 | + slug: program.slug | |
| 32 | + }, { | |
| 33 | + location: true | |
| 34 | + }); | |
| 35 | + }; | |
| 36 | + | |
| 26 | 37 | var directive = { |
| 27 | 38 | restrict: 'E', |
| 28 | 39 | templateUrl: 'app/components/proposal-related/proposal-related.html', | ... | ... |
src/app/components/proposal-related/proposal-related.html
| ... | ... | @@ -7,6 +7,9 @@ |
| 7 | 7 | <div class="proposal-related--content"> |
| 8 | 8 | <div class="proposal-related--content-inner" ng-bind-html="vm.proposal.abstract"></div> |
| 9 | 9 | </div> |
| 10 | + <div class="proposal-related--join"> | |
| 11 | + <button class="btn btn-link" ng-click="vm.showContent(vm.topic)">Participe</button> | |
| 12 | + </div> | |
| 10 | 13 | <div class="proposal-related--actions text-center"> |
| 11 | 14 | <div class="row"> |
| 12 | 15 | <div class="col-xs-4"> | ... | ... |