Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
venjob_nth
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
3
Merge Requests
3
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_nth
Commits
6031ca87
Commit
6031ca87
authored
Aug 18, 2020
by
Ngô Trung Hưng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
871a399c
Pipeline
#939
canceled with stages
in 0 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
29 deletions
+17
-29
app/controllers/application_controller.rb
+2
-8
app/controllers/apply_job_controller.rb
+4
-4
app/views/apply_job/index.html.erb
+9
-17
config/locales/en.yml
+1
-0
config/locales/vn.yml
+1
-0
No files found.
app/controllers/application_controller.rb
View file @
6031ca87
...
...
@@ -3,23 +3,17 @@
# Application controller
class
ApplicationController
<
ActionController
::
Base
protect_from_forgery
with: :exception
# before_action :debug
before_action
:configure_permitted_parameters
,
if: :devise_controller?
before_action
:set_locale
# def debug
# puts "ab"
# byebug
# puts "adcsdcds"
# end
def
set_locale
user_signed_in?
?
locale
=
current_user
.
language
.
to_sym
:
locale
=
params
[
:locale
].
to_s
.
strip
.
to_sym
locale
=
(
user_signed_in?
?
current_user
.
language
:
params
[
:locale
].
to_s
.
strip
)
.
to_sym
I18n
.
locale
=
I18n
.
available_locales
.
include?
(
locale
)
?
locale
:
I18n
.
default_locale
end
def
default_url_options
{
locale:
I18n
.
locale
}
{
locale:
I18n
.
locale
}
end
protected
...
...
app/controllers/apply_job_controller.rb
View file @
6031ca87
...
...
@@ -2,7 +2,7 @@
# Applied jobs controller
class
ApplyJobController
<
ApplicationController
before_action
:authenticate_user!
,
only: :apply
before_action
:authenticate_user!
def
index
@jobs
=
current_user
.
applied_jobs
.
page
(
params
[
:page
])
...
...
@@ -18,7 +18,7 @@ class ApplyJobController < ApplicationController
def
confirm
@apply_job
=
current_user
.
applied_jobs
.
new
(
applied_job_params
)
@apply_job
.
cv
=
current_user
.
cv
if
@apply_job
.
cv
.
blank?
session
[
:c
v_full_path
]
=
@apply_job
.
cv
.
path
session
[
:c
ache_name
]
=
@apply_job
.
cv
.
cache_name
if
@apply_job
.
invalid?
errors
=
[]
@apply_job
.
errors
.
full_messages
.
each
{
|
mess
|
errors
<<
"
#{
mess
}
<br>"
}
...
...
@@ -30,7 +30,7 @@ class ApplyJobController < ApplicationController
def
done
data_apply
=
current_user
.
applied_jobs
.
new
(
applied_job_params
)
data_apply
.
cv
=
File
.
new
(
session
[
:cv_full_path
])
data_apply
.
cv
.
retrieve_from_cache!
(
session
[
:cache_name
])
if
data_apply
.
save
AppliedMailer
.
applied_job_mail_to
(
current_user
.
applied_jobs
.
last
).
deliver_now
render
:done
...
...
@@ -38,7 +38,7 @@ class ApplyJobController < ApplicationController
flash
[
:error
]
=
t
(
'apply_job.error'
)
redirect_to
apply_path
(
job_id:
applied_job_params
[
:job_id
])
end
session
.
delete
(
:c
v_full_path
)
session
.
delete
(
:c
ache_name
)
end
private
...
...
app/views/apply_job/index.html.erb
View file @
6031ca87
...
...
@@ -7,34 +7,25 @@
</div>
<hr>
</div>
<div
class=
"col-lg-12"
>
<div
class=
"breadcrumb_total_search_pagination_jobs"
>
<div
class=
"pagination_jobs"
>
<div
id=
"paginator"
>
<%=
paginate
@jobs
%>
</div>
</div>
</div>
</div>
<%
if
@jobs
.
blank?
%>
<div
class=
"col-lg-12"
>
<div
class=
"breadcrumb_total_search"
>
<span
class=
"breadcrumb-item active"
>
No record
<%=
t
(
'apply_job.no_record'
)
%>
</span>
</div>
</div>
<%
else
%>
<%=
render
partial:
'apply_job/block_info_job'
,
collection:
@jobs
,
as: :data
%>
<%
end
%
>
<div
class=
"col-lg-12
"
>
<div
class=
"breadcrumb_total_search_
pagination_jobs"
>
<div
class=
"pagination_jobs
"
>
<div
id=
"paginator"
>
<
%=
paginate
@jobs
%
>
<div
class=
"col-lg-12"
>
<div
class=
"breadcrumb_total_search_pagination_jobs
"
>
<div
class=
"
pagination_jobs"
>
<div
id=
"paginator
"
>
<%=
paginate
@jobs
%
>
<
/div
>
</div>
</div>
</div>
<
/div
>
<
%
end
%
>
</div>
</div>
\ No newline at end of file
config/locales/en.yml
View file @
6031ca87
...
...
@@ -123,6 +123,7 @@ en:
confirm
:
'
Please
confirm
your
information'
applied
:
'
Applied'
title
:
'
List
Applied
Jobs'
no_record
:
"
You
haven't
applied
yet."
already_taken
:
'
We
have
received
your
resume,
the
employer
will
contact
you
as
soon
as
possible.'
activerecord
:
attributes
:
...
...
config/locales/vn.yml
View file @
6031ca87
...
...
@@ -123,6 +123,7 @@ vi:
confirm
:
'
Vui
lòng
xác
nhận
lại
thông
tin
của
bạn'
applied
:
'
Đã
ứng
tuyển'
title
:
'
Danh
sách
công
việc
đã
ứng
tuyển'
no_record
:
'
Bạn
chưa
ứng
tuyển
công
việc
nào
hết.'
already_taken
:
'
Chúng
tôi
đã
tiếp
nhận
hồ
sơ
của
bạn,
nhà
tuyển
dụng
sẽ
liên
hệ
đến
bạn
trong
thời
gian
sớm
nhất.'
activerecord
:
attributes
:
...
...
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