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
2
Merge Requests
2
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
Hoang Nam Nguyen
Venjob
Commits
1f28d7e7
Commit
1f28d7e7
authored
Sep 12, 2017
by
Hoang Nam Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'Finished fix'
parent
fbaa932a
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
18 additions
and
76 deletions
+18
-76
app/assets/stylesheets/custom.scss
+2
-4
app/controllers/top_pages_controller.rb
+2
-4
app/models/job_city.rb
+2
-2
app/views/layouts/_header.html.erb
+1
-1
app/views/layouts/application.html.erb
+1
-1
app/views/top_pages/_cities.html.erb
+3
-9
app/views/top_pages/_index.html.erb
+2
-11
app/views/top_pages/_industry.html.erb
+0
-13
app/views/top_pages/toppage.html.erb
+0
-27
config/routes.rb
+2
-2
db/migrate/20170911032843_create_job_cities.rb
+3
-2
No files found.
app/assets/stylesheets/custom.scss
View file @
1f28d7e7
/* header */
#logo
{
width
:
230px
;
height
:
120px
;
width
:
35%
;
}
#distance
{
...
...
@@ -37,8 +36,7 @@ input[type=text]:focus {
#image_height
{
padding-left
:
5px
;
width
:
1835px
;
height
:
430px
;
width
:
99
.5%
;
}
#fontwords
{
...
...
app/controllers/top_pages_controller.rb
View file @
1f28d7e7
...
...
@@ -5,16 +5,14 @@ class TopPagesController < ApplicationController
def
industries
end
def
toppage
@jobs
=
Job
.
limit
(
5
)
def
top
_
page
@jobs
=
Job
.
order
(
short_description: :desc
,
job_title: :desc
,
salary: :desc
).
limit
(
5
)
@cities
=
City
.
limit
(
9
)
@total_job
=
Job
.
count
@industries
=
Industry
.
limit
(
9
)
end
def
show
@job
=
Job
.
find
(
params
[
:id
])
@city
=
City
.
find
(
params
)
end
def
index
...
...
app/models/job_city.rb
View file @
1f28d7e7
class
JobCity
<
ApplicationRecord
belongs_to
:job
belongs_to
:city
belongs_to
:job
,
index:
true
belongs_to
:city
,
index:
true
end
app/views/layouts/_header.html.erb
View file @
1f28d7e7
<nav
class=
"navbar navbar-light bg-faded"
>
<div
class=
"container-fluid"
>
<div
class=
"navbar-header"
>
<img
src=
"
http://news.zigexn.co.jp/wp-content/uploads/img_pgpfb.png
"
class=
"navbar-brand"
id=
"logo"
href=
"zigexn.vn"
>
<img
src=
"
/assets/logo-de7018dbfd264fe7911d4f13f8ae89a4697a4624ae01a49de6e8df3f8e507041.png"
"
class=
"navbar-brand"
id=
"logo"
href=
"zigexn.vn"
>
</div>
<ul
class=
"nav navbar-nav"
id=
"slide"
>
<li><button
type=
"button"
class=
"btn btn-info"
id=
"distance"
>
Login
</button></li>
...
...
app/views/layouts/application.html.erb
View file @
1f28d7e7
...
...
@@ -9,7 +9,7 @@
<body>
<%=
render
'layouts/header'
%>
<img
src=
"
https://images.careerbuilder.vn/background/chubb_1440x430_2017_08_25_orange_1503979439
.jpg"
id=
"image_height"
>
<img
src=
"
/assets/home_page-92e377f3edbb7945c7f7dc0ff74c6eec72b0d154f7fe3e301043af8c6fc58312
.jpg"
id=
"image_height"
>
<div
class=
"container"
>
<%=
yield
%>
<%=
render
'layouts/footer'
%>
...
...
app/views/top_pages/_cities.html.erb
View file @
1f28d7e7
<%
@cities
.
each
do
|
city
|
%>
<div
class=
"col-md-4 column_set"
>
<a
href=
"#"
class=
"titlejob"
>
<p>
<%=
city
.
location
%>
</p>
</a>
<li
class=
"total_jobs"
>
<%=
city
.
jobs
.
count
%>
Jobs
</li>
<%=
render
partial:
"city"
,
locals:
{
city:
city
}
unless
city
.
jobs
.
count
.
zero?
%>
</div>
<%
end
%>
<div>
<button
type=
"button"
class=
"btn btn-success"
id=
"cities_button"
>
All Cities
</button>
<button
type=
"button"
class=
"btn btn-success"
id=
"cities_button"
>
All Cities
</button>
</div>
\ No newline at end of file
app/views/top_pages/_index.html.erb
View file @
1f28d7e7
<div
class=
"jobs list-group-item"
>
<%
@jobs
.
each
do
|
job
|
%>
<a
href=
"#"
>
<p>
<%=
job
.
job_title
%>
</p>
</a>
<li
class=
"detail_description"
>
<%=
truncate
job
.
short_description
,
length:
160
%>
<%=
link_to
'read more'
,
'#'
%>
</li>
<li
class=
"detail_description"
>
<%=
job
.
salary
%>
</li>
<%
job
.
cities
.
each
do
|
city
|
%>
<li
class=
"detail_description"
>
<%=
city
.
location
%>
</li>
<%
end
%>
<%=
render
partial:
"job"
,
locals:
{
job:
job
}
%>
<%
end
%>
</div>
\ No newline at end of file
app/views/top_pages/_industry.html.erb
deleted
100644 → 0
View file @
fbaa932a
<%
@industries
.
each
do
|
industry
|
%>
<div
class=
"col-md-4 column_set"
>
<a
href=
"#"
class=
"titlejob"
>
<p>
<%=
industry
.
industry_name
%>
</p>
</a>
</div>
<%
end
%>
<div>
<button
type=
"button"
class=
"btn btn-success"
id=
"cities_button"
>
All Industry
</button>
</div>
\ No newline at end of file
app/views/top_pages/toppage.html.erb
deleted
100644 → 0
View file @
fbaa932a
<div
class=
"row"
>
<div
class=
"col"
>
<h1
id=
"fontwords"
>
Total jobs:
<em>
<%=
@total_job
%>
</em>
job
</h1>
</div>
</div>
<div
class=
"row"
>
<input
type=
"text"
name=
"search"
placeholder=
"Search...."
id=
"search_box"
>
<button
type=
"button"
class=
"btn btn-success"
id=
"search_button"
>
Search
</button>
</div>
<p
class=
"text-success line_job"
>
Latest Jobs
</p>
<div
class=
"row"
>
<%=
render
'index'
%>
</div>
<p
class=
"text-success line_job"
>
Top Cities
</p>
<div
class=
"row cities"
>
<%=
render
'cities'
%>
</div>
<p
class=
"text-success line_job"
>
Top Industry
</p>
<div
class=
"row cities"
>
<%=
render
'industry'
%>
</div>
config/routes.rb
View file @
1f28d7e7
Rails
.
application
.
routes
.
draw
do
get
'top_pages/cities'
get
'top_pages/industries'
get
'top_pages/toppage'
get
'top_pages/top
_
page'
get
'top_pages/job'
root
'top_pages#toppage'
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
root
'top_pages#top
_
page'
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
end
db/migrate/20170911032843_create_job_cities.rb
View file @
1f28d7e7
class
CreateJobCities
<
ActiveRecord
::
Migration
[
5.1
]
def
change
create_table
:job_cities
do
|
t
|
t
.
belongs_to
:city
t
.
belongs_to
:job
t
.
belongs_to
:city
,
index:
true
t
.
belongs_to
:job
,
index:
true
t
.
timestamps
add_index
end
end
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