Skip to content

Commit

Permalink
Adding tweet to share button on project list and detail pages, fixes C…
Browse files Browse the repository at this point in the history
  • Loading branch information
Julia Elman committed Mar 5, 2015
1 parent f3bd04c commit 9cd4233
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/views/projects/_project.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
<li><%= link_to '<i class="fi-wrench"></i> '.html_safe + "Install", project.install_url, :target => '_blank' if project.install_url.present? %></li>
<li><%= link_to '<i class="fi-page-edit"></i> '.html_safe + "Tasks", project.tasks_url, :target => '_blank' if project.tasks_url.present? %></li>
<li><%= link_to '<i class="fi-comments"></i> '.html_safe + "Help", project.help_url, :target => '_blank' if project.help_url.present? %></li>
<li>
<%= render partial: 'project_social', locals: { project: project } %>
</li>
</ul>
</div>

Expand Down
9 changes: 9 additions & 0 deletions app/views/projects/_project_social.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<% if project.twitter.present? %>
<a href="http://twitter.com/home?status=Check out the @<%= project.twitter %> project on @CodeMontage!" title="Share on Twitter" target="_blank" class="button radius small">
<i class="fi-social-twitter"></i> Share on Twitter
</a>
<% elsif project.organization.twitter.present? %>
<a href="http://twitter.com/home?status=Check out @<%= project.organization.twitter %> on @CodeMontage!" title="Share on Twitter" target="_blank" class="button radius small">
<i class="fi-social-twitter"></i> Share on Twitter
</a>
<% end %>
4 changes: 4 additions & 0 deletions app/views/projects/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@

<div class="large-4 columns">
<%= link_to image_tag(find_logo(@project.organization), :alt => @project.organization.name), @project.organization.url, :target => '_blank' if find_logo?(@project.organization) %>

<div id="social_share">
<%= render partial: 'project_social', locals: { project: @project } %>
</div>

<div id="project_causes">
<h5>Causes</h5>
Expand Down

0 comments on commit 9cd4233

Please sign in to comment.