Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When User is not logged in then display only open positions
Otherwise display applied, job seekers, and unapplied positions
- Loading branch information
Rodney Degracia
committed
Dec 22, 2011
1 parent
85c85f6
commit 92e2f1d
Showing
7 changed files
with
159 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,41 @@ | ||
<h1>jobs.familab.org</h1> | ||
<hr> | ||
<div class = "unapplied"> | ||
<div class = "open"> | ||
<%= | ||
render(:partial => "positions/unapplied", | ||
:locals =>{ :unapplied_positions => @open_positions }) | ||
render(:partial => "positions/open", | ||
:locals =>{ :open_positions => @open_positions }) | ||
%> | ||
</div> | ||
<hr> | ||
<div class = "job_seekers"> | ||
<%= | ||
render(:partial => "profiles/job_seekers", | ||
:locals =>{ :job_seekers => @job_seekers }) | ||
%> | ||
</div> | ||
<hr> | ||
|
||
<% if user_signed_in? %> | ||
<%= link_to 'Create Job Position', new_position_path %> | | ||
<% if current_user.profile != nil %> | ||
<%= link_to 'Profile', profile_path(current_user.profile) %> | ||
<% else %> | ||
<%= link_to 'Profile', new_profile_path %> | ||
<% end %> | ||
|
||
<div class = "unapplied"> | ||
<%= | ||
render(:partial => "positions/unapplied", | ||
:locals =>{ :unapplied_positions => @unapplied_positions }) | ||
%> | ||
</div> | ||
<hr> | ||
<div class = "job_seekers"> | ||
<%= | ||
render(:partial => "profiles/job_seekers", | ||
:locals =>{ :job_seekers => @job_seekers }) | ||
%> | ||
</div> | ||
<hr> | ||
<div class = "applied"> | ||
<%= | ||
render(:partial => "positions/applied", | ||
:locals =>{ :applied_positions => @applied_positions }) | ||
%> | ||
<hr> | ||
|
||
<% end %> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<h3>Open Positions</h3> | ||
|
||
<table> | ||
<tr> | ||
<th>Title</th> | ||
<th>Description</th> | ||
<th>Rate</th> | ||
<th>Open</th> | ||
<th></th> | ||
<th></th> | ||
<th></th> | ||
</tr> | ||
|
||
<% open_positions.each do |position| %> | ||
<tr> | ||
<td><%= position.title %></td> | ||
<td><%= position.description %></td> | ||
<td><%= position.rate %></td> | ||
<td><%= position.open %></td> | ||
<td><%= link_to 'Show', position %></td> | ||
</tr> | ||
<% end %> | ||
</table> | ||
|
||
<br /> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
require 'spec_helper' | ||
|
||
describe 'positions/_open.html.erb' do | ||
|
||
it "displays open jobs" do | ||
current_user = mock_model(Profile, :firstname => 'Alvin', :lastname => "Alva", :jobtitle => 'PHP Developer') | ||
position1 = mock_model(Position, :title => "PHP Developer", :description => 'PHP Developer', :rate => '1.0', :user_id => current_user, :open => true) | ||
|
||
other_user = mock_model(Profile, :firstname => 'Bob', :lastname => "Barker", :jobtitle => 'Rails Developer') | ||
position2 = mock_model(Position, :title => "Perl Developer", :description => 'Perl Developer', :rate => '1.0', :user_id => other_user, :open => true) | ||
|
||
@open_positions = [position1, position2] | ||
|
||
render :partial => "positions/open", :locals => {:open_positions => @open_positions} | ||
|
||
rendered.should =~ /PHP Developer/ | ||
rendered.should =~ /Perl Developer/ | ||
end | ||
|
||
end |