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
eb38977a
Commit
eb38977a
authored
Aug 26, 2020
by
Huỳnh Thiên Phước
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create store_location
parent
ca4676d4
Pipeline
#1023
canceled with stages
in 0 seconds
Changes
10
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
28 additions
and
3 deletions
+28
-3
app/controllers/job_applieds_controller.rb
+4
-1
app/controllers/jobs_controller.rb
+2
-1
app/controllers/sessions_controller.rb
+1
-1
app/controllers/users_controller.rb
+1
-0
app/helpers/sessions_helper.rb
+8
-0
app/views/jobs/show.html.erb
+12
-0
public/uploads/job_applied/cv_user/30/document1.pdf
+0
-0
public/uploads/job_applied/cv_user/31/document1.pdf
+0
-0
public/uploads/tmp/1598338581-322309569919558-0003-1585/Document-converted.pdf
+0
-0
public/uploads/tmp/1598338589-657192915277959-0004-1487/Document-converted.pdf
+0
-0
No files found.
app/controllers/job_applieds_controller.rb
View file @
eb38977a
...
...
@@ -3,6 +3,8 @@ class JobAppliedsController < ApplicationController
before_action
:find_job_id
,
only:
[
:new
]
def
new
founded_application
=
JobApplied
.
where
(
user_id:
current_user
.
id
,
job_id:
params
[
:job_id
])
return
redirect_to
job_detail_path
(
params
[
:job_id
])
if
founded_application
.
present?
end
def
show
...
...
@@ -35,7 +37,8 @@ class JobAppliedsController < ApplicationController
def
sign_in_validation
return
if
signed_in?
flash
[
:warning
]
=
"Please Sign In..."
store_location
flash
[
:warning
]
=
Settings
.
user
.
warning_signin
redirect_to
login_path
end
...
...
app/controllers/jobs_controller.rb
View file @
eb38977a
...
...
@@ -27,7 +27,8 @@ class JobsController < ApplicationController
end
def
show
redirect_to
jobs_path
unless
@job
return
redirect_to
jobs_path
unless
@job
@user
=
JobApplied
.
where
(
user_id:
current_user
.
id
,
job_id:
params
[
:id
])
if
signed_in?
end
private
...
...
app/controllers/sessions_controller.rb
View file @
eb38977a
...
...
@@ -8,7 +8,7 @@ class SessionsController < ApplicationController
user
=
User
.
find_by
(
email:
params
[
:session
][
:email
].
downcase
)
if
user
&&
user
.
authenticate
(
params
[
:session
][
:password
])
sign_in
user
redirect_
to
my_page_path
redirect_
back_or
my_page_path
else
flash
.
now
[
:danger
]
=
Settings
.
user
.
sign_in
.
failed
render
'new'
...
...
app/controllers/users_controller.rb
View file @
eb38977a
...
...
@@ -40,6 +40,7 @@ class UsersController < ApplicationController
def
sign_in_validation
return
if
signed_in?
store_location
flash
[
:warning
]
=
Settings
.
user
.
warning_signin
redirect_to
login_path
end
...
...
app/helpers/sessions_helper.rb
View file @
eb38977a
...
...
@@ -27,4 +27,12 @@ module SessionsHelper
self
.
current_user
=
nil
end
def
redirect_back_or
(
default
)
redirect_to
(
session
[
:return_to
]
||
default
)
session
.
delete
(
:return_to
)
end
def
store_location
session
[
:return_to
]
=
request
.
url
if
request
.
get?
end
end
app/views/jobs/show.html.erb
View file @
eb38977a
...
...
@@ -18,11 +18,17 @@
<%
end
%>
/
 
<%=
@job
.
title
.
truncate_words
(
5
)
%>
</div>
<%
if
signed_in?
&&
@user
.
present?
%>
<div
class=
"apply-job"
>
<strong>
Applied
</strong>
</div>
<%
else
%>
<%=
link_to
apply_job_path
(
job_id:
@job
.
id
)
do
%>
<div
class=
"apply-job"
>
<strong>
Apply Now
</strong>
</div>
<%
end
%>
<%
end
%>
</div>
</div>
</div>
...
...
@@ -68,11 +74,17 @@
</div>
<div
class=
"row under-descrip"
>
<div
class=
"col-6"
>
<%
if
signed_in?
&&
@user
.
present?
%>
<div
class=
"btn btn-info btn-lg apply-btn"
>
<strong>
Applied
</strong>
</div>
<%
else
%>
<%=
link_to
apply_job_path
(
job_id:
@job
.
id
)
do
%>
<div
class=
"btn btn-info btn-lg apply-btn"
>
<strong>
Apply Now
</strong>
</div>
<%
end
%>
<%
end
%>
</div>
<div
class=
"col-6"
>
<%=
link_to
'#'
do
%>
...
...
public/uploads/
tmp/1597290484-116357755274783-0002-8199
/document1.pdf
→
public/uploads/
job_applied/cv_user/30
/document1.pdf
View file @
eb38977a
File moved
public/uploads/
tmp/1598340440-676058122943232-0005-8572
/document1.pdf
→
public/uploads/
job_applied/cv_user/31
/document1.pdf
View file @
eb38977a
File moved
public/uploads/tmp/1598338581-322309569919558-0003-1585/Document-converted.pdf
deleted
100644 → 0
View file @
ca4676d4
File deleted
public/uploads/tmp/1598338589-657192915277959-0004-1487/Document-converted.pdf
deleted
100644 → 0
View file @
ca4676d4
File deleted
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