Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions app/controllers/job_seekers_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class JobSeekersController < ApplicationController
def index
@open_to_work = User.seeking_work.includes(:memberships).where(memberships: { left_at: nil }).order(created_at: :desc)
@display_limit = 30
end
end
38 changes: 38 additions & 0 deletions app/views/job_seekers/index.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

<div class="max-w-xs sm:max-w-xl md:max-w-3xl lg:max-w-5xl mx-auto px-4 sm:px-6 md:px-8 py-8 sm:py-12 md:py-16">
<section class="max-w-none mb-8 sm:mb-10 md:mb-12">
<h1 class="text-2xl sm:text-3xl md:text-4xl font-bold mb-4 sm:mb-6 md:mb-8">Members Seeking Work</h1>

<p>These members of Ruby Australia are currently seeking new opportunities.</p>
<% if user_signed_in? %>
<p>Visit your <%= link_to "profile settings", edit_my_details_path, class: "white-link"%> to add your LinkedIn profile and mark yourself as seeking work.</p>
<% end %>

<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6 sm:gap-8">
<% @open_to_work.take(@display_limit).each do |user| %>
<div class="bg-gray-50 p-6 rounded-lg shadow-sm border border-gray-200 flex flex-col">
<div class="flex items-center">
<div class="w-6 h-6 mr-2">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" fill="currentColor" class="text-ruby-red">
<path d="M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z"/>
</svg>
</div>
<a href="<%= user.linkedin_url %>" target="_blank" rel="noopener noreferrer" class="text-ruby-red hover:text-red-700 transition-colors truncate flex-1">
View <%= user.full_name %>
</a>
</div>
</div>
<% end %>
</div>

<% if @open_to_work.count > @display_limit %>
<div class="text-center mt-8">
<p class="text-gray-600">
Showing the most recent <%= @display_limit %> members seeking work. There are currently <%= User.seeking_work.count %> members seeking work.
</p>
</div>
<% end %>


</section>
</div>
11 changes: 2 additions & 9 deletions app/views/shared/_section-job-seekers.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% job_seekers = User.seeking_work.includes(:memberships).where(memberships: { left_at: nil }).order(created_at: :desc).limit(15) %>
<% job_seekers = User.seeking_work.includes(:memberships).where(memberships: { left_at: nil }).order(created_at: :desc).limit(6) %>

<% if job_seekers.any? %>
<section id="job-seekers" class="py-12 sm:py-16 md:py-20">
Expand All @@ -8,7 +8,7 @@
</h2>

<div class="text-center mb-8">
<p class="text-gray-700 mb-4">These members of Ruby Australia are currently seeking new opportunities.</p>
<p class="text-gray-700 mb-4">These members of Ruby Australia are currently seeking new opportunities. <%= link_to "See more", job_seekers_path, class: "text-ruby-red hover:text-red-700 underline" %></p>
<% if user_signed_in? %>
<p class="text-xs sm:text-sm text-gray-500">Visit your <%= link_to "profile settings", edit_my_details_path, class: "text-ruby-red hover:text-red-700 underline" %> to add your LinkedIn profile and mark yourself as seeking work.</p>
<% end %>
Expand All @@ -31,13 +31,6 @@
<% end %>
</div>

<% if job_seekers.count >= 15 %>
<div class="text-center mt-8">
<p class="text-gray-600">
Showing the most recent 15 members seeking work. There are currently <%= User.seeking_work.count %> members seeking work.
</p>
</div>
<% end %>
</div>
</section>
<% end %>
2 changes: 2 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@

root to: 'pages#show', defaults: { id: 'welcome' }

get "/job-seekers" => 'job_seekers#index'

get "/policies" => "policies#index", as: :policies
get "/policies/*id" => "policies#show", as: :policy

Expand Down
2 changes: 1 addition & 1 deletion db/seeds/users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def seed_user(email:, &block)
return unless Rails.env.development?

committee_users_to_create = 4
job_seeking_users_to_create = 4
job_seeking_users_to_create = 14

# first committee user, with credentials to be mentioned in README
seed_user(email: "committee@example.com") { |user| update_user(user:, committee: true, password: "password123") }
Expand Down