fix page-ID1

parent 0c9a14c9
......@@ -26,10 +26,10 @@
font-size: medium;
}
a {
color: rgb(14, 14, 14);
text-decoration: none;
&:hover {
color: orange;
color: rgb(14, 14, 14);
text-decoration: none;
&:hover {
color: orange;
}
}
......
......@@ -3,5 +3,6 @@ class TopController < ApplicationController
@jobs = Job.latest_jobs
@cities = City.top_cities
@industries = Industry.top_industries
@total_job = Job.all.count
end
end
......@@ -4,5 +4,4 @@ class City < ApplicationRecord
has_and_belongs_to_many :companies
LATEST_CITY_NUMBER = 9
scope :top_cities, -> { joins(:jobs).group(:name).order('count_all DESC').count.take(LATEST_CITY_NUMBER) }
end
end
\ No newline at end of file
......@@ -2,4 +2,4 @@ class Industry < ApplicationRecord
has_and_belongs_to_many :jobs
LATEST_INDUSTRY_NUMBER = 9
scope :top_industries, -> { joins(:jobs).group(:name).order('count_all DESC').count.take(LATEST_INDUSTRY_NUMBER) }
end
end
\ No newline at end of file
......@@ -7,4 +7,4 @@ class Job < ApplicationRecord
has_and_belongs_to_many :cities
LATEST_JOB_NUMBER = 5
scope :latest_jobs, -> { includes(:cities, :company).order('created_at DESC').limit(LATEST_JOB_NUMBER) }
end
end
\ No newline at end of file
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/r29/html5.min.js">
</script>
<![endif]-->
......@@ -10,7 +10,6 @@ html
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload'
= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload'
link[rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css"]
= render 'layouts/shim'
body.bg-light
= render 'layouts/header'
.container
......
- provide :title, 'Jobs'
h3.p-2
|Total Jobs:
= Job.all.count
| Total:
= pluralize(@total_job, 'job')
.container
.input-group.py-3
input.form-control.rounded[type="search" placeholder="Search" aria-label="Search" aria-describedby="search-addon"]
button.btn.btn-outline-primary[type="button"]
| search
| Search
h4.py-4
| Latest Jobs
- @jobs.each do |job|
......@@ -19,12 +19,12 @@ h3.p-2
= link_to job.company.name, "#"
p.mb-1
i.fas.fa-dollar-sign.m-1
| Lương:
| Lương:
= job.salary
p.mb-1
i.fas.fa-map-marker-alt.m-1
- job.cities.each do |job|
= job.name
- job.cities.each do |city|
= city.name
h4
| Top Cities
.row.my-3.text-center.fs-5
......
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