Skip to content

Commit

Permalink
show tweet button only for the same user
Browse files Browse the repository at this point in the history
  • Loading branch information
sethu committed Sep 12, 2016
1 parent 65db14a commit c96ef9f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
7 changes: 7 additions & 0 deletions app/views/users/_share_button.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.row
.col-sm-12
.tweet-box.col-sm-12
.tweet-content-img.pull-right
%a.twitter-share-button{"data-text" => "Here is my #opensource contribution", "data-size" => 'large', "data-url" => request.original_url, :href => "https://twitter.com/share"} Tweet
:javascript
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');
9 changes: 2 additions & 7 deletions app/views/users/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,8 @@
= link_to 'Settings', '#settings', data: { toggle: 'tab' }
.tab-content
.tab-pane.active#rounds
.row
.col-sm-12
.tweet-box.col-sm-12
.tweet-content-img.pull-right
%a.twitter-share-button{"data-text" => "Here is my #opensource contribution", "data-size" => 'large', "data-url" => request.original_url, :href => "https://twitter.com/share"} Tweet
:javascript
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');
- if @show_transactions
= render partial: 'share_button'
.row
.box-body
#users-chart-container
Expand Down

0 comments on commit c96ef9f

Please sign in to comment.