use bootstrap divide column

parent 79e6c572
Pipeline #743 failed with stages
in 0 seconds
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
height: 100%; height: 100%;
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: cover; background-size: cover;
font-style: italic;
font-family: Bookman, URW Bookman L, serif;
} }
.salary{ .salary{
color: green; color: green;
...@@ -45,14 +47,26 @@ ...@@ -45,14 +47,26 @@
top: 20%; top: 20%;
right: 5%; right: 5%;
} }
.row-table{ .row-table{
color: black; color: black;
padding: 50px; padding: 15px;
margin: 30px; margin: 15px;
text-align: center; text-align: center;
border: 2px solid red; border: 1px solid red;
} }
table{ .city-banner{
width: 100%; background: linear-gradient(to top, #33ccff 0%, #006600 100%);
font-size: 38px;
text-align: center;
color: white;
font-style: italic;
font-family: Bookman, URW Bookman L, serif;
}
.industry-banner{
background: linear-gradient(to top, #33ccff 0%, #006666 100%);
font-size: 38px;
text-align: center;
color: white;
font-style: italic;
font-family: Bookman, URW Bookman L, serif;
} }
class JobsController < ApplicationController class JobsController < ApplicationController
def index
end
end end
...@@ -4,6 +4,5 @@ class TopPagesController < ApplicationController ...@@ -4,6 +4,5 @@ class TopPagesController < ApplicationController
@jobs = Job.limit(5).order(created_at: :desc) @jobs = Job.limit(5).order(created_at: :desc)
@jobs_of_cities = CityJob.limit(9).group('city_id').order('Count(*) DESC').count @jobs_of_cities = CityJob.limit(9).group('city_id').order('Count(*) DESC').count
@jobs_of_industries = IndustryJob.limit(9).group('industry_id').order('Count(*) DESC').count @jobs_of_industries = IndustryJob.limit(9).group('industry_id').order('Count(*) DESC').count
@index = 0
end end
end end
<% @jobs_of_cities.each do |city, count_job| %> <% @jobs_of_cities.each do |city, count_job| %>
<% @index += 1 %> <div class="col-4">
<% if @index % 3 == 0 %> <div class="row-table">
<td class="row-table">
<div class="city-name"><strong><%= City.find(city).name %></strong></div> <div class="city-name"><strong><%= City.find(city).name %></strong></div>
<div class="count-job"><%= count_job %></div> <div class="count-job"><%= count_job %></div>
</td> </div>
</tr> </div>
<% else %>
<td class="row-table">
<div class="city-name"><strong><%= City.find(city).name %></strong></div>
<div class="count-job"><%= count_job %></div>
</td>
<% end %>
<% end %> <% end %>
\ No newline at end of file
<% @jobs_of_industries.each do |industry, count_job| %> <% @jobs_of_industries.each do |industry, count_job| %>
<% @index += 1 %> <div class="col-4">
<% if @index % 3 == 0 %> <div class="row-table">
<td class="row-table">
<div class="industry-name"><strong><%= Industry.find(industry).name %></strong></div> <div class="industry-name"><strong><%= Industry.find(industry).name %></strong></div>
<div class="count-job"><%= count_job %></div> <div class="count-job"><%= count_job %></div>
</td> </div>
</tr> </div>
<% else %>
<td class="row-table">
<div class="industry-name"><strong><%= Industry.find(industry).name %></strong></div>
<div class="count-job"><%= count_job %></div>
</td>
<% end %>
<% end %> <% end %>
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<%= city.name %> <%= city.name %>
<% end %> <% end %>
</div> </div>
<% job.description.html_safe %>
<button type="button" class="btn btn-primary" id="button-follow">♥ Follow</button> <button type="button" class="btn btn-primary" id="button-follow">♥ Follow</button>
</div> </div>
</div> </div>
......
...@@ -6,12 +6,12 @@ ...@@ -6,12 +6,12 @@
</div> </div>
<div class="container"> <div class="container">
<div class="job-list"><%= render 'layouts/show_jobs' %></div> <div class="job-list"><%= render 'layouts/show_jobs' %></div>
<div>
<div class="city-banner">City</div>
</div>
<table class="city-list"><%= render 'layouts/show_cities' %></table>
<div class="city-banner">Industry</div>
<table class="industry-list"><%= render 'layouts/show_industries' %></table>
</div> </div>
<div class="city-banner">City</div>
<div class="container">
<div class="row"><%= render 'layouts/show_cities' %></div>
</div>
<div class="industry-banner">Industry</div>
<div class="container">
<div class="row"><%= render 'layouts/show_industries' %></div>
</div>
...@@ -60,8 +60,8 @@ class Crawler ...@@ -60,8 +60,8 @@ class Crawler
end end
def crawl_job_relationships def crawl_job_relationships
(1..10).each do |n| # (1..10).each do |n|
page_access = Nokogiri::HTML(URI.open("https://careerbuilder.vn/viec-lam/tat-ca-viec-lam-trang-#{n}-vi.html")) page_access = Nokogiri::HTML(URI.open("https://careerbuilder.vn/viec-lam/tat-ca-viec-lam-trang-1-vi.html"))
get_link = page_access.css('a.job_link').map { |link| link['href'] } get_link = page_access.css('a.job_link').map { |link| link['href'] }
get_link.each do |link| get_link.each do |link|
page_job = Nokogiri::HTML(URI.open(URI.parse(URI.escape(link)))) page_job = Nokogiri::HTML(URI.open(URI.parse(URI.escape(link))))
...@@ -114,7 +114,7 @@ class Crawler ...@@ -114,7 +114,7 @@ class Crawler
end end
end end
end end
end # end
end end
def get_file_csv def get_file_csv
......
...@@ -44,7 +44,7 @@ class Crontab ...@@ -44,7 +44,7 @@ class Crontab
experience = get_row.at_xpath('//li[./strong/i[contains(@class, "fa fa-briefcase")]]/p').text.strip experience = get_row.at_xpath('//li[./strong/i[contains(@class, "fa fa-briefcase")]]/p').text.strip
level = get_row.at_xpath('//li[./strong/i[contains(@class, "mdi mdi-account")]]/p').text.strip level = get_row.at_xpath('//li[./strong/i[contains(@class, "mdi mdi-account")]]/p').text.strip
expiration_date = get_row.at_xpath('//li[./strong/i[contains(@class, "mdi mdi-calendar-check")]]/p').text.strip expiration_date = get_row.at_xpath('//li[./strong/i[contains(@class, "mdi mdi-calendar-check")]]/p').text.strip
if job_check.blank? if job_check.nil?
job = Job.create!(title: title_job, job = Job.create!(title: title_job,
level: level, level: level,
salary: salary, salary: salary,
...@@ -76,7 +76,8 @@ class Crontab ...@@ -76,7 +76,8 @@ class Crontab
end end
end end
rescue StandardError => e rescue StandardError => e
@mylogger.error "#{e.message}" # @mylogger.error "#{e.message}"
puts e
end end
end end
end end
......
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