Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
ven-job
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
Trịnh Hoàng Phúc
ven-job
Commits
522547c1
Commit
522547c1
authored
Apr 09, 2020
by
Hoang Phuc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
History page, defind route,controller,AJAX Apply job
parent
0d8a8c83
Pipeline
#570
failed with stages
in 0 seconds
Changes
9
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
98 additions
and
14 deletions
+98
-14
app/assets/javascript/application.js
+0
-0
app/assets/stylesheets/css/style2.css
+10
-8
app/assets/stylesheets/js/custom.js
+21
-3
app/controllers/history_controller.rb
+2
-1
app/controllers/job_controller.rb
+6
-0
app/views/history/index.html.erb
+56
-0
app/views/job/show.html.erb
+1
-1
app/views/layouts/application.html.erb
+0
-1
config/routes.rb
+2
-0
No files found.
app/assets/javascript/application.js
deleted
100644 → 0
View file @
0d8a8c83
app/assets/stylesheets/css/style2.css
View file @
522547c1
...
...
@@ -78,27 +78,29 @@ ul.job_listings .job_listing:hover, .job_position_featured, li.type-resume:hover
}
.button--type-inverted
,
.widget--home-video
.button
,
.load_more_jobs
strong
,
.load_more_resumes
strong
,
.job-manager-form.wp-job-manager-bookmarks-form
a
.bookmark-notice
,
.job-manager-form.wp-job-manager-favorites-form
a
.favorite-notice
{
color
:
#7dc246
;
border-color
:
#7dc246
;
}
.button--type-inverted
:hover
,
.widget--home-video
.button
:hover
,
.load_more_jobs
strong
:hover
,
.load_more_resumes
strong
:hover
,
.job-manager-form.wp-job-manager-bookmarks-form
a
.bookmark-notice
:hover
,
.job-manager-form.wp-job-manager-favorites-form
a
.favorite-notice
:hover
{
background-color
:
#7dc246
;
color
:
#fff
;
}
.button--type-
action
,
.button--type-secondary
:hover
,
.single-product
#content
.single_add_to_cart_button
,
.checkout-button
,
#place_order
,
input
[
type
=
button
]
.application_button
,
.application_button_link
,
input
[
type
=
button
]
.resume_contact_button
{
.button--type-
inverted
:hover
,
.widget--home-video
.button
:hover
,
.load_more_jobs
strong
:hover
,
.load_more_resumes
strong
:hover
,
.job-manager-form.wp-job-manager-bookmarks-form
a
.bookmark-notice
:hover
,
.job-manager-form.wp-job-manager-favorites-form
a
.favorite-notice
:hover
{
color
:
#7dc246
;
background-color
:
transparent
;
border-color
:
#7dc246
;
background-color
:
transparent
;
}
.button--type-action
:hover
,
.button--type-secondary
,
.single-product
#content
.single_add_to_cart_button
:hover
,
.checkout-button
:hover
,
#place_order
:hover
,
input
[
type
=
button
]
.application_button
:hover
,
.application_button_link
:hover
,
input
[
type
=
button
]
.resume_contact_button
:hover
{
.button--type-action
,
.button--type-secondary
:hover
,
.single-product
#content
.single_add_to_cart_button
,
.checkout-button
,
#place_order
,
input
[
type
=
button
]
.application_button
,
.application_button_link
,
input
[
type
=
button
]
.resume_contact_button
{
background-color
:
#7dc246
;
color
:
#ffffff
;
border-color
:
#7dc246
;
}
.button--type-action
:hover
,
.button--type-secondary
,
.single-product
#content
.single_add_to_cart_button
:hover
,
.checkout-button
:hover
,
#place_order
:hover
,
input
[
type
=
button
]
.application_button
:hover
,
.application_button_link
:hover
,
input
[
type
=
button
]
.resume_contact_button
:hover
{
color
:
#7dc246
;
background-color
:
transparent
;
border-color
:
#7dc246
;
}
.button--color-white
,
.button--color-white.button--type-inverted
:hover
,
.button--type-hover-white
:hover
{
color
:
#797979
;
background-color
:
#ffffff
;
...
...
app/assets/stylesheets/js/custom.js
View file @
522547c1
(
function
(
$
)
{
(
function
(
$
)
{
$
(
window
).
scroll
(
function
()
{
var
scroll
=
$
(
window
).
scrollTop
();
if
(
scroll
>=
1000
)
{
...
...
@@ -7,7 +7,24 @@
$
(
".back2top"
).
removeClass
(
"active"
);
}
});
$
(
".back2top"
).
click
(
function
(){
$
(
"html, body"
).
animate
({
scrollTop
:
0
},
500
);
$
(
".back2top"
).
click
(
function
()
{
$
(
"html, body"
).
animate
({
scrollTop
:
0
},
500
);
})
$
(
".job_application .application_button"
).
click
(
function
(
e
)
{
e
.
preventDefault
()
data
=
{
job_ids
:
[
$
(
this
).
data
(
"id"
)]
}
$
.
ajax
({
url
:
'/job/apply'
,
data
:
data
,
type
:
'POST'
,
success
:
(
res
)
=>
{
console
.
log
(
"response: "
,
res
)
},
error
:
(
err
)
=>
{
console
.
log
(
"error: "
,
err
)
}
});
})
})(
jQuery
);
\ No newline at end of file
app/controllers/history_controller.rb
View file @
522547c1
...
...
@@ -3,7 +3,8 @@ class HistoryController < ApplicationController
if
cookies
[
:job_ids_history
].
nil?
redirect_to
'/jobs'
else
arr_job_ids
=
cookies
[
:job_ids_history
].
split
(
","
)
job_ids
=
cookies
[
:job_ids_history
].
split
(
","
)
@jobs_history
=
Job
.
where
(
'id IN (?)'
,
job_ids
).
order
(
"id DESC"
)
end
end
end
app/controllers/job_controller.rb
View file @
522547c1
...
...
@@ -21,10 +21,16 @@ class JobController < ApplicationController
else
arr_job_ids
=
cookies
[
:job_ids_history
].
split
(
","
)
unless
arr_job_ids
.
include?
(
@job
.
id
.
to_s
)
if
arr_job_ids
.
count
==
10
arr_job_ids
.
shift
end
arr_job_ids
<<
@job
.
id
.
to_s
end
cookies
[
:job_ids_history
]
=
{
value:
arr_job_ids
.
join
(
","
),
expires:
Time
.
now
+
3600
}
end
@relate_jobs
=
Job
.
where
(
"company_id =
#{
@job
.
company_id
}
and id !=
#{
@job
.
id
}
"
).
limit
(
3
).
order
(
"id DESC"
)
end
def
apply_jobs
end
end
app/views/history/index.html.erb
View file @
522547c1
<%=
content_for
:title
,
"VenJob - History"
%>
<header
class=
"page-header"
>
<h2
class=
"page-title"
>
History
</h2>
</header>
<div
id=
"primary"
class=
"content-area container"
role=
"main"
>
<article
id=
"post-2452"
class=
"post-2452 page type-page status-publish hentry"
>
<div
class=
"entry-content"
>
<div
class=
"woocommerce"
>
<div
class=
"woocommerce-notices-wrapper"
></div>
<table
class=
"shop_table shop_table_responsive cart woocommerce-cart-form__contents"
cellspacing=
"0"
>
<thead>
<tr>
<th
class=
"product-remove"
>
No.
</th>
<th
class=
"product-thumbnail"
>
</th>
<th
class=
"product-name"
>
Title
</th>
<th
class=
"product-price"
>
City
</th>
<th
class=
"product-quantity"
>
Salary
</th>
</tr>
</thead>
<tbody>
<%
@jobs_history
.
each_with_index
do
|
job
,
index
|
%>
<tr
class=
"woocommerce-cart-form__cart-item cart_item"
>
<td>
<%=
index
+
1
%>
</td>
<td
style=
"text-align: center;"
>
<input
type=
"checkbox"
>
</td>
<td>
<%=
job
.
title
%>
</td>
<td>
<%
job
.
cities
.
each_with_index
do
|
city
,
index
|
%>
<%=
city
.
title
%><%=
", "
if
index
!=
job
.
cities
.
size
-
1
%>
<%
end
%>
</td>
<td
class=
"product-price"
>
<%=
job
.
salary
%>
</td>
<td
class=
"product-quantity"
>
</td>
</tr>
<%
end
%>
<tr>
<td
colspan=
"6"
class=
"actions"
>
<button
type=
"submit"
class=
"button"
name=
"update_cart"
value=
"Update cart"
>
Apply all
</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</article>
</div>
\ No newline at end of file
app/views/job/show.html.erb
View file @
522547c1
...
...
@@ -30,7 +30,7 @@
</aside>
<aside
class=
"widget widget--job_listing"
>
<div
class=
"job_application application"
>
<input
type=
"button"
class=
"application_button button"
value=
"Apply for job"
/>
<input
type=
"button"
class=
"application_button button"
value=
"Apply for job"
data-id=
"
<%=
@job
.
id
%>
"
/>
</div>
<div
class=
"job-manager-form wp-job-manager-bookmarks-form"
>
<a
class=
"bookmark-notice"
href=
"https://jobify-demos.astoundify.com/classic/account/"
>
Favorite
</a>
...
...
app/views/layouts/application.html.erb
View file @
522547c1
...
...
@@ -13,7 +13,6 @@
<%=
javascript_include_tag
"/assets/js/jquery.js"
%>
<%=
javascript_include_tag
"/assets/js/jquery-migrate.min.js"
%>
<%=
javascript_include_tag
"https://maps.googleapis.com/maps/api/js?v=3&libraries=geometry%2Cplaces&language=en&key=AIzaSyDFtSmGkBIXtMX63-bZKn50-6p3vZ2-WHE&ver=5.3.2"
%>
<%=
javascript_include_tag
'application'
,
'data-turbolinks-track'
:
'reload'
%>
<%=
javascript_pack_tag
'application'
,
'data-turbolinks-track'
:
'reload'
%>
</head>
...
...
config/routes.rb
View file @
522547c1
...
...
@@ -8,4 +8,6 @@ Rails.application.routes.draw do
get
'/cities/'
,
to:
'city#index'
get
'/industries/'
,
to:
'industry#index'
get
'/history/'
,
to:
'history#index'
post
'job/apply'
,
to:
'job#apply_jobs'
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