Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
venjob
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Huỳnh Thiên Phước
venjob
Commits
ce9f7cf5
Commit
ce9f7cf5
authored
Aug 05, 2020
by
Huỳnh Thiên Phước
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
connect link for industry and city
parent
051e1f53
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
37 additions
and
11 deletions
+37
-11
app/controllers/jobs_controller.rb
+10
-0
app/views/cities/_cities_vietnam.html.erb
+1
-1
app/views/industries/_all_industries.html.erb
+1
-1
app/views/jobs/_all_jobs.html.erb
+2
-2
app/views/jobs/city_jobs.html.erb
+1
-1
app/views/jobs/industry_jobs.html.erb
+15
-0
app/views/jobs/show.html.erb
+0
-0
app/views/layouts/_show_cities.html.erb
+1
-1
app/views/layouts/_show_industries.html.erb
+1
-1
app/views/layouts/_show_jobs.html.erb
+1
-1
config/routes.rb
+2
-1
lib/tasks/crawler_import.rake
+2
-2
No files found.
app/controllers/jobs_controller.rb
View file @
ce9f7cf5
...
...
@@ -5,6 +5,7 @@ class JobsController < ApplicationController
@total_job
=
Job
.
count
@jobs_list
=
Job
.
all_job
.
page
(
params
[
:page
]).
per
(
20
)
end
def
city_jobs
@cities
=
City
.
all
@industries
=
Industry
.
all
...
...
@@ -13,4 +14,13 @@ class JobsController < ApplicationController
@total_job
=
Job
.
count
@result_for_job
=
@city
.
jobs
.
count
end
def
industry_jobs
@cities
=
City
.
all
@industries
=
Industry
.
all
@industry
=
Industry
.
find
(
params
[
:id
])
@jobs_list
=
@industry
.
jobs
.
all_job
.
page
(
params
[
:page
]).
per
(
20
)
@total_job
=
Job
.
count
@result_for_job
=
@industry
.
jobs
.
count
end
end
app/views/cities/_cities_vietnam.html.erb
View file @
ce9f7cf5
<div
class=
"col-3 remove-decoration"
>
<%=
link_to
'#'
do
%>
<%=
link_to
city_jobs_path
(
city
.
id
)
do
%>
<div
class=
"border border-dark rounded international-name"
>
<div>
<strong>
<%=
city
.
name
%>
</strong>
...
...
app/views/industries/_all_industries.html.erb
View file @
ce9f7cf5
<div
class=
"col-3 remove-decoration"
>
<%=
link_to
'#'
do
%>
<%=
link_to
industry_jobs_path
(
industry
.
id
)
do
%>
<div
class=
"border border-dark rounded industry-details"
>
<div>
<strong>
<%=
industry
.
name
%>
</strong>
...
...
app/views/jobs/_all_jobs.html.erb
View file @
ce9f7cf5
...
...
@@ -3,12 +3,12 @@
<div
class=
"job-details"
>
<div
class=
"title"
><strong>
<%=
job
.
title
%>
</strong></div>
<div
class=
"row"
>
<div
class=
"col-
4
"
>
▼
<div
class=
"col-
6
"
>
▼
<%
job
.
cities
.
each
do
|
city
|
%>
<%=
city
.
name
%>
<%
end
%>
</div>
<div
class=
"col-4 salary"
>
Salary:
<%=
job
.
salary
%>
</div>
<div
class=
"col-4 salary"
>
💲
Salary:
<%=
job
.
salary
%>
</div>
<div
class=
"col-10 introduction"
>
<%=
job_description
(
job
.
description
)
%>
<br>
<%=
link_to
'Read more..'
,
'#'
%>
...
...
app/views/jobs/city_jobs.html.erb
View file @
ce9f7cf5
<%
provide
(
:title
,
'Jobs'
)
%>
<%
provide
(
:title
,
'
City
Jobs'
)
%>
<div
class=
"container"
>
<div
class=
"search-bar"
>
<%=
render
'layouts/search_bar'
%>
...
...
app/views/jobs/industry_jobs.html.erb
0 → 100644
View file @
ce9f7cf5
<%
provide
(
:title
,
'Industry Jobs'
)
%>
<div
class=
"container"
>
<div
class=
"search-bar"
>
<%=
render
'layouts/search_bar'
%>
</div>
<div
class=
"row total-jobs"
>
<div
class=
"col-4"
>
Total:
<%=
@total_job
%>
jobs
</div>
<div
class=
"col-4"
>
Result for:
<%=
@result_for_job
%>
jobs
</div>
</div>
<%=
render
"jobs/pagination"
%>
<div
class=
"job-list"
>
<%=
render
partial:
"all_jobs"
,
collection:
@jobs_list
,
as: :job
%>
</div>
<%=
render
"jobs/pagination"
%>
</div>
app/views/jobs/show.html.erb
deleted
100644 → 0
View file @
051e1f53
app/views/layouts/_show_cities.html.erb
View file @
ce9f7cf5
<div
class=
"col-4"
>
<div
class=
"row-table border border-dark rounded city-list"
>
<%=
link_to
"
#{
city_jobs_path
}
/cities/
#{
city
.
id
}
"
do
%>
<%=
link_to
city_jobs_path
(
city
.
id
)
do
%>
<div
class=
"city-name"
><strong>
<%=
city
.
name
%>
</strong></div>
<div
class=
"count-job"
>
<%=
city
.
jobs
.
count
%>
</div>
<%
end
%>
...
...
app/views/layouts/_show_industries.html.erb
View file @
ce9f7cf5
<div
class=
"col-4"
>
<div
class=
"row-table border border-dark rounded industry-list"
>
<%=
link_to
'#'
do
%>
<%=
link_to
industry_jobs_path
(
industry
.
id
)
do
%>
<div
class=
"industry-name"
><strong>
<%=
industry
.
name
%>
</strong></div>
<div
class=
"count-job"
>
<%=
industry
.
jobs
.
count
%>
</div>
<%
end
%>
...
...
app/views/layouts/_show_jobs.html.erb
View file @
ce9f7cf5
...
...
@@ -3,7 +3,7 @@
<div
class=
"job-details"
>
<div
class=
"title"
><strong>
<%=
job
.
title
%>
</strong></div>
<div>
<%=
job
.
company_name
%>
</div>
<div
class=
"salary"
>
Salary:
<%=
job
.
salary
%>
</div>
<div
class=
"salary"
>
💲
Salary:
<%=
job
.
salary
%>
</div>
<div>
▼
<%
job
.
cities
.
each
do
|
city
|
%>
<%=
city
.
name
%>
...
...
config/routes.rb
View file @
ce9f7cf5
Rails
.
application
.
routes
.
draw
do
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
resources
:jobs
get
'jobs/cities/:id'
,
to:
'jobs#city_jobs'
get
'jobs/cities/:id'
,
to:
'jobs#city_jobs'
,
as: :city_jobs
get
'jobs/industries/:id'
,
to:
'jobs#industry_jobs'
,
as: :industry_jobs
resources
:top_pages
resources
:industries
...
...
lib/tasks/crawler_import.rake
View file @
ce9f7cf5
...
...
@@ -9,9 +9,9 @@ namespace :import do
end
desc
'Crontab'
task
auto: :environment
do
crontab
=
JobParser
.
new
(
logger
,
url
)
parser
=
JobParser
.
new
(
logger
,
url
)
csv_importer
=
CSVImporter
.
new
(
logger
)
crontab
.
crawl_all
parser
.
crawl_all
csv_importer
.
import
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment