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
Thanh Hung Pham
veNJOB
Commits
ed45a8d3
Commit
ed45a8d3
authored
Jul 11, 2017
by
Thanh Hung Pham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update database applies
parent
37e1a7ba
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
10 deletions
+19
-10
app/controllers/jobs_controller.rb
+2
-1
app/views/jobs/applied_jobs.html.erb
+1
-1
app/views/jobs/detail.html.erb
+16
-8
No files found.
app/controllers/jobs_controller.rb
View file @
ed45a8d3
class
JobsController
<
ApplicationController
class
JobsController
<
ApplicationController
def
applied_jobs
def
applied_jobs
@applied_jobs
=
Apply
.
where
(
user_id:
current_user
.
id
)
@applied_jobs
=
Apply
.
where
(
user_id:
current_user
.
id
)
render
:applied_jobs
end
end
def
detail
def
detail
...
@@ -24,6 +23,8 @@ class JobsController < ApplicationController
...
@@ -24,6 +23,8 @@ class JobsController < ApplicationController
@fullname
=
params
[
:fullname
]
@fullname
=
params
[
:fullname
]
@cv_link
=
'link to download'
@cv_link
=
'link to download'
@job
=
Job
.
find
(
params
[
:job_id
])
@job
=
Job
.
find
(
params
[
:job_id
])
@apply_job
=
Apply
.
new
(
user:
current_user
,
job:
@job
,
applied_at:
Time
.
zone
.
now
).
save
ApplyMailer
.
apply_mail
(
@email
,
@fullname
,
@cv_link
,
@job
).
deliver
ApplyMailer
.
apply_mail
(
@email
,
@fullname
,
@cv_link
,
@job
).
deliver
end
end
...
...
app/views/jobs/applied_jobs.html.erb
View file @
ed45a8d3
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
<%=
apply
.
job
.
salary
%>
<%=
apply
.
job
.
salary
%>
</div>
</div>
<div
class=
"col-md-4"
>
<div
class=
"col-md-4"
>
<%=
apply
.
job
.
applied_at
%>
<%=
apply
.
applied_at
%>
</div>
</div>
</div>
</div>
<%-
end
-%>
<%-
end
-%>
...
...
app/views/jobs/detail.html.erb
View file @
ed45a8d3
...
@@ -18,7 +18,11 @@
...
@@ -18,7 +18,11 @@
</div>
</div>
<div
class=
"col-md-2"
>
<div
class=
"col-md-2"
>
<%-
if
user_signed_in?
-%>
<%-
if
user_signed_in?
-%>
<%=
link_to
'Apply'
,
jobs_apply_path
(
job_id:
@job
.
id
),
class:
'btn btn-primary'
%>
<%-
if
Apply
.
where
(
user:
current_user
,
job:
@job
).
blank?
-%>
<%=
link_to
'Apply'
,
jobs_apply_path
(
job_id:
@job
.
id
),
class:
'btn btn-primary'
%>
<%-
else
-%>
<%=
link_to
'Applied'
,
'#'
,
class:
'btn btn-primary'
%>
<%-
end
-%>
<%-
else
-%>
<%-
else
-%>
<%=
link_to
'Apply'
,
new_user_session_path
,
class:
'btn btn-primary'
%>
<%=
link_to
'Apply'
,
new_user_session_path
,
class:
'btn btn-primary'
%>
<%-
end
-%>
<%-
end
-%>
...
@@ -27,21 +31,25 @@
...
@@ -27,21 +31,25 @@
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-md-offset-3 "
>
<div
class=
"col-md-offset-3 "
>
<%-
if
user_signed_in?
-%>
<%-
if
user_signed_in?
-%>
<%=
link_to
'Apply'
,
jobs_apply_path
(
job_id:
@job
.
id
),
class:
'btn btn-primary'
%>
<%-
if
Apply
.
where
(
user:
current_user
,
job:
@job
).
blank?
-%>
<%=
link_to
'Apply'
,
jobs_apply_path
(
job_id:
@job
.
id
),
class:
'btn btn-primary'
%>
<%-
else
-%>
<%=
link_to
'Applied'
,
'#'
,
class:
'btn btn-primary'
%>
<%-
end
-%>
<%-
else
-%>
<%-
else
-%>
<%=
link_to
'Apply'
,
new_user_session_path
,
class:
'btn btn-primary'
%>
<%=
link_to
'Apply'
,
new_user_session_path
,
class:
'btn btn-primary'
%>
<%-
end
-%>
<%-
end
-%>
<%-
if
Favorite
.
where
(
user:
current_user
,
job:
@job
).
blank?
-%>
<%-
if
user_signed_in?
-%>
<%-
if
user_signed_in?
-%>
<%-
if
Favorite
.
where
(
user:
current_user
,
job:
@job
).
blank?
-%>
<%=
link_to
'Favorite'
,
'#'
,
class:
'favorite_add btn btn-primary'
%>
<%=
link_to
'Favorite'
,
'#'
,
class:
'favorite_add btn btn-primary'
%>
<%-
else
-%>
<%-
else
-%>
<%=
link_to
'Favorite'
,
new_user_session_path
,
class:
'btn btn-primary'
%>
<%=
link_to
'Favorite'
,
'#'
,
class:
'favorite_add btn btn-primary'
,
disabled:
true
%>
<%-
end
-%>
<%-
end
-%>
<input
type=
"hidden"
id=
"job_id"
name=
"job_id"
value=
"
<%=
@job
.
id
%>
"
>
<%-
else
-%>
<%-
else
-%>
<%=
link_to
'Favorite'
,
'#'
,
class:
'favorite_add btn btn-primary'
,
disabled:
true
%>
<%=
link_to
'Favorite'
,
new_user_session_path
,
class:
'btn btn-primary'
%>
<%-
end
-%>
<%-
end
-%>
<input
type=
"hidden"
id=
"job_id"
name=
"job_id"
value=
"
<%=
@job
.
id
%>
"
>
</div>
</div>
</div>
</div>
</div>
</div>
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