Commit b20cc8af by Mai Hoang Thai Ha

fixed codestyle

parent 25f4d82e
...@@ -4,7 +4,7 @@ module ApplicationHelper ...@@ -4,7 +4,7 @@ module ApplicationHelper
if page_title.empty? if page_title.empty?
base_title base_title
else else
page_title + " | " + base_title "#{page_title} | #{base_title}"
end end
end end
end end
module CitiesHelper
def get_cities_list(region_name)
City.joins(:jobs).where(region: region_name).group(:name).count
end
end
...@@ -23,4 +23,4 @@ ...@@ -23,4 +23,4 @@
.mt-5 .mt-5
.city-item .city-item
h3.h4.mb-2.see-more-text= link_to city[0], job_list_path(model: :city, slug: city[1]) , class:'text-decoration-none fw-normal text-reset' h3.h4.mb-2.see-more-text= link_to city[0], job_list_path(model: :city, slug: city[1]) , class:'text-decoration-none fw-normal text-reset'
p.text-muted.mb-0= pluralize(count, "job") p.text-muted.mb-0= pluralize(count, 'job')
\ No newline at end of file \ No newline at end of file
...@@ -7,6 +7,6 @@ ...@@ -7,6 +7,6 @@
.col-lg-6.col-md-6.text-center .col-lg-6.col-md-6.text-center
.mt-5 .mt-5
h3.h4.mb-2.see-more-text= link_to name[0], job_list_path(model: :industry, slug: name[1]) , class:'text-decoration-none fw-normal text-reset' h3.h4.mb-2.see-more-text= link_to name[0], job_list_path(model: :industry, slug: name[1]) , class:'text-decoration-none fw-normal text-reset'
p.text-muted.mb-0= pluralize(job_count, "job") p.text-muted.mb-0= pluralize(job_count, 'job')
hr.divider.my-4 hr.divider.my-4
.breadcrumb
= link_to root_path, class: 'text-decoration-none text-info' do
'Home
span.d-block.mx-2
| >
- city_list = @job.cities
- city_list.each_with_index do |city, i|
= link_to job_list_path(model: :city, slug: city.slug), class: 'text-decoration-none text-info' do
= city.name
= " | " if i != city_list.length - 1
span.d-block.mx-2
| >
- industry_list = @job.industries
- industry_list.each_with_index do |industry, i|
= link_to job_list_path(model: :industry, slug: industry.slug), class: 'text-decoration-none text-info' do
= industry.name
= " | " if i != industry_list.length - 1
span.d-block.mx-2
| >
= @job.title
\ No newline at end of file
.job-detail.my5
.job-apply.d-flex.align-items-center.justify-content-between
h2.align-items-start
= @job.title
= link_to 'Apply for this job', '#', class: 'btn btn-primary'
p.text-secondary
= @job.company.name
.row.bg-light
.col-4
ul.list-unstyled
li
strong
| Location
- @job.cities.each do |city|
p
= city.name
li
strong
| Salary
p.text-success
= @job.salary
.col-4
ul.list-unstyled
li
strong
| Type
p
= @job.job_type
li
strong
| Position
p
= @job.position
.col-4
ul.list-unstyled
li
strong
| Experience
p
= @job.experience
li
strong
| Expiration date
p
= @job.expiration_date
.job-benefits.my-4
h3
| Benefits
.row
- @job.benefit.split('---').each do |benefit|
li.list-unstyled.col-4.text-secondary
= benefit
.job-desc.my-4
h3
| Description
= @job.description.html_safe()
.job-req.my-4
h3
| Requirement
= @job.requirement.html_safe()
.job-info.my-4
h3
| Other info
- @job.other_info.split('---').each do |info|
li.text-secondary
= info
.job-apply.d-flex.align-items-center.justify-content-between
= link_to 'Apply for this job', '#', class: 'btn btn-primary'
= link_to 'Favorite', '#', class: 'btn btn-primary'
.container
- @jobs.each do |job|
.job-item
= link_to job.title, job_path(Job.find_by(title: job.title).id), class: 'job-title fs-3 text-decoration-none text-reset'
.job-caption
= link_to job.company.name, "#", class: "job-company text-decoration-none text-secondary"
p.job-salary.text-success
| Salary: #{job.salary}
ul.list-unstyled
- job.cities.each do |city|
li
= city.name
.job-desc
= truncate(simple_format(job.description), escape: false, length: 250)
hr.my-4
\ No newline at end of file
- provide(:title, 'Job list page') - provide(:title, 'Job list page')
/ search box
= render 'shared/search' = render 'shared/search'
.container .container
h1.mt-5 h1.mt-5
...@@ -10,7 +11,22 @@ ...@@ -10,7 +11,22 @@
.page-info.p-2 .page-info.p-2
= paginate @jobs = paginate @jobs
.container .container
= render 'jobs' .container
- @jobs.each do |job|
/ job
.job-item
= link_to job.title, job_path(Job.find_by(title: job.title).id), class: 'job-title fs-3 text-decoration-none text-reset'
.job-caption
= link_to job.company.name, '#', class: 'job-company text-decoration-none text-secondary'
p.job-salary.text-success
| Salary: #{job.salary}
ul.list-unstyled
- job.cities.each do |city|
li
= city.name
.job-desc
= truncate(simple_format(job.description), escape: false, length: 250)
hr.my-4
.no-padding.d-flex.align-items-center.flex-column .no-padding.d-flex.align-items-center.flex-column
.page-info.p-2 .page-info.p-2
= page_entries_info @jobs = page_entries_info @jobs
......
.container.my-5 .container.my-5
= render 'breadcrumb' / breadcrumb
.breadcrumb
= link_to root_path, class: 'text-decoration-none text-info' do
'Home
span.d-block.mx-2
| >
- city_list = @job.cities
- city_list.each_with_index do |city, i|
= link_to job_list_path(model: :city, slug: city.slug), class: 'text-decoration-none text-info' do
= city.name
= ' | ' if i != city_list.length - 1
span.d-block.mx-2
| >
- industry_list = @job.industries
- industry_list.each_with_index do |industry, i|
= link_to job_list_path(model: :industry, slug: industry.slug), class: 'text-decoration-none text-info' do
= industry.name
= ' | ' if i != industry_list.length - 1
span.d-block.mx-2
| >
= @job.title
hr.my-4 hr.my-4
= render 'job_details' / job details
\ No newline at end of file .job-detail.my5
.job-apply.d-flex.align-items-center.justify-content-between
h2.align-items-start
= @job.title
= link_to 'Apply for this job', '#', class: 'btn btn-primary'
p.text-secondary
= @job.company.name
.row.bg-light
.col-4
ul.list-unstyled
li
strong
| Location
- @job.cities.each do |city|
p
= city.name
li
strong
| Salary
p.text-success
= @job.salary
.col-4
ul.list-unstyled
li
strong
| Type
p
= @job.job_type
li
strong
| Position
p
= @job.position
.col-4
ul.list-unstyled
li
strong
| Experience
p
= @job.experience
li
strong
| Expiration date
p
= @job.expiration_date
.job-benefits.my-4
h3
| Benefits
.row
- @job.benefit.split('---').each do |benefit|
li.list-unstyled.col-4.text-secondary
= benefit
.job-desc.my-4
h3
| Description
= @job.description.html_safe()
.job-req.my-4
h3
| Requirement
= @job.requirement.html_safe()
.job-info.my-4
h3
| Other info
- @job.other_info.split('---').each do |info|
li.text-secondary
= info
.job-apply.d-flex.align-items-center.justify-content-between
= link_to 'Apply for this job', '#', class: 'btn btn-primary'
= link_to 'Favorite', '#', class: 'btn btn-primary'
footer.footer footer.footer
small small
| The | The
= link_to "VenJob", root_path = link_to 'VenJob', root_path
| by Mai Hoàng Thái Hà | by Mai Hoàng Thái Hà
nav nav
ul ul
li li
= link_to "About", '#' = link_to 'About', '#'
li li
= link_to "Contact", '#' = link_to 'Contact', '#'
\ No newline at end of file \ No newline at end of file
header.navbar.navbar-fixed-top.navbar-inverse header.navbar.navbar-fixed-top.navbar-inverse
.container .container
= link_to image_tag("logo.png", alt: "Zigexn logo", width: "150"), = link_to image_tag('logo.png', alt: 'Zigexn logo', width: '150'),
- root_path - root_path
nav nav
ul.nav.navbar-nav.navbar-right ul.nav.navbar-nav.navbar-right
li li
= link_to "Log in", '#' = link_to 'Log in', '#'
li li
= link_to "Sign up", '#' = link_to 'Sign up', '#'
\ No newline at end of file \ No newline at end of file
<!--[if lt IE 9]> <!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/r29/html5.min.js"> <script src='//cdnjs.cloudflare.com/ajax/libs/html5shiv/r29/html5.min.js'>
</script> </script>
<![endif]--> <![endif]-->
\ No newline at end of file
...@@ -3,7 +3,7 @@ html ...@@ -3,7 +3,7 @@ html
head head
title title
=full_title(yield(:title)) =full_title(yield(:title))
meta[name="viewport" content="width=device-width,initial-scale=1" charset="utf-8"] meta[name='viewport' content='width=device-width,initial-scale=1' charset='utf-8']
= csrf_meta_tags = csrf_meta_tags
= csp_meta_tag = csp_meta_tag
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload'
......
doctype html doctype html
html html
head head
meta[http-equiv="Content-Type" content="text/html; charset=utf-8"] meta[http-equiv='Content-Type' content='text/html; charset=utf-8']
style style
| /* Email styles need to be inline */ | /* Email styles need to be inline */
body body
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
.row .row
.col-md-10.mb-md-0.no-padding .col-md-10.mb-md-0.no-padding
span.fa.fa-search.form-control-feedback span.fa.fa-search.form-control-feedback
= search_field_tag :search, params[:search], placeholder: "Find a job", class: "form-control rounded-left no-border-radius bg-light h-100" = search_field_tag :search, params[:search], placeholder: 'Find a job', class: 'form-control rounded-left no-border-radius bg-light h-100'
.col-md-2.mb-md-0.no-padding .col-md-2.mb-md-0.no-padding
= button_tag "", class: "h-100 w-100 btn btn-block btn-lg btn-info ", name: nil = button_tag '', class: 'h-100 w-100 btn btn-block btn-lg btn-info', name: nil
| Search | Search
\ No newline at end of file
.search.text-center.mb-5
.overlay
.container
.row
.col-xl-9.mx-auto
h1.mb-5.mt-5
| Total:
= pluralize(@total_job, "job")
.row.justify-content-start
.col-md-10.mb-md-0.no-padding
span.fa.fa-search.form-control-feedback
= search_field_tag :search, params[:search], placeholder: "Find a job", class: "form-control rounded-left no-border-radius bg-light h-100"
.col-md-2.mb-md-0.no-padding
= button_tag "", class: "h-100 w-100 btn btn-block btn-lg btn-info fa fa-search rounded-right no-border-radius ", name: nil
| Search
\ No newline at end of file
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
hr.my-2 hr.my-2
- @latest_jobs.each do |job| - @latest_jobs.each do |job|
.job-item.mb-4 .job-item.mb-4
= link_to job.title, job_path(job.id), class: "job-title" = link_to job.title, job_path(job.id), class: 'job-title'
.job-caption .job-caption
= link_to job.company.name, "#", class: "job-company" = link_to job.company.name, '#', class: 'job-company'
p.job-salary p.job-salary
| Salary: | Salary:
= job.salary = job.salary
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
= link_to city.name, job_list_path(model: :city, slug: city.slug), class: 'city-name' = link_to city.name, job_list_path(model: :city, slug: city.slug), class: 'city-name'
span.job-count span.job-count
| ( | (
= pluralize(city_jobs, "job") = pluralize(city_jobs, 'job')
|) |)
= link_to 'See all cities', cities_path, class:'all-cities-btn' = link_to 'See all cities', cities_path, class:'all-cities-btn'
/ top industries / top industries
...@@ -48,6 +48,6 @@ ...@@ -48,6 +48,6 @@
= link_to industry.name, job_list_path(model: :industry, slug: industry.slug), class: 'industry-name' = link_to industry.name, job_list_path(model: :industry, slug: industry.slug), class: 'industry-name'
span.job-count span.job-count
| ( | (
= pluralize(industry_jobs, "job") = pluralize(industry_jobs, 'job')
|) |)
= link_to 'See all industries', industries_path, class:'all-industries-btn' = link_to 'See all industries', industries_path, class:'all-industries-btn'
\ No newline at end of file
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