Commit 41dfcb2e by Mai Hoang Thai Ha

fixed review part 2

parent a31c35be
......@@ -18,9 +18,10 @@ $text-color-white: #fff;
height: 100%;
background: #f3f5fa;
text-align: center;
padding: 12px;
padding: 8px;
position: relative;
font-size: 14px;
font-size: 16px;
font-weight: 700;
text-decoration: none;
color: #808080;
.circle {
......@@ -42,11 +43,11 @@ $text-color-white: #fff;
&:after {
content: "";
border-top: 23px solid transparent;
border-bottom: 23px solid transparent;
border-left: 23px solid #f3f5fa;
border-top: 21px solid transparent;
border-bottom: 21px solid transparent;
border-left: 21px solid #f3f5fa;
position: absolute;
right: -23px;
right: -21px;
top: 0;
z-index: 1;
}
......@@ -55,9 +56,9 @@ $text-color-white: #fff;
}
&:first-child::before {
content: "";
border-top: 23px solid transparent;
border-bottom: 23px solid transparent;
border-left: 23px solid #fff;
border-top: 21px solid transparent;
border-bottom: 21px solid transparent;
border-left: 21px solid #fff;
position: absolute;
left: 0;
top: 0;
......@@ -77,3 +78,7 @@ $text-color-white: #fff;
}
}
}
.btn-height {
height: 50px;
}
\ No newline at end of file
......@@ -11,7 +11,7 @@ class AppliesController < ApplicationController
@apply = @job.apply_jobs.build(apply_params)
@apply.user_id = @user.id
render 'new' unless @apply.valid?
render 'new' if @apply.invalid?
end
def create
......
class ApplicationMailer < ActionMailer::Base
include ApplicationHelper
helper :application
default from: 'from@example.com'
layout 'mailer'
end
class ApplyJob < ApplicationRecord
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
ACCEPT_CONTENT_TYPE = %w[application/pdf application/msword application/zip application/xls application/xlsx].freeze
belongs_to :job
belongs_to :user
......@@ -9,7 +10,7 @@ class ApplyJob < ApplicationRecord
validates :email, presence: true, length: { maximum: 255 },
format: { with: VALID_EMAIL_REGEX }
validates :cv, presence: true, content_type:
{ in: %w[application/pdf application/msword application/zip application/xls application/xlsx],
{ in: ACCEPT_CONTENT_TYPE,
message: 'must be a valid cv format' },
size:
{ less_than: 5.megabytes,
......
javascript:
$("#apply_job_cv").bind("change", function() {
const size_in_megabytes = this.files[0].size/1024/1024;
if (size_in_megabytes > 5) {
alert("Maximum file size is 5MB. Please choose a smaller file.");
$("#apply_job_cv").val("");
}
});
\ No newline at end of file
- provide(:title, 'Confirmation')
.container
=render 'ribbon'
= render 'ribbon'
.container
h1.my-5.text-center
| Confirm
= @job.title
| Confirmation
.col
= form_with(model: @apply, scope: :apply_job, url: done_path, local: true) do |f|
......@@ -26,6 +25,7 @@
span.mx-2.label.form-control
= @apply.email
= f.hidden_field :email, value: @apply.email, class: 'form-control'
.row.mb-5
.col-2
/ = f.hidden_field :cv, value: @apply.cv, class: 'form-control'
......@@ -35,9 +35,8 @@
span.form-control
= url_for(@apply.cv)
.row.justify-content-between
.col-6
= link_to 'Edit', apply_path(job_id: @job.id), class: 'btn btn-secondary py-2 px-4 w-100'
.col-6
= f.submit 'Confirm', class: 'btn btn-primary w-100'
= link_to 'Edit', apply_path(job_id: @job.id), class: 'btn btn-secondary w-25 btn-height mr-5 my-5'
= f.submit 'Confirm', class: 'btn btn-primary w-25 btn-height mx-5 my-5'
= render 'validate_form'
- provide(:title, 'Apply job')
.container
=render 'ribbon'
= render 'ribbon'
.container
h1.my-5.text-center
| Apply form
p.fs-5.fw-bold.mb-4.text-center
| Apply for
= @job.title
.col
= form_with(model: @apply, url: confirm_path, local: true) do |f|
......@@ -26,4 +28,6 @@
= f.label :cv, class: 'form-label label'
.col-10
= f.file_field :cv, accept: 'application/pdf, application/msword, application/zip, application/xls, application/xlsx', class: 'form-control'
= f.submit 'Confirm', class: 'btn btn-primary w-100'
= f.submit 'Confirm', class: 'btn btn-primary w-25 my-4 btn-height'
= render 'validate_form'
......@@ -14,6 +14,6 @@
= "\n"
' Email: #{@apply.email}
= "\n"
' CV: #{@apply.cv}
' CV: #{url_for(@apply.cv)}
= "\n"
' Best,
......@@ -10,10 +10,6 @@ module VenJob
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 6.1
config.to_prepare do
ActionMailer::Base.helper "application"
end
# Configuration for the application, engines, and railties goes here.
#
# These settings can be overridden in specific environments using the files
......
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