Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
Venjob_HungNT
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
Ngô Trung Hưng
Venjob_HungNT
Commits
99841a3b
Commit
99841a3b
authored
Jul 23, 2020
by
Ngo Trung Hung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create -top industry
parent
e1d92db5
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
34 additions
and
14 deletions
+34
-14
app/controllers/home_controller.rb
+1
-0
app/views/home/index.html.erb
+1
-0
app/views/shared/_block_cities_hot.html.erb
+2
-3
app/views/shared/_block_industries_hot.html.erb
+9
-0
app/views/shared/_box_nine_industries.html.erb
+18
-0
config/database.yml
+1
-1
lib/src/ftp.rb
+1
-2
lib/src/interface_web.rb
+1
-8
No files found.
app/controllers/home_controller.rb
View file @
99841a3b
...
...
@@ -6,5 +6,6 @@ class HomeController < ApplicationController
@five_jobs
=
Job
.
order
(
created_at: :asc
).
where
(
newdata:
1
).
limit
(
5
)
@cities
=
City
.
all
@top_city
=
City
.
top_hot
.
take
(
11
)
@top_industry
=
Industry
.
top_hot
.
take
(
11
)
end
end
app/views/home/index.html.erb
View file @
99841a3b
...
...
@@ -6,5 +6,6 @@
</div>
<%=
render
'shared/box_five_job'
%>
<%=
render
'shared/box_nine_city'
%>
<%=
render
'shared/box_nine_industries'
%>
app/views/shared/_block_cities_hot.html.erb
View file @
99841a3b
<div
class=
"box_info_city"
>
<div
class=
"ct_name"
>
<%=
link_to
name_city
,
'#'
,
class:
'link_ct'
%>
</div>
<div
class=
"ct_jobs_count"
>
<%=
link_to
"
#{
jobs_count
}
công việc"
,
'#'
,
class:
'link_ct'
%>
</div>
</div>
</div>
\ No newline at end of file
app/views/shared/_block_industries_hot.html.erb
0 → 100644
View file @
99841a3b
<div
class=
"box_info_city"
>
<div
class=
"ct_name"
>
<%=
link_to
industry
,
'#'
,
class:
'link_ct'
%>
</div>
<div
class=
"ct_jobs_count"
>
<%=
link_to
"
#{
jobs_count
}
công việc"
,
'#'
,
class:
'link_ct'
%>
</div>
</div>
\ No newline at end of file
app/views/shared/_box_nine_industries.html.erb
0 → 100644
View file @
99841a3b
<div
class=
"container"
>
<div
class=
"border_box_cities"
>
<div
class=
"box_text_five_jobs box_padding_city"
>
<span>
Top các nghành phổ biến
</span>
</div>
<div
class=
"row no-gutters"
>
<%
@top_industry
.
each
do
|
k
,
v
|
%>
<div
class=
"col-lg-4 col-md-4 col-sm-6 col-xs-12"
>
<%=
render
'shared/block_industries_hot'
,
industry:
k
,
jobs_count:
v
%>
</div>
<%
end
%>
<div
class=
"col-lg-4 col-md-4 col-sm-6 col-xs-12"
>
<%=
render
'shared/load_more_city'
%>
</div>
</div>
</div>
</div>
\ No newline at end of file
config/database.yml
View file @
99841a3b
...
...
@@ -14,7 +14,7 @@ default: &default
encoding
:
utf8
pool
:
<%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
username
:
root
password
:
'
1'
password
:
'
1
2345678
'
socket
:
/var/run/mysqld/mysqld.sock
...
...
lib/src/ftp.rb
View file @
99841a3b
...
...
@@ -21,7 +21,7 @@ class FtpSever
end
def
self
.
data_csv
donwload_csv
()
#
donwload_csv()
table
=
CSV
.
parse
(
File
.
read
(
"lib/csv/jobs.csv"
),
headers:
true
)
end
...
...
@@ -73,7 +73,6 @@ class FtpSever
puts
'Done import data companies'
end
def
self
.
parse_csv_jobs
(
data
)
Job
.
update_all
(
newdata:
0
)
data
[
'name'
].
each_with_index
do
|
name
,
index
|
...
...
lib/src/interface_web.rb
View file @
99841a3b
...
...
@@ -108,14 +108,7 @@ class InterfaceWeb
@industry_name
<<
industries
.
join
(
','
)
@description
<<
page
.
search
(
".tabs .tab-content .detail-row:nth-child(n)"
).
to_s
.
delete!
(
"[
\n
,
\t
,
\r
]"
)
get_level
=
page
.
search
(
".item-blue .detail-box:last ul li:nth-child(3)"
).
text
.
delete!
(
"[
\n
,
\t
,
\r
]"
).
lstrip
.
split
(
'Cấp bậc'
)
get_level
=
get_level
[
1
].
to_s
.
strip
if
get_level
==
""
g_level
=
page
.
search
(
".item-blue .detail-box:last ul li:nth-child(2)"
).
text
.
delete!
(
"[
\n
,
\t
,
\r
]"
).
lstrip
.
split
(
'Cấp bậc'
)
@level
<<
g_level
[
1
].
to_s
.
strip
else
g_level
=
page
.
search
(
".item-blue .detail-box:last ul li:nth-child(3)"
).
text
.
delete!
(
"[
\n
,
\t
,
\r
]"
).
lstrip
.
split
(
'Cấp bậc'
)
block_industries_hotlstrip
.
split
(
'Cấp bậc'
)
@level
<<
g_level
[
1
].
to_s
.
strip
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