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
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
Huỳnh Thiên Phước
venjob
Commits
ca4676d4
Commit
ca4676d4
authored
Aug 26, 2020
by
Huỳnh Thiên Phước
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
append conditions in apply_job
parent
d02b7680
Pipeline
#1020
failed with stages
in 0 seconds
Changes
19
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
31 additions
and
13 deletions
+31
-13
app/assets/stylesheets/jobs.scss
+1
-1
app/controllers/job_applieds_controller.rb
+5
-3
app/mailers/confirmation_mailer.rb
+1
-1
app/mailers/job_applied_mailer.rb
+1
-1
app/mailers/reset_password_mailer.rb
+1
-1
app/models/job.rb
+3
-0
app/views/job_applieds/_my_jobs.html.erb
+4
-4
app/views/job_applieds/show.html.erb
+8
-2
config/settings/development.yml
+7
-0
public/uploads/job_applied/cv_user/20/document1.pdf
+0
-0
public/uploads/job_applied/cv_user/21/Document-converted.pdf
+0
-0
public/uploads/job_applied/cv_user/22/Document-converted.pdf
+0
-0
public/uploads/job_applied/cv_user/23/Document-converted.pdf
+0
-0
public/uploads/job_applied/cv_user/24/Document-converted.pdf
+0
-0
public/uploads/job_applied/cv_user/25/document1.pdf
+0
-0
public/uploads/job_applied/cv_user/26/Document-converted__1_.pdf
+0
-0
public/uploads/job_applied/cv_user/27/Document-converted.pdf
+0
-0
public/uploads/job_applied/cv_user/28/document1.pdf
+0
-0
public/uploads/job_applied/cv_user/29/Document-converted__1_.pdf
+0
-0
No files found.
app/assets/stylesheets/jobs.scss
View file @
ca4676d4
...
...
@@ -63,7 +63,7 @@
.industry
:last-child::after
,
.location
:last-child::after
{
content
:
""
;
}
.my-job-label
{
.my-job-label
,
.let-apply
{
padding
:
30px
;
margin
:
30px
;
}
app/controllers/job_applieds_controller.rb
View file @
ca4676d4
class
JobAppliedsController
<
ApplicationController
before_action
:sign_in_validation
,
only:
[
:new
,
:confirmation
,
:create
]
before_action
:sign_in_validation
,
only:
[
:new
,
:confirmation
,
:create
,
:show
]
before_action
:find_job_id
,
only:
[
:new
]
def
new
end
def
show
arr_job_id
=
current_user
.
job_applieds
.
pluck
(
:job_id
)
@jobs
=
Job
.
where
(
id:
arr_job_id
).
order
(
updated_at: :asc
)
@jobs
=
Job
.
applied_job
(
current_user
.
id
).
page
(
params
[
:page
]).
per
(
Job
::
LIMIT_PAGE
)
end
def
confirmation
@founded_job
=
JobApplied
.
where
(
user_id:
current_user
.
id
,
job_id:
apply_params
[
:job_id
])
return
redirect_to
apply_job_path
(
job_id:
apply_params
[
:job_id
]),
flash:
{
danger:
Settings
.
user
.
applied_job
.
applied
}
if
@founded_job
.
present?
@user
=
current_user
.
job_applieds
.
new
(
apply_params
)
@user
.
cv_user
=
current_user
.
cv_user
if
apply_params
[
:cv_user
].
blank?
if
@user
.
invalid?
...
...
app/mailers/confirmation_mailer.rb
View file @
ca4676d4
class
ConfirmationMailer
<
ActionMailer
::
Base
def
register_email
(
user
)
@user
=
user
mail
(
to:
user
.
email
,
subject:
'Welcome To VeNJOB! Confirm Your Email'
)
mail
(
to:
user
.
email
,
subject:
Settings
.
email
.
confirmation
)
end
end
app/mailers/job_applied_mailer.rb
View file @
ca4676d4
...
...
@@ -2,6 +2,6 @@ class JobAppliedMailer < ActionMailer::Base
def
apply_job
(
user
,
job
)
@job
=
job
@user
=
user
mail
(
to:
user
.
email
,
subject:
'Thank your for apply with VeNJOB'
)
mail
(
to:
user
.
email
,
subject:
Settings
.
email
.
job_applied
)
end
end
app/mailers/reset_password_mailer.rb
View file @
ca4676d4
class
ResetPasswordMailer
<
ActionMailer
::
Base
def
reset_password
(
user
)
@user
=
user
mail
(
to:
user
.
email
,
subject:
'VeNJOB Password Assistance'
)
mail
(
to:
user
.
email
,
subject:
Settings
.
email
.
reset_password
)
end
end
app/models/job.rb
View file @
ca4676d4
...
...
@@ -19,6 +19,9 @@ class Job < ApplicationRecord
LIMIT_PAGE
=
20
scope
:applied_job
,
->
(
user_id
)
{
joins
(
:job_applieds
)
.
where
(
"job_applieds.user_id =
#{
user_id
}
"
)
.
order
(
"job_applieds.updated_at DESC"
)
}
scope
:limit_job
,
->
{
includes
(
:cities
,
:company
).
order
(
created_at: :desc
).
limit
(
5
)
}
def
company_name
...
...
app/views/job_applieds/_my_jobs.html.erb
View file @
ca4676d4
...
...
@@ -10,15 +10,15 @@
<%=
link_to
'Read more..'
,
job_detail_path
(
job
.
id
)
%>
</div>
<div
class=
"row"
>
<div
class=
"col-
4
"
>
▼
<div
class=
"col-
6
"
>
▼
<%=
job
.
cities
.
map
(
&
:name
).
join
(
' | '
)
%>
</div>
<div
class=
"salary col-
4
"
>
<div
class=
"salary col-
3
"
>
Salary:
<%=
job
.
salary
%>
</div>
<div
class=
"applied-at col-
4
"
>
<div
class=
"applied-at col-
3
"
>
<strong>
Applied at:
</strong>
<%
job
.
job_applieds
.
each
do
|
info
|
%>
<%
job
.
job_applieds
.
where
(
user_id:
current_user
.
id
).
each
do
|
info
|
%>
<%=
info
.
updated_at
.
strftime
(
'%d/%m/%Y'
)
%>
<%
end
%>
</div>
...
...
app/views/job_applieds/show.html.erb
View file @
ca4676d4
<div
class=
"container"
>
<h1
class=
"text-center my-job-label"
>
My Job
</h1>
<%=
render
partial:
"job_applieds/my_jobs"
,
collection:
@jobs
,
as: :job
%>
<%
if
@jobs
.
count
>
0
%>
<h1
class=
"text-center my-job-label"
>
My Job
</h1>
<%=
paginate
@jobs
,
outer_window:
2
,
window:
1
%>
<%=
render
partial:
"job_applieds/my_jobs"
,
collection:
@jobs
,
as: :job
%>
<%=
paginate
@jobs
,
outer_window:
2
,
window:
1
%>
<%
else
%>
<h1
class=
"let-apply"
>
Let's apply job
</h1>
<%
end
%>
</div>
config/settings/development.yml
View file @
ca4676d4
...
...
@@ -18,3 +18,10 @@ user:
existed
:
'
Email
existed.
Please
change
!!!'
format_failed
:
'
Email
formated
invalid'
applied_job
:
applied
:
'
You
applied
for
this
job'
email
:
confirmation
:
'
Welcome
To
VeNJOB!
Confirm
Your
Email'
reset_password
:
'
VeNJOB
Password
Assistance'
job_applied
:
'
Thank
your
for
apply
with
VeNJOB'
public/uploads/job_applied/cv_user/20/document1.pdf
0 → 100644
View file @
ca4676d4
File added
public/uploads/job_applied/cv_user/21/Document-converted.pdf
0 → 100644
View file @
ca4676d4
File added
public/uploads/job_applied/cv_user/22/Document-converted.pdf
0 → 100644
View file @
ca4676d4
File added
public/uploads/job_applied/cv_user/23/Document-converted.pdf
0 → 100644
View file @
ca4676d4
File added
public/uploads/job_applied/cv_user/24/Document-converted.pdf
0 → 100644
View file @
ca4676d4
File added
public/uploads/job_applied/cv_user/25/document1.pdf
0 → 100644
View file @
ca4676d4
File added
public/uploads/job_applied/cv_user/26/Document-converted__1_.pdf
0 → 100644
View file @
ca4676d4
File added
public/uploads/job_applied/cv_user/27/Document-converted.pdf
0 → 100644
View file @
ca4676d4
File added
public/uploads/job_applied/cv_user/28/document1.pdf
0 → 100644
View file @
ca4676d4
File added
public/uploads/job_applied/cv_user/29/Document-converted__1_.pdf
0 → 100644
View file @
ca4676d4
File added
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