Skip to content

Commit

Permalink
Merge pull request #5 from ciberch/invite_monica
Browse files Browse the repository at this point in the history
Invite monica
  • Loading branch information
magizh committed Apr 15, 2012
2 parents b950040 + 14cc055 commit 495b090
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 27 deletions.
8 changes: 6 additions & 2 deletions jobs.rb
Expand Up @@ -142,8 +142,12 @@ def url(path = '')
"#{scheme}://#{host}#{path}"
end

def app_id
ENV['facebook_app_id']
end

def authenticator
@authenticator ||= Koala::Facebook::OAuth.new(ENV['facebook_app_id'], ENV['facebook_app_secret'], url("/auth/facebook/callback"))
@authenticator ||= Koala::Facebook::OAuth.new(app_id, ENV['facebook_app_secret'], url("/auth/facebook/callback"))
end

def add_job_string!(user_hash)
Expand All @@ -165,7 +169,7 @@ def add_job_string!(user_hash)
end

post "/" do
@oauth = Koala::Facebook::OAuth.new(ENV['facebook_app_id'], ENV['facebook_app_secret'])
@oauth = Koala::Facebook::OAuth.new(app_id, ENV['facebook_app_secret'])

signed_request = @oauth.parse_signed_request(params["signed_request"])
@logger.info("Got POST with #{signed_request}")
Expand Down
Binary file added public/images/WashingtonSmall.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 5 additions & 6 deletions public/js/my.js
@@ -1,6 +1,6 @@
window.fbAsyncInit = function() {
FB.init({
appId : '316154225118670', // App ID
appId : app_id, // App ID
channelUrl : '//friends.cloudfoundry.com/channel.html', // Channel File
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
Expand All @@ -18,16 +18,16 @@
js.src = "//connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
}(document));



$(".Recommend").on("click",function(event){
console.log($(this).attr("uid"));
var user_id = $(this).attr("uid");
console.log(user_id);
FB.ui({method: 'apprequests',
message: 'Find the right job here',
to: user_id,
to: user_id,
}, requestCallback);
});

Expand All @@ -37,10 +37,9 @@
}

$(".Recommend_to_friend").on("click",function(event){
console.log($(this).attr("mylink"));
FB.ui({
method: 'send',
name: 'Check out this awesome job',
link: $(this).attr("mylink"),
link: $(this).attr("mylink")
});
});
15 changes: 13 additions & 2 deletions public/stylesheets/style.css
Expand Up @@ -20,19 +20,30 @@ strong {
}

body {
background-color: #55c0c7;
background-color: #0792d9;
color: #444;
font-family: 'Helvetica Neue', "Helvetica Neue Light", Helvetica;
}

.hero-unit {
margin-bottom: 10px;
padding: 30px;
background: url(/images/WashingtonSmall.jpg) no-repeat;
border-radius: 5px;
color: white;
}
.hero-unit p {
width: 80%;
}

body.jobs{background-color:white}

.content {
border-radius: 9px;
border-style: solid;
border-width: 10px;
border-color: #fff;
background: #fff url(/images/summer-jobs.jpg) no-repeat top center;
background-color:white
}

.vspace {
Expand Down
31 changes: 15 additions & 16 deletions views/index.haml
@@ -1,15 +1,14 @@
.row
.somespace
.span3.offset9
%a.usdol{:href=>"http://www.dol.gov/summerjobs/Employers.htm"} Visit the Official US DOL Website
.vspace
.clear
.span5.offset7
%p.green=@description
.somespace
.hero-unit
%h1 Trabaja Friends
%p
%br
%a.btn.btn-primary.btn-large{:href=>"http://www.dol.gov/summerjobs/Employers.htm"} Learn More
%p
%br
%span=@description
.row
.span6
%h3 For Me
-if @user
.user
.avatar
Expand Down Expand Up @@ -40,7 +39,7 @@
%p.location=friend["location"]
%p.job=friend['job']
%td
%button.btn{:class=> "Recommend", :uid=>friend['uid']}
%button.btn{:alt => "Recommend", :class=> "Recommend", :uid=>friend['uid']}
%i.icon-star-empty
-if @older_friends and @older_friends.count > 0
%table.table.table-striped.table-bordered
Expand All @@ -63,10 +62,10 @@
%p.location=friend["location"]
%p.job=friend['job']
%td
%button.btn{:class=> "Recommend", :uid=>friend['uid']}
%button.btn{:alt => "Recommend", :class=> "Recommend", :uid=>friend['uid']}
%i.icon-star-empty
.span6.jobs
%form.form-horizontal{:action => "/search", :target => "jobs"}
%form.well.form-horizontal{:action => "/search", :target => "jobs"}
%h3 Job Search
%fieldset
%label.control-label Keyword
Expand All @@ -80,7 +79,8 @@
%label.control-label State
.controls
%input.input-xlarge{:id => "state_field", :name=>"state", :type => "text", :value => params['state']}
%button.btn{:type=>"submit"}Find Summer Jobs
%fieldset
%button.btn{:type=>"submit"}Find Summer Jobs
%iframe#jobs_frame{:src => @default_search, :name => "jobs"}


Expand All @@ -98,9 +98,8 @@
%a{:href => "http://www.dol.gov/summerjobs/partners.htm"} Who Else ?
%li
%a{:href => "http://www.dol.gov/summerjobs/pdf/Toolkit.pdf"} Learn...
%script{:src=>"/js/my.js"}
:javascript

var app_id = '#{app_id}';
function search() {
$("#search_form").submit();
}
Expand All @@ -112,7 +111,7 @@

$("#search_form").submit();
}

%script{:src=>"/js/my.js"}



Expand Down
5 changes: 4 additions & 1 deletion views/jobs.haml
Expand Up @@ -18,8 +18,11 @@
%label Date Posted:
%span{:itemprop => "datePosted"}=job.dateposted
%td
%button.btn{:class=>"Recommend_to_friend", :mylink => job.link}
%button.btn{:class=>"Recommend_to_friend", :mylink => job.url}
%i.icon-user
-else
%p No results found. Please try again

:javascript
var app_id = '#{app_id}';
%script{:src=>"/js/my.js"}
1 change: 1 addition & 0 deletions views/simple-layout.haml
Expand Up @@ -3,6 +3,7 @@
%link{:rel=>'stylesheet', :href=>'/stylesheets/bootstrap.css', :type => "text/css"}
%link{:rel=>'stylesheet', :href=>'/stylesheets/bootstrap-responsive.css', :type => "text/css"}
%link{:rel=>'stylesheet', :href=>'/stylesheets/style.css', :type => "text/css"}
%script{:src=>"/js/jquery-1.7.1.min.js"}
%title
= @title
%body.jobs
Expand Down

0 comments on commit 495b090

Please sign in to comment.