add validate email and fix style code

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