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
1
Merge Requests
1
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
Tô Ngọc Ánh
VeNJob
Commits
95aa91b3
Commit
95aa91b3
authored
Aug 14, 2020
by
Tô Ngọc Ánh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
edit confirm, finsh action applied_job controller
parent
38b8dbb0
Pipeline
#917
failed with stages
in 0 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
60 additions
and
47 deletions
+60
-47
app/assets/stylesheets/application.scss
+12
-0
app/controllers/applied_jobs_controller.rb
+6
-6
app/views/applied_jobs/confirm.html.erb
+40
-34
app/views/devise/shared/_error_messages.html.erb
+0
-6
config/initializers/devise.rb
+1
-1
config/routes.rb
+1
-0
No files found.
app/assets/stylesheets/application.scss
View file @
95aa91b3
...
...
@@ -58,6 +58,18 @@ background-color: $main-color;
}
}
.card-img-rounded
{
border-radius
:
50%
;
background-color
:
mediumseagreen
;
height
:
220px
;
width
:
220px
;
margin-top
:
50px
;
padding
:
10px
;
.card-img
{
margin-top
:
40px
;
}
}
.
ribbon
:
:
before
,
.
ribbon
::
after
{
content
:
""
;
position
:
absolute
;
...
...
app/controllers/applied_jobs_controller.rb
View file @
95aa91b3
...
...
@@ -3,10 +3,7 @@ class AppliedJobsController < ApplicationController
def
new
job
=
Job
.
find_by
(
id:
params
[
:job_id
])
if
job
.
nil?
redirect_to
root_path
return
end
return
redirect_to
root_path
if
job
.
nil?
@applied_job
=
job
.
applied_jobs
.
new
(
full_name:
current_user
.
full_name
,
email:
current_user
.
email
,
curriculum_vitae:
current_user
.
curriculum_vitae
)
...
...
@@ -14,11 +11,14 @@ class AppliedJobsController < ApplicationController
def
confirm
@applied_job
=
current_user
.
applied_jobs
.
new
(
applied_job_params
)
@applied_job
.
curriculum_vitae
=
current_user
.
curriculum_vitae
if
params
[
:curriculum_vitae
].
nil?
redirect_to
root_path
if
@applied_job
.
invalid?
@applied_job
.
curriculum_vitae
=
current_user
.
curriculum_vitae
if
params
[
:
applied_job
][
:
curriculum_vitae
].
nil?
redirect_to
new_applied_job_path
(
job_id:
@applied_job
.
job_id
)
if
@applied_job
.
invalid?
end
def
finish
@applied_job
=
current_user
.
applied_jobs
.
new
(
applied_job_params
)
@applied_job
.
valid?
@applied_job
.
errors
end
private
...
...
app/views/applied_jobs/confirm.html.erb
View file @
95aa91b3
...
...
@@ -17,41 +17,47 @@
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-md-5 col-sm-12 mx-auto"
>
<div
class=
"row"
>
<div
class=
"col-5"
>
<h5
class=
"font-weight-bold"
>
Full Name
</h5>
</div>
<div
class=
"col-7"
>
<h5>
<%=
@applied_job
.
user
.
full_name
%>
</h5>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-5"
>
<h5
class=
"font-weight-bold"
>
Email
</h5>
</div>
<div
class=
"col-7"
>
<h5>
<%=
@applied_job
.
user
.
email
%>
</h5>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-5"
>
<h5
class=
"font-weight-bold"
>
Curriculum Vitae
</h5>
</div>
<div
class=
"col-7"
>
<%=
link_to
@applied_job
.
curriculum_vitae
.
identifier
,
@applied_job
.
curriculum_vitae
.
url
,
download:
@applied_job
.
curriculum_vitae
.
identifier
%>
<%=
link_to
@applied_job
.
curriculum_vitae
.
url
,
target:
'_blank'
,
class:
'text-dark'
do
%>
<i
class=
"fas fa-eye"
></i>
<div
class=
"col-md-6 col-sm-12 mx-auto"
>
<%=
form_for
@applied_job
,
url:
finish_applied_job_path
do
|
f
|
%>
<%=
f
.
hidden_field
:job_id
%>
<div
class=
"row"
>
<div
class=
"col-5"
>
<%=
f
.
label
:full_name
,
class:
'h5 font-weight-bold'
%>
</div>
<div
class=
"col-7"
>
<h5>
<%=
@applied_job
.
user
.
full_name
%>
</h5>
<%=
f
.
hidden_field
:full_name
%>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-5"
>
<%=
f
.
label
:email
,
class:
'h5 font-weight-bold'
%>
</div>
<div
class=
"col-7"
>
<h5>
<%=
@applied_job
.
user
.
email
%>
</h5>
<%=
f
.
hidden_field
:email
%>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-5"
>
<h5
class=
"font-weight-bold"
>
Curriculum Vitae
</h5>
</div>
<div
class=
"col-7"
>
<%=
link_to
@applied_job
.
curriculum_vitae
.
identifier
,
@applied_job
.
curriculum_vitae
.
url
,
download:
@applied_job
.
curriculum_vitae
.
identifier
%>
<%=
link_to
@applied_job
.
curriculum_vitae
.
url
,
target:
'_blank'
,
class:
'text-dark'
do
%>
<i
class=
"fas fa-eye"
></i>
<%
end
%>
<%=
f
.
hidden_field
:curriculum_vitae
,
class:
'd-none'
%>
</div>
</div>
<div
class=
"row my-3"
>
<div
class=
"col text-right"
>
<%=
link_to
'Edit'
,
new_applied_job_path
(
job_id:
@applied_job
.
job_id
),
class:
'btn btn-outline-secondary btn-lg'
%>
</div>
<div
class=
"col text-left"
>
<%=
f
.
submit
"Done"
,
class:
'btn btn-outline-success btn-lg'
%>
</div>
<%
end
%>
</div>
</div>
<div
class=
"row my-3"
>
<div
class=
"col text-right"
>
<%=
link_to
'Edit'
,
new_applied_job_path
,
class:
'btn btn-outline-secondary btn-lg'
%>
</div>
<div
class=
"col text-left"
>
<%=
link_to
'Done'
,
'#'
,
class:
'btn btn-outline-success btn-lg'
%>
</div>
</div>
</div>
</div>
app/views/devise/shared/_error_messages.html.erb
View file @
95aa91b3
<%
if
resource
.
errors
.
any?
%>
<div
id=
"error_explanation"
>
<h2>
<%=
I18n
.
t
(
"errors.messages.not_saved"
,
count:
resource
.
errors
.
count
,
resource:
resource
.
class
.
model_name
.
human
.
downcase
)
%>
</h2>
<ul>
<%
resource
.
errors
.
full_messages
.
each
do
|
message
|
%>
<li>
<%=
message
%>
</li>
...
...
config/initializers/devise.rb
View file @
95aa91b3
...
...
@@ -171,7 +171,7 @@ Devise.setup do |config|
# Email regex used to validate email formats. It simply asserts that
# one (and only one) @ exists in the given string. This is mainly
# to give user feedback and not to assert the e-mail validity.
config
.
email_regexp
=
/\A[
^@\s]+@[^@\s
]+\z/
config
.
email_regexp
=
/\A[
a-zA-Z][\w\.]+@[a-zA-Z]+\.[a-zA-Z
]+\z/
# ==> Configuration for :timeoutable
# The time you want to timeout the user session without activity. After this
...
...
config/routes.rb
View file @
95aa91b3
...
...
@@ -9,5 +9,6 @@ Rails.application.routes.draw do
resources
:users
,
only: :show
get
'apply'
,
to:
'applied_jobs#new'
,
as: :new_applied_job
post
'confirm'
,
to:
'applied_jobs#confirm'
,
as: :confirm_applied_job
post
'finish'
,
to:
'applied_jobs#finish'
,
as: :finish_applied_job
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
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