Commit b79d22ce by Hoang Phuc Do

Merge branch 'ID20_DetailJob' into 'master'

create Job Details

See merge request !7
parents 45098883 75e4cd54
Pipeline #850 canceled with stages
in 0 seconds
...@@ -29,6 +29,8 @@ gem 'jbuilder', '~> 2.5' ...@@ -29,6 +29,8 @@ gem 'jbuilder', '~> 2.5'
gem 'nokogiri' gem 'nokogiri'
gem 'whenever' gem 'whenever'
gem 'kaminari' gem 'kaminari'
gem 'breadcrumbs_on_rails'
gem 'draper'
# Use ActiveStorage variant # Use ActiveStorage variant
# gem 'mini_magick', '~> 4.8' # gem 'mini_magick', '~> 4.8'
......
...@@ -29,6 +29,10 @@ GEM ...@@ -29,6 +29,10 @@ GEM
globalid (>= 0.3.6) globalid (>= 0.3.6)
activemodel (5.2.4.3) activemodel (5.2.4.3)
activesupport (= 5.2.4.3) activesupport (= 5.2.4.3)
activemodel-serializers-xml (1.0.2)
activemodel (> 5.x)
activesupport (> 5.x)
builder (~> 3.1)
activerecord (5.2.4.3) activerecord (5.2.4.3)
activemodel (= 5.2.4.3) activemodel (= 5.2.4.3)
activesupport (= 5.2.4.3) activesupport (= 5.2.4.3)
...@@ -50,6 +54,8 @@ GEM ...@@ -50,6 +54,8 @@ GEM
bindex (0.8.1) bindex (0.8.1)
bootsnap (1.4.7) bootsnap (1.4.7)
msgpack (~> 1.0) msgpack (~> 1.0)
breadcrumbs_on_rails (4.0.0)
rails (>= 5.0)
builder (3.2.4) builder (3.2.4)
byebug (11.1.3) byebug (11.1.3)
capybara (3.33.0) capybara (3.33.0)
...@@ -74,6 +80,12 @@ GEM ...@@ -74,6 +80,12 @@ GEM
coffee-script-source (1.12.2) coffee-script-source (1.12.2)
concurrent-ruby (1.1.6) concurrent-ruby (1.1.6)
crass (1.0.6) crass (1.0.6)
draper (4.0.1)
actionpack (>= 5.0)
activemodel (>= 5.0)
activemodel-serializers-xml (>= 1.0)
activesupport (>= 5.0)
request_store (>= 1.0)
erubi (1.9.0) erubi (1.9.0)
execjs (2.7.0) execjs (2.7.0)
ffi (1.13.1) ffi (1.13.1)
...@@ -151,6 +163,8 @@ GEM ...@@ -151,6 +163,8 @@ GEM
rb-inotify (0.10.1) rb-inotify (0.10.1)
ffi (~> 1.0) ffi (~> 1.0)
regexp_parser (1.7.1) regexp_parser (1.7.1)
request_store (1.5.0)
rack (>= 1.4)
ruby_dep (1.5.0) ruby_dep (1.5.0)
rubyzip (2.3.0) rubyzip (2.3.0)
sass (3.7.4) sass (3.7.4)
...@@ -206,10 +220,12 @@ PLATFORMS ...@@ -206,10 +220,12 @@ PLATFORMS
DEPENDENCIES DEPENDENCIES
bootsnap (>= 1.1.0) bootsnap (>= 1.1.0)
breadcrumbs_on_rails
byebug byebug
capybara (>= 2.15) capybara (>= 2.15)
chromedriver-helper chromedriver-helper
coffee-rails (~> 4.2) coffee-rails (~> 4.2)
draper
jbuilder (~> 2.5) jbuilder (~> 2.5)
kaminari kaminari
listen (>= 3.0.5, < 3.2) listen (>= 3.0.5, < 3.2)
......
This source diff could not be displayed because it is too large. You can view the blob instead.
/*!
* Font Awesome Free 5.14.0 by @fontawesome - https://fontawesome.com
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
*/
@font-face {
font-family: 'Font Awesome 5 Brands';
font-style: normal;
font-weight: 400;
font-display: block;
src: url("../webfonts/fa-brands-400.eot");
src: url("../webfonts/fa-brands-400.eot?#iefix") format("embedded-opentype"), url("../webfonts/fa-brands-400.woff2") format("woff2"), url("../webfonts/fa-brands-400.woff") format("woff"), url("../webfonts/fa-brands-400.ttf") format("truetype"), url("../webfonts/fa-brands-400.svg#fontawesome") format("svg"); }
.fab {
font-family: 'Font Awesome 5 Brands';
font-weight: 400; }
...@@ -121,7 +121,6 @@ $main-color: #23303D; ...@@ -121,7 +121,6 @@ $main-color: #23303D;
position: absolute; position: absolute;
height: 100vh; height: 100vh;
transition: 0.3s; transition: 0.3s;
// background-color: whitesmoke;
transform: translateX(-120%); transform: translateX(-120%);
margin-top: 40px; margin-top: 40px;
background-color: #2d2d2d; background-color: #2d2d2d;
...@@ -205,7 +204,7 @@ $main-color: #23303D; ...@@ -205,7 +204,7 @@ $main-color: #23303D;
overflow: scroll; overflow: scroll;
} }
.content_menu_mobile { .content_menu_mobile {
height: 100%; height: 130vh;
width: 100%; width: 100%;
} }
.lbn-nav { .lbn-nav {
...@@ -240,9 +239,13 @@ $main-color: #23303D; ...@@ -240,9 +239,13 @@ $main-color: #23303D;
.menu__mobile { .menu__mobile {
width: 65vw; width: 65vw;
} }
.breadcrumb-item.active {
padding: 4px 0px;
}
.breadcrumb_total_search { .breadcrumb_total_search {
span { span {
font-size: 14px; font-size: 14px;
line-height: 24px;
} }
} }
} }
...@@ -1095,12 +1098,12 @@ $main-color: #23303D; ...@@ -1095,12 +1098,12 @@ $main-color: #23303D;
.banner_detail { .banner_detail {
width: 100%; width: 100%;
height: 300px; height: 300px;
background-image: url('11'); background-image: url('11.jpg');
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: cover; background-size: cover;
} }
.breadcrumb li a{ .breadcrumb a{
text-decoration: none; text-decoration: none !important;
&:hover { &:hover {
text-decoration: none !important; text-decoration: none !important;
} }
...@@ -1110,6 +1113,10 @@ $main-color: #23303D; ...@@ -1110,6 +1113,10 @@ $main-color: #23303D;
h1 { h1 {
font-size: 30px; font-size: 30px;
} }
span {
font-size: 22px;
color: #666;
}
} }
.btn-apply_job { .btn-apply_job {
margin-top: 20px; margin-top: 20px;
...@@ -1120,9 +1127,12 @@ $main-color: #23303D; ...@@ -1120,9 +1127,12 @@ $main-color: #23303D;
background-image: linear-gradient(315deg, #d4418e 0%, #0652c5 74%); background-image: linear-gradient(315deg, #d4418e 0%, #0652c5 74%);
outline: none !important; outline: none !important;
border: none !important; border: none !important;
transition: all 0.4s ease-in-out;
&:hover { &:hover {
color: #fff !important; color: #fff !important;
font-weight: 600 !important; // font-weight: 600 !important;
transition: all 4s ease-in-out;
background-image: linear-gradient(43deg, #4158D0 0%, #C850C0 46%, #FFCC70 100%);
} }
} }
.btn-apply_job_favorite { .btn-apply_job_favorite {
...@@ -1187,7 +1197,7 @@ $main-color: #23303D; ...@@ -1187,7 +1197,7 @@ $main-color: #23303D;
.breadcrumb_total_search { .breadcrumb_total_search {
background-color: #e9ecef; background-color: #e9ecef;
height: 48px; height: auto;
font-size: 16px; font-size: 16px;
line-height: 48px; line-height: 48px;
border-radius: 4px; border-radius: 4px;
...@@ -1335,5 +1345,8 @@ $main-color: #23303D; ...@@ -1335,5 +1345,8 @@ $main-color: #23303D;
font-size: 18px !important; font-size: 18px !important;
} }
} }
.box_detail_jobs_location a{
font-weight: bold;
color: rgb(211, 48, 48);
}
// Place all the styles related to the home controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
// Place all the styles related to the industry controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
// Place all the styles related to the job controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
/*!
* Font Awesome Free 5.14.0 by @fontawesome - https://fontawesome.com
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
*/
@font-face {
font-family: 'Font Awesome 5 Free';
font-style: normal;
font-weight: 900;
font-display: block;
src: url("../webfonts/fa-solid-900.eot");
src: url("../webfonts/fa-solid-900.eot?#iefix") format("embedded-opentype"), url("../webfonts/fa-solid-900.woff2") format("woff2"), url("../webfonts/fa-solid-900.woff") format("woff"), url("../webfonts/fa-solid-900.ttf") format("truetype"), url("../webfonts/fa-solid-900.svg#fontawesome") format("svg"); }
.fa,
.fas {
font-family: 'Font Awesome 5 Free';
font-weight: 900; }
...@@ -10,7 +10,15 @@ class JobController < ApplicationController ...@@ -10,7 +10,15 @@ class JobController < ApplicationController
render_result(obj) render_result(obj)
end end
private def detail
@job = Job.find(params[:id]).decorate
cities = @job.cities.first
industries = @job.industries.first
add_breadcrumb 'Trang chủ', root_path
add_breadcrumb cities.name, jobs_path(model: 'city', slug: cities.slug)
add_breadcrumb industries.name, jobs_path(model: 'industry', slug: industries.slug)
add_breadcrumb @job.name
end
def load_data_dropdown def load_data_dropdown
@industries = Industry.order(name: :asc).all @industries = Industry.order(name: :asc).all
......
# frozen_string_literal: true
# Decorator
class JobDecorator < Draper::Decorator
delegate_all
def posted_at
created_at.strftime('%d - %m - %Y')
end
def expired_at
expiration_date.strftime('%d - %m - %Y')
end
end
<%= render 'job/modal_login'%>
<%cru = 0%>
<div class="container">
<div class="row">
<div class="col-sm-12">
<% @lasted_jobs.each do |val| %>
<div class="box_jobs">
<div class="col-sm-12 d-block d-sm-none">
<% if cru == 1 %>
<div class="link_favorite_top block_link_favorite md">
<span><%= link_to '<i class="far fa-heart"></i>'.html_safe, '#', class: 'link_favorite'%><span>
</div>
<% else %>
<div class="block_click_favorite link_favorite_top ">
<span><i class="far fa-heart"></i><span>
</div>
<% end %>
</div>
<div class="row">
<div class="col-sm-10 col-md-9 col-lg-10">
<div class="box_info">
<div class="lol">
<%= link_to val.name, '#', class: 'job_name' %>
</div>
<div class="cop">
<h5 class="box_info_copany_name"><i class="far fa-building"></i> <%= val.company.name %></h5>
</div>
<div class="loc">
<h5 class="box_info_location"><i class="fas fa-map-marker-alt"></i>
<% dt = [] %>
<% val.cities.each do |x| %>
<% dt << (x.name << ' | ') %>
<% end %>
<%= dt.join('').chomp('| ')%>
</h5>
</div>
<h5 class="box_info_salary"><i class="fas fa-dollar-sign"></i>&nbsp; Lương: <%= val.salary %></h5>
<div class="coc">
<h5 class="box_info_des"><%= strip_tags(val.description) %></h5>
</div>
</div>
</div>
<div class="col-sm-2 col-md-3 d-none d-sm-block col-lg-2">
<% if cru == 1 %>
<div class="box_link_favotite">
<div class="block_link_favorite lg">
<span><i class="far fa-heart"></i> <%= link_to 'Yêu thích'.html_safe, '#', class: 'link_favorite' %><span>
</div>
<div class="block_link_favorite md">
<span><%= link_to '<i class="far fa-heart"></i>'.html_safe, '#', class: 'link_favorite' %><span>
</div>
</div>
<% else %>
<div class="box_link_favotite">
<div class="block_click_favorite lg">
<span><i class="far fa-heart"></i> Yêu thích<span>
</div>
<div class="block_click_favorite md">
<span><i class="far fa-heart"></i><span>
</div>
</div>
<% end %>
</div>
</div>
</div>
<% end %>
</div>
</div>
</div>
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<div class="box_text_five_jobs"> <div class="box_text_five_jobs">
<span>Năm công việc mới nhất dành cho bạn</span> <span>Năm công việc mới nhất dành cho bạn</span>
</div> </div>
<%= render 'box_five_job' %> <%= render partial: 'job/block_info_job', collection: @lasted_jobs, as: :data %>
<%= render 'box_nine_city' %> <%= render 'box_nine_city' %>
<%= render 'box_nine_industries' %> <%= render 'box_nine_industries' %>
<%= render 'shared/scroll_top' %> <%= render 'shared/scroll_top' %>
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<div class="col-sm-10 col-md-9 col-lg-10"> <div class="col-sm-10 col-md-9 col-lg-10">
<div class="box_info"> <div class="box_info">
<div class="lol"> <div class="lol">
<%= link_to data.name, '#', class: 'job_name' %> <%= link_to data.name, detail_job_path(id: data.id), class: 'job_name' %>
</div> </div>
<div class="cop"> <div class="cop">
<h5 class="box_info_copany_name"><i class="far fa-building"></i> <%= data.company.name %></h5> <h5 class="box_info_copany_name"><i class="far fa-building"></i> <%= data.company.name %></h5>
......
<% provide(:title, @job.name) %>
<div class="container">
<div class="banner_detail">
</div>
</div>
<div class="container">
<div class="row">
<div class="col-lg-12">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<%= render_breadcrumbs :separator => '&nbsp;/&nbsp;'.html_safe %>
</ol>
</nav>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-lg-9">
<div class="job_title">
<h1><%= @job.name %></h1>
<span><i class="far fa-building"></i> <%= link_to @job.company.name, jobs_path(model: 'company', slug: @job.company.slug), class: 'link_ct apply_job' %></span>
</div>
</div>
<div class="col-lg-3">
<div class="btn_apply_job">
<%= link_to 'Nộp CV ngay', '#', class: 'btn btn-apply_job' %>
</div>
</div>
<div class="col-lg-12 col-md-12">
<div class="box_detail_jobs">
<div class="box_detail_jobs_location">
<span><i class="fas fa-map-marker-alt"></i> Địa điểm làm việc: </span>
<% @job.cities.each do |x| %>
<%= link_to "&nbsp;#{x.name}&nbsp;".html_safe , jobs_path(model: 'city', slug: x.slug), class: 'link_ct apply_job link_optimize'%>
<% end %>
</div>
<div class="box_detail_jobs_salary">
<br>
<div class="row">
<div class="col-lg-4 col-md-6">
<div class="detail_info">
<span><i class="fab fa-linode"></i> Lương: <%= @job.salary %></span>
</div>
</div>
<div class="col-lg-4 col-md-6">
<div class="detail_info">
<span><i class="fab fa-linode"></i> Ngày đăng tin: <%= @job.posted_at %></span>
</div>
</div>
<div class="col-lg-4 col-md-6">
<div class="detail_info">
<span><i class="fab fa-linode"></i> Ngày hết hạn: <%= @job.expiration_date.present? ? @job.expired_at : 'đang cập nhật' %></span>
</div>
</div>
<div class="col-lg-4 col-md-6">
<div class="detail_info">
<span><i class="fab fa-linode"></i> Kinh nghiệm: <%= @job.experience %></span>
</div>
</div>
<div class="col-lg-4 col-md-6">
<div class="detail_info">
<span><i class="fab fa-linode"></i> Cấp bậc: <%= @job.level %></span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-12 col-md-12">
<div class="box_detail_jobs">
<% if @job.description.include?('div') %>
<%= @job.description.html_safe %>
<% else %>
<pre class="pre_desc"><%= @job.description %></pre>
<% end %>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6 col-md-6">
<div class="btn_apply_job">
<%= link_to 'Nộp CV ngay', '#', class: 'btn btn-apply_job' %>
</div>
</div>
<div class="col-lg-6 col-md-6">
<div class="btn_apply_job">
<%= link_to 'Yêu thích', '#', class: 'btn btn-apply_job_favorite' %>
</div>
</div>
</div>
</div>
<%= render 'shared/scroll_top' %>
...@@ -7,7 +7,9 @@ ...@@ -7,7 +7,9 @@
<div class="breadcrumb_total_search"> <div class="breadcrumb_total_search">
<span class="breadcrumb-item active"> <span class="breadcrumb-item active">
<% if @data.total_count > 0 %> <% if @data.total_count > 0 %>
&nbsp;<b><%= @data.total_count %></b>&nbsp;kết quả phù hợp với từ khóa&nbsp;<b><%= @keyword %></b>&nbsp; <div style="word-wrap: break-word;">
<span>&nbsp;<b><%= @data.total_count %></b>&nbsp;kết quả phù hợp với từ khóa&nbsp;</span><b><%= @keyword %></b>&nbsp;
</div>
<% else %> <% else %>
Không có kết quả phù hợp với từ khóa&nbsp;<b><%= @keyword %></b> Không có kết quả phù hợp với từ khóa&nbsp;<b><%= @keyword %></b>
<% end %> <% end %>
...@@ -17,7 +19,7 @@ ...@@ -17,7 +19,7 @@
<div class="col-lg-12"> <div class="col-lg-12">
<div class="breadcrumb_total_search_pagination_jobs"> <div class="breadcrumb_total_search_pagination_jobs">
<div class="pagination_jobs"> <div class="pagination_jobs">
<div class="paginator"> <div id="paginator">
<%= paginate @data %> <%= paginate @data %>
</div> </div>
</div> </div>
...@@ -25,7 +27,6 @@ ...@@ -25,7 +27,6 @@
</div> </div>
</div> </div>
</div> </div>
<%= render 'job/modal_login'%>
<%= render partial: 'block_info_job', collection: @data, as: :data %> <%= render partial: 'block_info_job', collection: @data, as: :data %>
<div class="container"> <div class="container">
<div class="row"> <div class="row">
......
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/js/all.min.js"></script>
<link href="https://fonts.googleapis.com/css2?family=Raleway:wght@200&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Raleway:wght@200&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Raleway&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Raleway&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Open+Sans&display=swap" rel="stylesheet">
\ No newline at end of file
...@@ -4,7 +4,8 @@ Rails.application.routes.draw do ...@@ -4,7 +4,8 @@ Rails.application.routes.draw do
root 'home#index' root 'home#index'
get 'industries', to: 'industry#index', as: :industry_index get 'industries', to: 'industry#index', as: :industry_index
get 'cities', to: 'city#index', as: :city_index get 'cities', to: 'city#index', as: :city_index
# Details job
get 'detail/:id', to: 'job#detail', as: :detail_job
# Search # Search
get 'jobs/:model/:slug', to: 'job#index', as: :jobs get 'jobs/:model/:slug', to: 'job#index', as: :jobs
......
...@@ -19,6 +19,6 @@ ...@@ -19,6 +19,6 @@
# Learn more: http://github.com/javan/whenever # Learn more: http://github.com/javan/whenever
env :PATH, ENV['PATH'] env :PATH, ENV['PATH']
every 1.hours do every 10.minute do
rake 'crawler:populate' rake 'crawler:populate'
end end
\ No newline at end of file
require 'test_helper'
class JobDecoratorTest < Draper::TestCase
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