Commit 64b93207dfe6e56c2b915c51e3fa091e88a7d2bb
1 parent
1236933e
Exists in
master
and in
4 other branches
Refact: get proposal image from body attribute
Showing
2 changed files
with
13 additions
and
1 deletions
Show diff stats
src/app/pages/programas/programa.controller.js
| ... | ... | @@ -120,6 +120,18 @@ |
| 120 | 120 | // TODO: load and show proposal response |
| 121 | 121 | } |
| 122 | 122 | } |
| 123 | + | |
| 124 | + // HACK: get image from body 'proposal' | |
| 125 | + // remove tags html | |
| 126 | + for (var j = vm.proposalsTopRated.length - 1; j >= 0; j--) { | |
| 127 | + var proposalTopRated = vm.proposalsTopRated[j]; | |
| 128 | + if (proposalTopRated && proposalTopRated.body && proposalTopRated.body.length > 0) { | |
| 129 | + proposalTopRated.body = String(proposalTopRated.body).replace(/<[^>]+>/gm, ''); | |
| 130 | + }else{ | |
| 131 | + proposalTopRated.body = vm.banner.src; | |
| 132 | + } | |
| 133 | + } | |
| 134 | + | |
| 123 | 135 | }, function(error) { |
| 124 | 136 | vm.$log.error(error); |
| 125 | 137 | vm.loadingTopProposals = false; | ... | ... |
src/app/pages/programas/programa.html
| ... | ... | @@ -234,7 +234,7 @@ |
| 234 | 234 | <div class="container"> |
| 235 | 235 | <div class="row"> |
| 236 | 236 | <div class="col-sm-4 col-md-3"> |
| 237 | - <div class="img-mask--container" ng-style="{'background-image':'url( {{::pagePrograma.banner.src}} )'}"> | |
| 237 | + <div class="img-mask--container" ng-style="{'background-image':'url( {{::proposal.body}} )'}"> | |
| 238 | 238 | <div class="img-mask--background"> |
| 239 | 239 | <div class="icon icon-programa-respondido"> |
| 240 | 240 | <div class="icon-circle"> | ... | ... |