VRFS-736 like us features
This commit is contained in:
parent
6be0791adb
commit
f83f333dd1
|
|
@ -370,18 +370,21 @@ class UsersController < ApplicationController
|
|||
end
|
||||
|
||||
def endorse
|
||||
if uu = User.where(['id = ? AND first_liked_us IS NULL',params[:id]]).limit(1).first
|
||||
if uu = current_user ||
|
||||
uu = User.where(['id = ? AND first_liked_us IS NULL',params[:id]]).limit(1).first
|
||||
uu.first_liked_us = Time.now
|
||||
uu.save!
|
||||
end if params[:id].present?
|
||||
end if params[:id].present? && (service=params[:service]).present?
|
||||
|
||||
url, service = 'http://www.jamkazam.com', params[:service]
|
||||
service ||= 'facebook'
|
||||
url = CGI::escape('http://www.jamkazam.com')
|
||||
txt = CGI::escape('Check out JamKazam -- Play music together over the Internet as if in the same room')
|
||||
if 'twitter'==service
|
||||
url = 'https://twitter.com/jamkazam'
|
||||
url = "https://twitter.com/intent/tweet?text=#{txt}&url=#{url}"
|
||||
elsif 'facebook'==service
|
||||
url = 'https://www.facebook.com/JamKazam'
|
||||
url = "http://www.facebook.com/sharer/sharer.php?u=#{url}&t=#{txt}"
|
||||
elsif 'google'==service
|
||||
url = 'https://plus.google.com/u/0/106619885929396862606/about'
|
||||
url = "https://plus.google.com/share?url=#{url}"
|
||||
end
|
||||
redirect_to url
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,3 +1,10 @@
|
|||
<div style="width:100%; text-align:center">
|
||||
<div style="margin:0 auto; display: inline-block">
|
||||
<% [:twitter, :facebook, :google].each do |src| %>
|
||||
<%= link_to(image_tag("http://www.jamkazam.com/assets/content/icon_#{src}.png", :style => "vertical-align:top"), "/endorse/0/#{src}") %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<!-- start footer -->
|
||||
<div id="footer">
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue