Commit 2550ddacab6b296af5567d82afb061e0101ac171
Exists in
master
and in
2 other branches
Merge branch 'fix-fb-ui'
Showing
3 changed files
with
7 additions
and
6 deletions
Show diff stats
index.html
... | ... | @@ -163,7 +163,7 @@ |
163 | 163 | <a href="#/programas">Programas</a> |
164 | 164 | </div> |
165 | 165 | <div class="social top"> |
166 | - {{#social_share "Dialoga Brasil" "Aqui suas ideias viram propostas e você ajuda a melhorar as ações do governo" "#"}}{{/social_share}} | |
166 | + {{#social_share "Dialoga Brasil" "Aqui suas ideias viram propostas e você ajuda a melhorar as ações do governo" "#" "http://dialoga.gov.br/images/logo.png"}}{{/social_share}} | |
167 | 167 | </div> |
168 | 168 | </header> |
169 | 169 | |
... | ... | @@ -283,7 +283,7 @@ |
283 | 283 | <div class="col-sm-4 col-sm-offset-4"> |
284 | 284 | <div class="social right"> |
285 | 285 | <span>COMPARTILHE<br>ESTE PROGRAMA</span> |
286 | - {{{social_share title abstract (program_detail_url id)}}} | |
286 | + {{{social_share title abstract (program_detail_url id) image.url }}} | |
287 | 287 | </div> |
288 | 288 | </div> |
289 | 289 | </div> |
... | ... | @@ -381,7 +381,7 @@ |
381 | 381 | </div> |
382 | 382 | <div class="social"> |
383 | 383 | <span>Compartilhe esta proposta</span> |
384 | - {{{social_share parent.title abstract (proposal_url parent.id id)}}} | |
384 | + {{{social_share parent.title abstract (proposal_url parent.id id) parent.image.url}}} | |
385 | 385 | </div> |
386 | 386 | </script> |
387 | 387 | |
... | ... | @@ -571,7 +571,7 @@ |
571 | 571 | |
572 | 572 | <script id="social-share" type="text/x-handlebars-template"> |
573 | 573 | <ul> |
574 | - <li><a href="{{url}}" class="fb-share icon icon-facebook" data-caption="{{title}}" data-description="{{stripTags description}}"><span class="fa fa-facebook"></span><span class="sr-only">Compartilhar no Facebook</span></a></li> | |
574 | + <li><a href="{{url}}" class="fb-share icon icon-facebook" data-caption="{{title}}" data-description="{{stripTags description}}" data-picture="{{image_url}}"><span class="fa fa-facebook"></span><span class="sr-only">Compartilhar no Facebook</span></a></li> | |
575 | 575 | <li><a href="https://twitter.com/intent/tweet?url={{encodeURI url}}&text={{stripTags description}}" target="_blank" class="tw-share icon icon-twitter popup"><span class="fa fa-twitter"></span><span class="sr-only">Compartilhar no Twitter</span></a></li> |
576 | 576 | <li><a href="https://plus.google.com/share?url={{encodeURI url}}" target="_blank" class="gp-share icon icon-gplus popup"><span class="fa fa-google-plus"></span><span class="sr-only">Compartilhar no Google Plus</span></a></li> |
577 | 577 | <li><a href="whatsapp://send?text={{stripTags description}} {{encodeURI url}}" target="_blank" class="ws-share icon icon-whatsapp"><span class="fa fa-whatsapp"></span><span class="sr-only">Compartilhar no WhatsApp</span></a></li> | ... | ... |
js/handlebars-helpers.js
... | ... | @@ -103,13 +103,13 @@ define(['handlebars'], function(Handlebars){ |
103 | 103 | return +(Math.round(num + "e+2") + "e-2"); |
104 | 104 | }); |
105 | 105 | |
106 | - Handlebars.registerHelper('social_share', function(title, description, url) { | |
106 | + Handlebars.registerHelper('social_share', function(title, description, url, image_url) { | |
107 | 107 | var template = Handlebars.compile($('#social-share').html()); |
108 | 108 | if(url==='#') { |
109 | 109 | url = ''; |
110 | 110 | } |
111 | 111 | url = 'http:'+Url.addBaseUrl(url); |
112 | - return template({title: title, description: description, url: url}); | |
112 | + return template({title: title, description: description, url: url, image_url: image_url}); | |
113 | 113 | }); |
114 | 114 | |
115 | 115 | Handlebars.registerHelper('proposal_url', function(parent_id, id) { | ... | ... |
js/main.js
... | ... | @@ -1458,6 +1458,7 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers |
1458 | 1458 | name: $(this).data('name') || 'Dialoga Brasil', |
1459 | 1459 | caption: $(this).data('caption') || 'dialoga.gov.br', |
1460 | 1460 | description: $(this).data('description'), |
1461 | + picture: $(this).data('picture'), | |
1461 | 1462 | }, function(response){ |
1462 | 1463 | console.log('response', response); |
1463 | 1464 | }); | ... | ... |