Commit 61eedf79 by nnnghia98

link city/industry to jobs

parent dd62ee75
......@@ -26,7 +26,6 @@ textarea {
}
.center {
text-align: center;
h1 {
margin-bottom: 10px;
}
......@@ -52,6 +51,10 @@ p {
line-height: 1.7em;
}
.container.text-center {
margin-bottom: 30px;
}
/* header */
/* footer */
......@@ -120,7 +123,8 @@ html {
/* job */
.box {
border: solid 1px black;
border: solid 1px rgb(26, 101, 131);
border-radius: 10px;
margin: 10px;
padding: 5px;
.job_data {
......
......@@ -2,12 +2,12 @@ class JobsController < ApplicationController
def index
if params[:city_id]
redirect_to jobs_path if params[:city_id].blank?
@city_name = City.find(params[:city_id])
@jobs = @city_name.jobs
@city = City.find(params[:city_id])
@jobs = @city.jobs
elsif params[:industry_id]
redirect_to jobs_path if params[:industry_id].blank?
@industry_name = Industry.find(params[:industry_id])
@jobs = @industry_name.jobs
@industry = Industry.find(params[:industry_id])
@jobs = @industry.jobs
else
@jobs = Job.all
end
......
<div class="col-md-3">
<div class="col-show">
<%= link_to "#{city.name} (#{city.job_count})", jobs_path %>
<%= link_to "#{city.name} (#{city.job_count})", city_jobs_path(city.id) %>
</div>
</div>
<div class="container jumbotron text-center">
<div class="container text-center">
<h1>City List</h1>
<div class="row">
<div class="col-sm">
......
<div class="col-md-3">
<div class="col-show">
<%= link_to "#{industry.name} (#{industry.job_count})", jobs_path %>
<%= link_to "#{industry.name} (#{industry.job_count})", industry_jobs_path(industry.id) %>
</div>
</div>
<h1 class="text-center">Industry List</h1>
<div class="row row-cols-5">
<%= render partial: "industries/industry", collection: @industries %>
</div>
......@@ -2,7 +2,7 @@
<div class="job_data">
<dl class="job_data_row">
<dt>Title</dt>
<dd><%= link_to job.title, jobs_path %></dd>
<dd><%= link_to job.title, job_path(job.id) %></dd>
</dl>
<dl class="job_data_row">
<dt>Short description</dt>
......
<h3>Total: <%= @jobs.count %></h3>
<h3>Total: <%= Job.count %></h3>
<h3>Result for: </h3>
<%= paginate @jobs %>
......
......@@ -2,7 +2,7 @@
<div class="job_data">
<dl class="job_data_row">
<dt>Title</dt>
<dd><%= latest_job.title %></dd>
<dd><%= link_to latest_job.title, job_path(latest_job.id) %></dd>
</dl>
<dl class="job_data_row">
<dt>Short description</dt>
......
<% provide(:title, "Top Page") %>
<div class="center jumbotron">
<div class="banner">
<div class="jumbotron">
<div class="banner text-center">
<%= image_tag ("skyline_darker.jpg") %>
</div>
......@@ -10,18 +10,18 @@
<div class="search"></div>
<div class="lastest_jobs">
<h3>Latest jobs</h3>
<h3 class="text-center">Latest jobs</h3>
<div>
<%= render partial: "shared/latest_job", collection: @jobs %>
</div>
</div>
<div class="top_cities">
<div class="top_cities text-center">
<%= render "shared/top_cities" %>
</div>
<div class="top_industries">
<div class="top_industries text-center">
<%= render "shared/top_industries"%>
</div>
</div>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment