Commit f4fb834b by Tô Ngọc Ánh

show job title and notice if cv is nil

parent 027bd940
Pipeline #970 canceled with stages
in 0 seconds
.fa-file-upload {
cursor: pointer;
}
\ No newline at end of file
...@@ -9,6 +9,8 @@ class JobsController < ApplicationController ...@@ -9,6 +9,8 @@ class JobsController < ApplicationController
def show def show
@job = Job.find_by(id: params[:id]) @job = Job.find_by(id: params[:id])
return redirect_to root_path if @job.nil?
@is_not_applied = user_signed_in? ? current_user.applied_jobs.find_by(job_id: @job.id).blank? : true @is_not_applied = user_signed_in? ? current_user.applied_jobs.find_by(job_id: @job.id).blank? : true
end end
end end
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
<div class="apply-form mx-5 px-5"> <div class="apply-form mx-5 px-5">
<%= form_for @applied_job, url: confirm_applied_job_path do |f| %> <%= form_for @applied_job, url: confirm_applied_job_path do |f| %>
<%= f.hidden_field :job_id %> <%= f.hidden_field :job_id %>
<h4 class="text-center text-success font-weight-bold mb-4"><%= @applied_job.job.title %></h4>
<div class="d-flex justify-content-between my-3"> <div class="d-flex justify-content-between my-3">
<%= f.label :full_name, class: 'mt-2 font-weight-bold' %> <%= f.label :full_name, class: 'mt-2 font-weight-bold' %>
<%= f.text_field :full_name, class: 'form-control w-75', maxlength: 200, required: true %> <%= f.text_field :full_name, class: 'form-control w-75', maxlength: 200, required: true %>
...@@ -19,7 +20,9 @@ ...@@ -19,7 +20,9 @@
<span class="mt-2 font-weight-bold">Curriculum Vitae</span> <span class="mt-2 font-weight-bold">Curriculum Vitae</span>
<div class="w-75 mt-2"> <div class="w-75 mt-2">
<span id="name_curriculum_vitae" class="mr-2"> <span id="name_curriculum_vitae" class="mr-2">
<%= link_to current_user.curriculum_vitae.identifier, current_user.curriculum_vitae.url, target: '_blank' %> <%= link_to_if current_user.curriculum_vitae.present?, current_user.curriculum_vitae.identifier, current_user.curriculum_vitae.url, target: '_blank' do %>
<span>Please upload your CV!</span>
<% end %>
</span> </span>
<%= f.label :curriculum_vitae do %> <%= f.label :curriculum_vitae do %>
<i class="fas fa-file-upload fa-lg"></i> <i class="fas fa-file-upload fa-lg"></i>
......
...@@ -139,7 +139,7 @@ Devise.setup do |config| ...@@ -139,7 +139,7 @@ Devise.setup do |config|
# their account can't be confirmed with the token any more. # their account can't be confirmed with the token any more.
# Default is nil, meaning there is no restriction on how long a user can take # Default is nil, meaning there is no restriction on how long a user can take
# before confirming their account. # before confirming their account.
# config.confirm_within = 3.days config.confirm_within = 1.days
# If true, requires any email changes to be confirmed (exactly the same way as # If true, requires any email changes to be confirmed (exactly the same way as
# initial account confirmation) to be applied. Requires additional unconfirmed_email # initial account confirmation) to be applied. Requires additional unconfirmed_email
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment