Commit b762a318730dd9f80994f107d57cdf64d76ae256
1 parent
a779ab01
Exists in
master
and in
6 other branches
Fix social-share. Add missing params (image, url, title, etc.)
Showing
5 changed files
with
46 additions
and
22 deletions
Show diff stats
src/app/components/proposal-box/proposal-box.directive.js
@@ -205,9 +205,23 @@ | @@ -205,9 +205,23 @@ | ||
205 | return vm.$state.href('programa', { | 205 | return vm.$state.href('programa', { |
206 | slug: vm.topic.slug, | 206 | slug: vm.topic.slug, |
207 | proposal_id: vm.proposal.id, | 207 | proposal_id: vm.proposal.id, |
208 | + }, { | ||
209 | + absolute: true | ||
208 | }); | 210 | }); |
209 | }; | 211 | }; |
210 | 212 | ||
213 | + ProposalBoxController.prototype.getSocialText = function() { | ||
214 | + var vm = this; | ||
215 | + | ||
216 | + return vm.proposal.abstract; | ||
217 | + }; | ||
218 | + | ||
219 | + ProposalBoxController.prototype.getSocialImage = function() { | ||
220 | + var vm = this; | ||
221 | + | ||
222 | + return vm.$rootScope.basePath + vm.topic.image.url; | ||
223 | + }; | ||
224 | + | ||
211 | var directive = { | 225 | var directive = { |
212 | restrict: 'E', | 226 | restrict: 'E', |
213 | templateUrl: 'app/components/proposal-box/proposal-box.html', | 227 | templateUrl: 'app/components/proposal-box/proposal-box.html', |
src/app/components/proposal-box/proposal-box.html
@@ -30,10 +30,10 @@ | @@ -30,10 +30,10 @@ | ||
30 | <span class="icon icon-social-share" aria-hidden="true"></span> | 30 | <span class="icon icon-social-share" aria-hidden="true"></span> |
31 | </button> | 31 | </button> |
32 | <social-share | 32 | <social-share |
33 | - url="vm.getSocialUrl()" | ||
34 | - text="vm.getSocialText()" | ||
35 | - image="vm.getSocialImage()" | ||
36 | - class="dropdown-menu dropdown-menu-right ng-isolate-scope"></social-share> | 33 | + social-url="vm.getSocialUrl()" |
34 | + social-text="vm.getSocialText()" | ||
35 | + social-image="vm.getSocialImage()" | ||
36 | + class="dropdown-menu dropdown-menu-right"></social-share> | ||
37 | </div> | 37 | </div> |
38 | </div> | 38 | </div> |
39 | <div class="col-xs-6 feedback--next"> | 39 | <div class="col-xs-6 feedback--next"> |
@@ -184,6 +184,11 @@ | @@ -184,6 +184,11 @@ | ||
184 | <div class="dropdown"> | 184 | <div class="dropdown"> |
185 | <button id="dropdown-share-btn" class="btn btn-link dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" aria-label="Mostrar ou esconder a lista redes sociais para compartilhamento"><span class="icon icon-social-share-small" aria-hidden="true"></span></button> | 185 | <button id="dropdown-share-btn" class="btn btn-link dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" aria-label="Mostrar ou esconder a lista redes sociais para compartilhamento"><span class="icon icon-social-share-small" aria-hidden="true"></span></button> |
186 | <social-share class="dropdown-menu dropdown-menu-right"></social-share> | 186 | <social-share class="dropdown-menu dropdown-menu-right"></social-share> |
187 | + <social-share | ||
188 | + social-url="vm.getSocialUrl()" | ||
189 | + social-text="vm.getSocialText()" | ||
190 | + social-image="vm.getSocialImage()" | ||
191 | + class="dropdown-menu dropdown-menu-right"></social-share> | ||
187 | </div> | 192 | </div> |
188 | </div> | 193 | </div> |
189 | <div class="proposal-box--ranking"> | 194 | <div class="proposal-box--ranking"> |
src/app/components/social-share/social-share.directive.js
@@ -11,10 +11,11 @@ | @@ -11,10 +11,11 @@ | ||
11 | restrict: 'E', | 11 | restrict: 'E', |
12 | templateUrl: 'app/components/social-share/social-share.html', | 12 | templateUrl: 'app/components/social-share/social-share.html', |
13 | scope: { | 13 | scope: { |
14 | - url: '=', | ||
15 | - image: '=', | ||
16 | - text: '=', | ||
17 | - arrowClass: '@', | 14 | + socialVia: '=', |
15 | + socialUrl: '=', | ||
16 | + socialImage: '=', | ||
17 | + socialText: '=', | ||
18 | + arrowClass: '@' | ||
18 | }, | 19 | }, |
19 | controller: SocialShareController, | 20 | controller: SocialShareController, |
20 | controllerAs: 'vm', | 21 | controllerAs: 'vm', |
@@ -27,7 +28,13 @@ | @@ -27,7 +28,13 @@ | ||
27 | function SocialShareController($log) { | 28 | function SocialShareController($log) { |
28 | $log.debug('SocialShareController'); | 29 | $log.debug('SocialShareController'); |
29 | 30 | ||
30 | - // var vm = this; | 31 | + var vm = this; |
32 | + | ||
33 | + vm.socialVia = vm.socialVia || "687948707977695"; // 476168325877872 | ||
34 | + vm.socialUrl = vm.socialUrl || "http://dialoga.gov.br/"; | ||
35 | + vm.socialImage = vm.socialImage || "http://dialoga.gov.br/images/logo.png"; | ||
36 | + vm.socialText = vm.socialText || "Conheça o Dialoga Brasil. Dialoga Brasil | O País fica melhor quando VOCÊ PARTICIPA."; | ||
37 | + | ||
31 | } | 38 | } |
32 | } | 39 | } |
33 | 40 |
src/app/components/social-share/social-share.html
@@ -3,17 +3,15 @@ | @@ -3,17 +3,15 @@ | ||
3 | </div> | 3 | </div> |
4 | <ul class="social-share list-inline"> | 4 | <ul class="social-share list-inline"> |
5 | <li> | 5 | <li> |
6 | - <!-- socialshare-via="687948707977695" dialoga --> | ||
7 | - <!-- socialshare-via="476168325877872" MyApp / Test --> | ||
8 | <a href="#" role="button" | 6 | <a href="#" role="button" |
9 | socialshare | 7 | socialshare |
10 | socialshare-provider="facebook" | 8 | socialshare-provider="facebook" |
11 | socialshare-type="feed" | 9 | socialshare-type="feed" |
12 | - socialshare-via="687948707977695" | ||
13 | - socialshare-url="http://dialoga.gov.br" | 10 | + socialshare-via="vm.socialVia" |
11 | + socialshare-url="vm.socialUrl" | ||
14 | socialshare-redirect-uri="https://dialoga.gov.br/" | 12 | socialshare-redirect-uri="https://dialoga.gov.br/" |
15 | - socialshare-media="http://dialoga.gov.br/images/logo.png" | ||
16 | - socialshare-text="Conheça o Dialoga Brasil. Dialoga Brasil | O País fica melhor quando VOCÊ PARTICIPA." | 13 | + socialshare-media="vm.socialImage" |
14 | + socialshare-text="vm.socialText" | ||
17 | title="Compartilhar no Facebook"> | 15 | title="Compartilhar no Facebook"> |
18 | <span aria-hidden="true" class="icon-circle icon-small icon-circle-social-facebook"><span class="icon icon-social-facebook"></span></span> | 16 | <span aria-hidden="true" class="icon-circle icon-small icon-circle-social-facebook"><span class="icon icon-social-facebook"></span></span> |
19 | <span class="sr-only">Compartilhar no Facebook</span> | 17 | <span class="sr-only">Compartilhar no Facebook</span> |
@@ -23,8 +21,8 @@ | @@ -23,8 +21,8 @@ | ||
23 | <a href="#" role="button" | 21 | <a href="#" role="button" |
24 | socialshare | 22 | socialshare |
25 | socialshare-provider="twitter" | 23 | socialshare-provider="twitter" |
26 | - socialshare-url="http://dialoga.gov.br" | ||
27 | - socialshare-text="Conheça o Dialoga Brasil. Dialoga Brasil | O País fica melhor quando VOCÊ PARTICIPA." | 24 | + socialshare-url="vm.socialUrl" |
25 | + socialshare-text="vm.socialText" | ||
28 | socialshare-hastags="dialogabrasil" | 26 | socialshare-hastags="dialogabrasil" |
29 | title="Compartilhar no Twitter"> | 27 | title="Compartilhar no Twitter"> |
30 | <span aria-hidden="true" class="icon-circle icon-small icon-circle-social-twitter"><span class="icon icon-social-twitter"></span></span> | 28 | <span aria-hidden="true" class="icon-circle icon-small icon-circle-social-twitter"><span class="icon icon-social-twitter"></span></span> |
@@ -35,8 +33,8 @@ | @@ -35,8 +33,8 @@ | ||
35 | <a href="#" role="button" | 33 | <a href="#" role="button" |
36 | socialshare | 34 | socialshare |
37 | socialshare-provider="google+" | 35 | socialshare-provider="google+" |
38 | - socialshare-url="http://dialoga.gov.br" | ||
39 | - socialshare-text="Conheça o Dialoga Brasil. Dialoga Brasil | O País fica melhor quando VOCÊ PARTICIPA." | 36 | + socialshare-url="vm.socialUrl" |
37 | + socialshare-text="vm.socialText" | ||
40 | title="Compartilhar no Google Plus"> | 38 | title="Compartilhar no Google Plus"> |
41 | <span aria-hidden="true" class="icon-circle icon-small icon-circle-social-googleplus"><span class="icon icon-social-googleplus"></span></span> | 39 | <span aria-hidden="true" class="icon-circle icon-small icon-circle-social-googleplus"><span class="icon icon-social-googleplus"></span></span> |
42 | <span class="sr-only">Compartilhar no Google Plus</span> | 40 | <span class="sr-only">Compartilhar no Google Plus</span> |
src/app/pages/programas/programa.html
@@ -46,9 +46,9 @@ | @@ -46,9 +46,9 @@ | ||
46 | <div class="dropdown"> | 46 | <div class="dropdown"> |
47 | <button id="dropdown-share-btn" class="btn btn-link dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" aria-label="Mostrar ou esconder a lista redes sociais para compartilhamento"><span class="icon icon-social-share-small" aria-hidden="true"></span></button> | 47 | <button id="dropdown-share-btn" class="btn btn-link dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" aria-label="Mostrar ou esconder a lista redes sociais para compartilhamento"><span class="icon icon-social-share-small" aria-hidden="true"></span></button> |
48 | <social-share | 48 | <social-share |
49 | - url="" | ||
50 | - text="" | ||
51 | - image="" | 49 | + social-url="pagePrograma.$state.href('programa', {slug: pagePrograma.article.slug}, {absolute: true})" |
50 | + social-text="pagePrograma.article.title" | ||
51 | + social-image="pagePrograma.banner.src" | ||
52 | arrow-class="social-share--arrow" | 52 | arrow-class="social-share--arrow" |
53 | class="dropdown-menu dropdown-menu-right" | 53 | class="dropdown-menu dropdown-menu-right" |
54 | ></social-share> | 54 | ></social-share> |