add validate email and fix style code

parent 178c8547
Pipeline #1407 failed with stages
in 0 seconds
@import "bootstrap";
@import "flash";
@import "colors";
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400;500;700&display=swap');
#logo {
......@@ -168,14 +168,7 @@ footer {
text-align: left;
}
.alert-success {
background-color: $background-success-notice-color;
border-color: $border-success-notice-color;
color: $success-notice-color;
text-align: left;
}
.alert-notice {
.alert-success, .alert-notice {
background-color: $background-success-notice-color;
border-color: $border-success-notice-color;
color: $success-notice-color;
......
......@@ -6,8 +6,9 @@ class User < ApplicationRecord
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :validatable,
:confirmable
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
validates :name, length: { maximum: 200 }
validates :email, length: { maximum: 200 }, uniqueness: true
validates :email, length: { maximum: 200 }, uniqueness: true, format: { with: VALID_EMAIL_REGEX }
validates :cv, content_type: { in: 'application/pdf', message: 'must be a valid pdf format' },
size: { less_than: 5.megabytes, message: 'should be less than 5MB' }
end
\ No newline at end of file
......@@ -9,11 +9,11 @@ h2.p-3.text-center
.field
= f.label :name, "Full Name"
br
= f.text_field :name, required: true, length: { maximum: 200 }, class: 'form-control'
= f.text_field :name, required: true, autofocus: true, length: { maximum: 200 }, class: 'form-control'
.field
= f.label :email
br
= f.email_field :email, required: true, length: { maximum: 200 }, autofocus: true, autocomplete: "email", class: 'form-control'
= f.email_field :email, required: true, length: { maximum: 200 }, autocomplete: "email", class: 'form-control'
.field
= f.label :password
- if @minimum_password_length
......
......@@ -8,11 +8,11 @@ h2.p-3.text-center
.field
= f.label :email
br
= f.email_field :email, required: true, autofocus: true, autocomplete: "email", class: 'form-control'
= f.email_field :email, disabled: true, class: 'form-control'
.field
= f.label :name, "Full Name"
br
= f.text_field :name, required: true, length: { maximum: 200 }, class: 'form-control'
= f.text_field :name, disabled: true, class: 'form-control'
.field
-if @user.cv.attached?
= f.label :cv, "CV"
......
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