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
ae5c94d7
Commit
ae5c94d7
authored
Oct 10, 2017
by
Hoang Nam Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'finish favirite_page'
parent
b67616df
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
92 additions
and
74 deletions
+92
-74
app/controllers/favorite_controller.rb
+9
-0
app/controllers/top_pages_controller.rb
+1
-1
app/controllers/users_controller.rb
+1
-0
app/models/history.rb
+1
-1
app/views/applies/_form_apply.html.erb
+47
-0
app/views/applies/new.html.erb
+5
-53
app/views/favorite/_favorite.html.erb
+8
-5
app/views/favorite/favorite_list.html.erb
+2
-0
app/views/job/_search.html.erb
+2
-2
app/views/job/detail.html.erb
+11
-9
app/views/top_pages/_history.html.erb
+2
-2
app/views/top_pages/_job.html.erb
+1
-1
config/routes.rb
+2
-0
No files found.
app/controllers/favorite_controller.rb
View file @
ae5c94d7
...
@@ -15,4 +15,13 @@ class FavoriteController < ApplicationController
...
@@ -15,4 +15,13 @@ class FavoriteController < ApplicationController
@user
=
current_user
@user
=
current_user
@jobs
=
::
Kaminari
.
paginate_array
(
@user
.
favorites
).
page
(
params
[
:page
]).
per
(
20
)
@jobs
=
::
Kaminari
.
paginate_array
(
@user
.
favorites
).
page
(
params
[
:page
]).
per
(
20
)
end
end
def
job_list_after_remove
@job
=
Job
.
find
(
params
[
:job_id
])
if
current_user
.
favorite?
(
@job
)
current_user
.
unfavorite!
(
@job
.
id
)
redirect_to
favorite_list_path
end
end
end
end
app/controllers/top_pages_controller.rb
View file @
ae5c94d7
...
@@ -17,7 +17,7 @@ class TopPagesController < ApplicationController
...
@@ -17,7 +17,7 @@ class TopPagesController < ApplicationController
def
history
def
history
@user
=
current_user
@user
=
current_user
@job
=
@user
.
histories
.
new_list_history
(
ENV
[
"NUMBER_HISTORY_PAGE"
])
@job
=
@user
.
histories
.
latest_histories
(
ENV
[
"NUMBER_HISTORY_PAGE"
])
end
end
def
index
def
index
...
...
app/controllers/users_controller.rb
View file @
ae5c94d7
...
@@ -54,6 +54,7 @@ class UsersController < ApplicationController
...
@@ -54,6 +54,7 @@ class UsersController < ApplicationController
@title
=
'Favorite Jobs'
@title
=
'Favorite Jobs'
@job
=
current_user
.
jobs
.
build
@job
=
current_user
.
jobs
.
build
end
end
private
private
def
user_params
def
user_params
...
...
app/models/history.rb
View file @
ae5c94d7
...
@@ -2,5 +2,5 @@ class History < ApplicationRecord
...
@@ -2,5 +2,5 @@ class History < ApplicationRecord
belongs_to
:user
belongs_to
:user
belongs_to
:job
belongs_to
:job
scope
:
new_list_history
,
->
(
num
)
{
order
(
id: :desc
).
limit
(
num
)}
scope
:
latest_histories
,
->
(
num
)
{
order
(
id: :desc
).
limit
(
num
)}
end
end
app/views/applies/_form_apply.html.erb
0 → 100644
View file @
ae5c94d7
<div
class=
"row mt-3"
>
<!--set field password -->
<div
class=
"col-md-2 mb-5"
>
<strong><i
class=
"text-danger"
>
<%=
f
.
label
:name
,
"Full Name"
,
class:
'form-label'
%>
</i></strong>
</div>
<!--set field password -->
<div
class=
"col-md-10"
>
<div
class=
"input-group"
>
<span
class=
"input-group-addon"
><i
class=
"fa fa-user fa"
aria-hidden=
"true"
></i></span>
<%=
f
.
text_field
:name
,
class:
'form-control'
%>
</div>
</div>
<!--end set field password -->
<!--set field email -->
<div
class=
"col-md-2"
>
<strong><i
class=
"text-danger"
>
<%=
f
.
label
:email
%>
</i></strong>
</div>
<!--set field email -->
<div
class=
"col-md-10"
>
<div
class=
"input-group"
>
<span
class=
"input-group-addon mb-5"
><i
class=
"fa fa-envelope"
aria-hidden=
"true"
></i></span>
<%=
f
.
email_field
:email
,
class:
'form-control mb-5'
%>
</div>
</div>
<!--end field email -->
<div
class=
"col-md-2"
>
<strong><i
class=
"text-danger"
>
My CV
</i></strong>
</div>
<%
if
current_user
.
cv?
%>
<div
class=
"col-md-10 mb-5 text-center"
>
<%=
link_to
'Download cv'
,
downloadcv_path
(
id:
@current_user
.
id
)
%>
</div>
<%
else
%>
<div
class =
"col-md-10 mb-5"
>
<%=
link_to
'Upload here'
,
edit_account_activation_path
(
id:
@current_user
.
id
)
%>
</div>
<%
end
%>
<!--end set field all -->
<div
class=
"col-sm-2"
></div>
<div
class=
"col-sm-10"
>
<%=
button_tag
(
type:
"submit"
,
class:
"btn btn-danger btn-block"
)
do
%>
<i
class=
"fa fa-check 4px"
></i>
Confirm
<%
end
%>
</div>
</div>
<!--end set button -->
\ No newline at end of file
app/views/applies/new.html.erb
View file @
ae5c94d7
...
@@ -19,60 +19,12 @@
...
@@ -19,60 +19,12 @@
<%
if
current_user
.
applied_job?
(
@apply_job
)
%>
<%
if
current_user
.
applied_job?
(
@apply_job
)
%>
<h2
class=
"text-center text-danger mt-5"
>
You applied this job
</h2>
<h2
class=
"text-center text-danger mt-5"
>
You applied this job
</h2>
<%
else
%>
<%
else
%>
<div
class=
"row ml-5 mt-5"
>
<div
class=
"row ml-5 mt-5"
>
<div
class=
"col-md-10 col-md-offset-3"
>
<div
class=
"col-md-10 col-md-offset-3"
>
<!--set message errors -->
<!--end set -->
<!--set field all -->
<%=
form_for
(
@user_apply
,
url:
new_info_path
)
do
|
f
|
%>
<%=
form_for
(
@user_apply
,
url:
new_info_path
)
do
|
f
|
%>
<%=
render
'shared/error_user_apply'
%>
<%=
render
'shared/error_user_apply'
%>
<div
class=
"row mt-3"
>
<%=
render
'form_apply'
,
f:
f
%>
<!--set field password -->
<div
class=
"col-md-2 mb-5"
>
<strong><i
class=
"text-danger"
>
<%=
f
.
label
:name
,
"Full Name"
,
class:
'form-label'
%>
</i></strong>
</div>
<!--set field password -->
<div
class=
"col-md-10"
>
<div
class=
"input-group"
>
<span
class=
"input-group-addon"
><i
class=
"fa fa-user fa"
aria-hidden=
"true"
></i></span>
<%=
f
.
text_field
:name
,
class:
'form-control'
%>
</div>
</div>
<!--end set field password -->
<!--set field email -->
<div
class=
"col-md-2"
>
<strong><i
class=
"text-danger"
>
<%=
f
.
label
:email
%>
</i></strong>
</div>
<!--set field email -->
<div
class=
"col-md-10"
>
<div
class=
"input-group"
>
<span
class=
"input-group-addon mb-5"
><i
class=
"fa fa-envelope"
aria-hidden=
"true"
></i></span>
<%=
f
.
email_field
:email
,
class:
'form-control mb-5'
%>
</div>
</div>
<!--end field email -->
<div
class=
"col-md-2"
>
<strong><i
class=
"text-danger"
>
My CV
</i></strong>
</div>
<%
if
current_user
.
cv?
%>
<div
class=
"col-md-10 mb-5 text-center"
>
<%=
link_to
'Download cv'
,
downloadcv_path
(
id:
@current_user
.
id
)
%>
</div>
<%
else
%>
<div
class =
"col-md-10 mb-5"
>
<%=
link_to
'Upload here'
,
edit_account_activation_path
(
id:
@current_user
.
id
)
%>
</div>
<%
end
%>
<!--end set field all -->
<div
class=
"col-sm-2"
></div>
<div
class=
"col-sm-10"
>
<%=
button_tag
(
type:
"submit"
,
class:
"btn btn-danger btn-block"
)
do
%>
<i
class=
"fa fa-check 4px"
></i>
Confirm
<%
end
%>
</div>
</div>
<!--end set button -->
<%
end
%>
<%
end
%>
<
%
end
%
>
<
/div
>
</div>
</div>
<
/div
>
<
%
end
%
>
app/views/favorite/_favorite.html.erb
View file @
ae5c94d7
...
@@ -28,11 +28,14 @@
...
@@ -28,11 +28,14 @@
</div>
</div>
</div>
</div>
<div
class=
"col-md-2 mt-2"
>
<div
class=
"col-12"
>
<div
id=
"follow_form_
<%=
favorite
.
job
.
id
%>
"
>
<div
class=
"row mt-4 mb-4"
>
<%
if
current_user
.
favorite?
(
favorite
.
job
)
%>
<div
class=
"col-md-9"
></div>
<%=
render
'favorite/destroy'
,
job_id:
favorite
.
job
.
id
%>
<div
class=
"col-md-3"
>
<%
end
%>
<%=
link_to
remove_job_path
(
job_id:
favorite
.
job
.
id
),
method: :delete
,
class:
'btn btn-primary btn-block'
,
remote:
true
do
%>
<i
class=
"fa fa-times"
></i>
Remove
<%
end
%>
</div>
</div>
</div>
</div>
</div>
...
...
app/views/favorite/favorite_list.html.erb
View file @
ae5c94d7
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
<%=
form_tag
(
form_apply_path
,
method: :get
)
do
%>
<%=
form_tag
(
form_apply_path
,
method: :get
)
do
%>
<%=
paginate
@jobs
,
theme:
'twitter-bootstrap-4'
%>
<%=
paginate
@jobs
,
theme:
'twitter-bootstrap-4'
%>
<%=
render
partial:
"favorite"
,
collection:
@jobs
,
as: :favorite
%>
<%=
render
partial:
"favorite"
,
collection:
@jobs
,
as: :favorite
%>
<%
if
current_user
.
favorites
.
count
>
0
%>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-sm-1"
></div>
<div
class=
"col-sm-1"
></div>
<div
class=
"col-sm-9"
>
<div
class=
"col-sm-9"
>
...
@@ -11,5 +12,6 @@
...
@@ -11,5 +12,6 @@
<%
end
%>
<%
end
%>
</div>
</div>
</div>
</div>
<%
end
%>
<%=
paginate
@jobs
,
theme:
'twitter-bootstrap-4'
%>
<%=
paginate
@jobs
,
theme:
'twitter-bootstrap-4'
%>
<%
end
%>
<%
end
%>
app/views/job/_search.html.erb
View file @
ae5c94d7
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<div
class=
"row mb-5"
>
<div
class=
"row mb-5"
>
<div
class=
"search_list titlejob col-md-10"
>
<div
class=
"search_list titlejob col-md-10"
>
<%=
link_to
job
[
'job_name'
].
join
(
','
),
job_detail_path
(
job
[
'job_id'
]),
class:
'search_list_jobs_title'
%>
<%=
link_to
job
[
'job_name'
].
join
(
','
),
job_detail_path
(
job
[
'job_id'
]),
class:
'search_list_jobs_title'
%>
<%
unless
job
[
'short_description'
].
nil
?
%>
<%
if
job
[
'short_description'
].
present
?
%>
<li
class=
"detail_description"
>
<li
class=
"detail_description"
>
<%=
truncate
job
[
'short_description'
].
join
(
','
)
,
length:
250
%>
<%=
truncate
job
[
'short_description'
].
join
(
','
)
,
length:
250
%>
<%=
link_to
'read more'
,
job_detail_path
(
job
[
'job_id'
])
%>
</li>
<%=
link_to
'read more'
,
job_detail_path
(
job
[
'job_id'
])
%>
</li>
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
<li
class=
"detail_description col-md-5"
>
<li
class=
"detail_description col-md-5"
>
<%=
job
[
'city_name'
].
join
(
','
)
%>
<%=
job
[
'city_name'
].
join
(
','
)
%>
</li>
</li>
<%
unless
job
[
'salary'
].
nil
?
%>
<%
if
job
[
'salary'
].
present
?
%>
<li
class=
" detail_description float-right text-success col-md-5"
>
<li
class=
" detail_description float-right text-success col-md-5"
>
<%=
job
[
'salary'
].
join
(
','
)
%>
<%=
job
[
'salary'
].
join
(
','
)
%>
</li>
</li>
...
...
app/views/job/detail.html.erb
View file @
ae5c94d7
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
<%
end
%>
<%
end
%>
<%=
link_to
industries_path
,
class:
'btn btn-primary'
do
%>
<%=
link_to
industries_path
,
class:
'btn btn-primary'
do
%>
<i
class=
"fa fa-
location-arrow
"
></i>
INDUSTRY
<i
class=
"fa fa-
industry
"
></i>
INDUSTRY
<%
end
%>
<%
end
%>
<%=
link_to
'#'
,
class:
'btn btn-warning'
do
%>
<%=
link_to
'#'
,
class:
'btn btn-warning'
do
%>
...
@@ -51,15 +51,17 @@
...
@@ -51,15 +51,17 @@
<%=
link_to
'Apply'
,
login_user_path
,
{
class:
'btn btn-success text-white w-25'
}
%>
<%=
link_to
'Apply'
,
login_user_path
,
{
class:
'btn btn-success text-white w-25'
}
%>
<%
end
%>
<%
end
%>
<div
class=
"btn text-white w-25"
>
<%
if
logged_in?
%>
<div
id=
"follow_form_
<%=
@job
.
id
%>
"
>
<div
class=
"btn text-white w-25"
>
<%
if
current_user
.
favorite?
(
@job
)
%>
<div
id=
"follow_form_
<%=
@job
.
id
%>
"
>
<%=
render
'favorite/destroy'
,
job_id:
@job
.
id
%>
<%
if
current_user
.
favorite?
(
@job
)
%>
<%
else
%>
<%=
render
'favorite/destroy'
,
job_id:
@job
.
id
%>
<%=
render
'favorite/create'
,
job_id:
@job
.
id
%>
<%
else
%>
<%
end
%>
<%=
render
'favorite/create'
,
job_id:
@job
.
id
%>
<%
end
%>
</div>
</div>
</div>
<
/div
>
<
%
end
%
>
</div>
</div>
</div>
</div>
...
...
app/views/top_pages/_history.html.erb
View file @
ae5c94d7
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
<div
class=
"col-11"
>
<div
class=
"col-11"
>
<%=
link_to
history
.
job
.
job_title
,
job_detail_path
(
history
.
job
.
id
),
class:
'search_list_jobs_title'
%>
<%=
link_to
history
.
job
.
job_title
,
job_detail_path
(
history
.
job
.
id
),
class:
'search_list_jobs_title'
%>
<%
unless
history
.
job
.
short_description
.
nil
?
%>
<%
if
history
.
job
.
short_description
.
present
?
%>
<li
class=
"detail_description"
>
<li
class=
"detail_description"
>
<%=
truncate
history
.
job
.
short_description
,
length:
250
%>
<%=
truncate
history
.
job
.
short_description
,
length:
250
%>
<%=
link_to
'read more'
,
job_detail_path
(
history
.
job
.
id
)
%>
</li>
<%=
link_to
'read more'
,
job_detail_path
(
history
.
job
.
id
)
%>
</li>
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
<li
class=
"detail_description col-md-5"
>
<li
class=
"detail_description col-md-5"
>
<%=
history
.
job
.
cities
.
map
(
&
:location
).
join
(
','
)
%>
<%=
history
.
job
.
cities
.
map
(
&
:location
).
join
(
','
)
%>
</li>
</li>
<%
unless
history
.
job
.
salary
.
nil
?
%>
<%
if
history
.
job
.
salary
.
present
?
%>
<li
class=
" detail_description float-right text-success col-md-5"
>
<li
class=
" detail_description float-right text-success col-md-5"
>
<%=
history
.
job
.
salary
%>
<%=
history
.
job
.
salary
%>
</li>
</li>
...
...
app/views/top_pages/_job.html.erb
View file @
ae5c94d7
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
</a>
</a>
<div
class=
"content_job"
>
<div
class=
"content_job"
>
<%
unless
job
.
short_description
.
nil
?
%>
<%
if
job
.
short_description
.
present
?
%>
<li
class=
"detail_description"
>
<%=
truncate
job
.
short_description
,
length:
160
%>
<li
class=
"detail_description"
>
<%=
truncate
job
.
short_description
,
length:
160
%>
<%=
link_to
'read more'
,
'#'
%>
</li>
<%=
link_to
'read more'
,
'#'
%>
</li>
<%
end
%>
<%
end
%>
...
...
config/routes.rb
View file @
ae5c94d7
...
@@ -39,5 +39,7 @@ Rails.application.routes.draw do
...
@@ -39,5 +39,7 @@ Rails.application.routes.draw do
post
'/favorites'
,
controller: :favorite
,
action: :create
,
as: :create_favorite
post
'/favorites'
,
controller: :favorite
,
action: :create
,
as: :create_favorite
delete
'/favorites'
,
controller: :favorite
,
action: :destroy
,
as: :destroy_favorite
delete
'/favorites'
,
controller: :favorite
,
action: :destroy
,
as: :destroy_favorite
get
'/favorite_list'
,
controller: :favorite
,
action: :favorite_list
,
as: :favorite_list
get
'/favorite_list'
,
controller: :favorite
,
action: :favorite_list
,
as: :favorite_list
delete
'/favorite_remove'
,
controller: :favorite
,
action: :job_list_after_remove
,
as: :remove_job
mount
Sidekiq
::
Web
=>
'/sidekiq'
mount
Sidekiq
::
Web
=>
'/sidekiq'
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