register and authentication

parent 5f642de9
Pipeline #1399 canceled with stages
in 0 seconds
class ApplicationController < ActionController::Base class ApplicationController < ActionController::Base
protected
def configure_permitted_parameters
devise_parameter_sanitizer.permit(:sign_up, keys: [:name, :cv])
end
def after_sign_up_path_for(resource)
profiles_path(resource)
end
end end
...@@ -17,7 +17,7 @@ class ApplyJobsController < ApplicationController ...@@ -17,7 +17,7 @@ class ApplyJobsController < ApplicationController
def confirm def confirm
@apply_job = ApplyJob.new(apply_params) @apply_job = ApplyJob.new(apply_params)
@apply_job.user_id = User.find_by(id: 1).id @apply_job.user_id = current_user.id
@apply_job.validate @apply_job.validate
if @apply_job.cv.attached? && @apply_job.errors[:cv].empty? if @apply_job.cv.attached? && @apply_job.errors[:cv].empty?
@blob = ActiveStorage::Blob.create_and_upload!( @blob = ActiveStorage::Blob.create_and_upload!(
...@@ -41,7 +41,7 @@ class ApplyJobsController < ApplicationController ...@@ -41,7 +41,7 @@ class ApplyJobsController < ApplicationController
def done def done
@apply_job = ApplyJob.new(apply_params) @apply_job = ApplyJob.new(apply_params)
@apply_job.user_id = User.find_by(id: 1).id @apply_job.user_id = current_user.id
@job = Job.latest_jobs.find(apply_params[:job_id]) @job = Job.latest_jobs.find(apply_params[:job_id])
@apply_job.cv = ActiveStorage::Blob.find(session[:blob_id]) @apply_job.cv = ActiveStorage::Blob.find(session[:blob_id])
if @apply_job.save if @apply_job.save
......
class ConfirmationsController < Devise::ConfirmationsController
private
def after_confirmation_path_for(resource_name, resource)
# sign_in(resource) # In case you want to sign in the user
registration_3_path(resource_name)
end
end
class RegistrationsController < Devise::RegistrationsController
# def create
# @user = User.new
# end
# private
# def sign_up_params
# params.require(:user).permit(:email)
# end
# def account_update_params
# params.require(:user).permit(:name, :email, :password, :password_confirmation, :current_password)
# end
end
\ No newline at end of file
# frozen_string_literal: true
class Users::ConfirmationsController < Devise::ConfirmationsController
# GET /resource/confirmation/new
# def new
# super
# end
# POST /resource/confirmation
# def create
# super
# end
# GET /resource/confirmation?confirmation_token=abcdef
# def show
# super
# end
protected
# The path used after resending confirmation instructions.
# def after_resending_confirmation_instructions_path_for(resource_name)
# super(resource_name)
# end
# The path used after confirmation.
def after_confirmation_path_for(resource_name, resource)
sign_in(resource)
root_path
end
end
# frozen_string_literal: true
class Users::PasswordsController < Devise::PasswordsController
# GET /resource/password/new
# def new
# super
# end
# POST /resource/password
# def create
# super
# end
# GET /resource/password/edit?reset_password_token=abcdef
# def edit
# self.resource = resource_class.new(reset_params)
# set_minimum_password_length
# resource.reset_password_token = params[:reset_password_token]
# end
# PUT /resource/password
# def update
# super
# end
protected
def after_resetting_password_path_for(resource)
root_path
end
# The path used after sending reset password instructions
def after_sending_reset_password_instructions_path_for(resource_name)
root_path
end
def reset_params
devise_parameter_sanitizer.permit(:account_update, keys: [:email])
end
end
# frozen_string_literal: true
class Users::RegistrationsController < Devise::RegistrationsController
before_action :configure_sign_up_params, only: [:create]
before_action :configure_account_update_params, only: [:update]
# before_action :configure_permitted_parameters, if: :devise_controller?
def show
end
# GET /resource/sign_up
# def new
# super
# end
# # POST /resource
# def create
# super
# end
# GET /resource/edit
# def edit
# super
# end
# # PUT /resource
# def update
# super
# end
# def update
# super
# end
# DELETE /resource
# def destroy
# super
# end
# GET /resource/cancel
# Forces the session data which is usually expired after sign
# in to be expired now. This is useful if the user wants to
# cancel oauth signing in/up in the middle of the process,
# removing all OAuth session data.
# def cancel
# super
# end
private
# If you have extra params to permit, append them to the sanitizer.
# def configure_permitted_parameters
# devise_parameter_sanitizer.permit(:sign_up, keys: [:name, :cv, :password, :password_confirmation])
# end
# The path used after sign up.
# def after_sign_up_path_for(resource)
# send_path
# end
def after_update_path_for(resource)
my_path
end
# The path used after sign up for inactive accounts.
def after_inactive_sign_up_path_for(resource)
register_2_path
end
# If you have extra params to permit, append them to the sanitizer.
def configure_sign_up_params
devise_parameter_sanitizer.permit(:sign_up, keys: [:name, :cv])
end
def configure_account_update_params
devise_parameter_sanitizer.permit(:account_update, keys: [:name, :cv, :email, :password, :password_confirmation, :current_password])
end
end
# frozen_string_literal: true
class Users::SessionsController < Devise::SessionsController
# before_action :configure_sign_in_params, only: [:create]
# GET /resource/sign_in
# def new
# super
# end
# POST /resource/sign_in
# def create
# super
# end
# DELETE /resource/sign_out
# def destroy
# super
# end
# protected
# If you have extra params to permit, append them to the sanitizer.
# def configure_sign_in_params
# devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])
# end
end
class UsersController < ApplicationController class UsersController < ApplicationController
def show before_action :authenticate_user!
@user = User.new(profile_params)
@user.save
flash[:notice] = "Your user account has been created!"
end
def show
def profile_params @user = current_user
params.require(:user).permit(:name, :email, :password, :password_confirmation, :cv)
end end
end end
\ No newline at end of file
...@@ -3,8 +3,9 @@ class ApplyJob < ApplicationRecord ...@@ -3,8 +3,9 @@ class ApplyJob < ApplicationRecord
belongs_to :job belongs_to :job
has_one_attached :cv has_one_attached :cv
validates :name, presence: true, length: { maximum: 200 } validates :name, presence: true, length: { maximum: 200 }
VALID_FILE_UPLOAD = %w[application/msword application/pdf application/xls application/xlsx application/zip]
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
validates :email, presence: true, length: { maximum: 255 }, format: { with: VALID_EMAIL_REGEX } validates :email, presence: true, length: { maximum: 255 }, format: { with: VALID_EMAIL_REGEX }
validates :cv, presence: true, content_type: { in: 'application/pdf', message: 'must be a valid image format' }, validates :cv, presence: true, content_type: { in: VALID_FILE_UPLOAD, 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
...@@ -3,12 +3,12 @@ class User < ApplicationRecord ...@@ -3,12 +3,12 @@ class User < ApplicationRecord
has_many :apply_jobs, dependent: :destroy has_many :apply_jobs, dependent: :destroy
has_many :favorite_jobs, dependent: :destroy has_many :favorite_jobs, dependent: :destroy
has_many :history_jobs, dependent: :destroy has_many :history_jobs, dependent: :destroy
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i VALID_FILE_UPLOAD = %w[application/msword application/pdf application/xls application/xlsx application/zip]
validates :name, presence: true, length: { maximum: 200 }
validates :email, presence: true, length: { maximum: 200 }, format: { with: VALID_EMAIL_REGEX }
validates :cv, presence: true, content_type: { in: 'application/pdf', message: 'must be a valid image format' },
size: { less_than: 5.megabytes, message: 'should be less than 5MB' }
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable, devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable, :confirmable :recoverable, :rememberable, :trackable, :validatable,
end :confirmable
validates :name, length: { maximum: 200 }
validates :email, length: { maximum: 200 }, uniqueness: true
validates :cv, content_type: { in: VALID_FILE_UPLOAD, message: 'must be msword, pdf, xls, xlsx, zip format'},
size: { less_than: 5.megabytes, message: 'should be less than 5MB' }
end
\ No newline at end of file
...@@ -4,11 +4,18 @@ header ...@@ -4,11 +4,18 @@ header
= link_to (image_tag "logo.png", alt: "logo"), root_path, id: "logo" = link_to (image_tag "logo.png", alt: "logo"), root_path, id: "logo"
#navbarExample01.collapse.navbar-collapse #navbarExample01.collapse.navbar-collapse
ul.navbar-nav.ms-auto.mb-2.mb-lg-0 ul.navbar-nav.ms-auto.mb-2.mb-lg-0
li.nav-item.active - if user_signed_in?
= link_to "Login", '#' li
li.nav-item = link_to "Profile", my_path
= link_to "Register", register_1_path li
li.nav-item = link_to "Favourite",'#'
= link_to "Favourite", '#' li
li.nav-item = link_to "History", '#'
= link_to "History", '#' li
= link_to('Logout', destroy_user_session_path, method: :delete)
- else
li
= link_to('Login', login_path)
li.nav-item
= link_to "Register", register_1_path
- if object.errors.any? - if object.errors.any?
#error_explanation #error_explanation
.alert.alert-danger.alert-dismissable
.alert.alert-danger p
| The form contains strong
= pluralize(object.errors.count, "error") | This form contains
| . = pluralize(object.errors.count, 'error')
ul | .
- object.errors.full_messages.each do |msg| ul
li - object.errors.full_messages.each do |msg|
= msg li
\ No newline at end of file = msg
\ No newline at end of file
h2.p-3.text-center h2.p-3.text-center
| Register | Resend confirmation instructions
.row .row
.col-md-6.offset-md-3.form-apply .col-md-6.offset-md-3.form-apply
= form_for(resource, as: resource_name, url: register_2_path) do |f| = form_for(resource, as: resource_name, url: register_2_path) do |f|
...@@ -9,6 +9,6 @@ h2.p-3.text-center ...@@ -9,6 +9,6 @@ h2.p-3.text-center
.field .field
= f.label :email = f.label :email
br br
= f.email_field :email, autofocus: true, autocomplete: "email", value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email), class: 'form-control' = f.email_field :email, autofocus: true, required: true, autocomplete: "email", value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email), class: 'form-control'
.actions.p-3.text-center .actions.p-3.text-center
= f.submit "Confirm your email", class: "btn btn-primary" = f.submit "Confirm your email", class: "btn btn-primary"
\ No newline at end of file
h2.p-3.text-center
| Sign up
.row
.col-md-6.offset-md-3.form-apply
= form_for(resource, as: resource_name, url: register_2_path) do |f|
= render 'shared/error_messages', object: resource
.card
.card-body
.field
= f.label :name, "Full Name"
br
= f.text_field :name, required: 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'
.field
= f.label :password
- if @minimum_password_length
em
| (
= @minimum_password_length
| characters minimum)
br
= f.password_field :password, autocomplete: "new-password", class: 'form-control'
.field
= f.label :password_confirmation
br
= f.password_field :password_confirmation, autocomplete: "new-password", class: 'form-control'
.field
= f.label :cv, "CV"
br
= f.file_field :cv, accept: "application/pdf", size: { less_than: 5.megabytes, message:"should be less than 5MB" }
.actions.p-3.text-center
= f.submit "Sign up", class: "btn btn-primary"
\ No newline at end of file
...@@ -5,4 +5,4 @@ p ...@@ -5,4 +5,4 @@ p
p p
| You're on your way! Let's confirm your email address. By clicking on the following link, you are confirming your email address and agreeing to VeNJOB's Terms of Service. | You're on your way! Let's confirm your email address. By clicking on the following link, you are confirming your email address and agreeing to VeNJOB's Terms of Service.
p p
= link_to 'Confirm my account', registration_3_url(code: @token) = link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token)
\ No newline at end of file
<p>Hello <%= @email %>!</p>
<% if @resource.try(:unconfirmed_email?) %>
<p>We're contacting you to notify you that your email is being changed to <%= @resource.unconfirmed_email %>.</p>
<% else %>
<p>We're contacting you to notify you that your email has been changed to <%= @resource.email %>.</p>
<% end %>
<p>Hello <%= @resource.email %>!</p>
<p>We're contacting you to notify you that your password has been changed.</p>
p
| Dear
= @resource.name
p
| You have a new password!
p
| Your password for signing in to VenJOB was recently changed. If you made this change, then we're all set.
p
| If you did not make this change, please reset your password to secure your account. Then reply to this email to notify us.
p
| Either way, feel free to reach out with any questions you might have. We're here to help.
p
| Best,
\ No newline at end of file
<p>Hello <%= @resource.email %>!</p>
<p>Someone has requested a link to change your password. You can do this through the link below.</p>
<p><%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %></p>
<p>If you didn't request this, please ignore this email.</p>
<p>Your password won't change until you access the link above and create a new one.</p>
p
| Hello
= @resource.email
| !
p
| Click the link below to reset your password using our secure server:
p
= link_to 'Change my password', reset_password_url(reset_password_token: @token)
p
| If you did not request to have your password reset you can safely ignore this email. Rest assured your account is safe.
p
| Please also be noted that the above link is valid for 24 hours.
p
| Best,
\ No newline at end of file
<p>Hello <%= @resource.email %>!</p>
<p>Your account has been locked due to an excessive number of unsuccessful sign in attempts.</p>
<p>Click the link below to unlock your account:</p>
<p><%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %></p>
<h2>Change your password</h2>
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
<%= render "users/shared/error_messages", resource: resource %>
<%= f.hidden_field :reset_password_token %>
<div class="field">
<%= f.label :password, "New password" %><br />
<% if @minimum_password_length %>
<em>(<%= @minimum_password_length %> characters minimum)</em><br />
<% end %>
<%= f.password_field :password, autofocus: true, autocomplete: "new-password" %>
</div>
<div class="field">
<%= f.label :password_confirmation, "Confirm new password" %><br />
<%= f.password_field :password_confirmation, autocomplete: "new-password" %>
</div>
<div class="actions">
<%= f.submit "Change my password" %>
</div>
<% end %>
<%= render "users/shared/links" %>
h2.p-3.text-center
| Change your password
.row
.col-md-6.offset-md-3.form-apply
= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f|
= render "shared/error_messages", object: resource
.card
.card-body
= f.hidden_field :reset_password_token
.field
= f.label :email
br
= f.email_field :email, disabled: true, autofocus: true, autocomplete: "email", class: 'form-control'
- if devise_mapping.confirmable? && resource.pending_reconfirmation?
div
| Currently waiting confirmation for:
= resource.unconfirmed_email
.field
= f.label :password, "New password"
br
- if @minimum_password_length
em
| (
= @minimum_password_length
| characters minimum)
br
= f.password_field :password, autofocus: true, autocomplete: "new-password", class: 'form-control'
.field
= f.label :password_confirmation, "Confirm new password"
br
= f.password_field :password_confirmation, autocomplete: "new-password", class: 'form-control'
.actions.p-2.text-center
= f.submit "Change my password", class: "btn btn-primary"
\ No newline at end of file
<h2>Forgot your password?</h2>
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
<%= render "users/shared/error_messages", resource: resource %>
<div class="field">
<%= f.label :email %><br />
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
</div>
<div class="actions">
<%= f.submit "Send me reset password instructions" %>
</div>
<% end %>
<%= render "users/shared/links" %>
h2.p-3.text-center
| Forgot your password
.row
.col-md-6.offset-md-3.form-apply
= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f|
= render "shared/error_messages", object: resource
.card
.card-body
.field
= f.label :email
br
= f.email_field :email, autofocus: true, autocomplete: "email", class: 'form-control'
.actions.p-3.text-center
= f.submit "Confirm you email", class: "btn btn-primary"
\ No newline at end of file
<h2>Edit <%= resource_name.to_s.humanize %></h2>
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
<%= render "users/shared/error_messages", resource: resource %>
<div class="field">
<%= f.label :email %><br />
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
</div>
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
<div>Currently waiting confirmation for: <%= resource.unconfirmed_email %></div>
<% end %>
<div class="field">
<%= f.label :password %> <i>(leave blank if you don't want to change it)</i><br />
<%= f.password_field :password, autocomplete: "new-password" %>
<% if @minimum_password_length %>
<br />
<em><%= @minimum_password_length %> characters minimum</em>
<% end %>
</div>
<div class="field">
<%= f.label :password_confirmation %><br />
<%= f.password_field :password_confirmation, autocomplete: "new-password" %>
</div>
<div class="field">
<%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br />
<%= f.password_field :current_password, autocomplete: "current-password" %>
</div>
<div class="actions">
<%= f.submit "Update" %>
</div>
<% end %>
<h3>Cancel my account</h3>
<p>Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %></p>
<%= link_to "Back", :back %>
h2.p-3.text-center
| Edit My Page
.row
.col-md-6.offset-md-3.form-apply
/ = resource_name.to_s.humanize
= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f|
= render 'shared/error_messages', object: resource
.card
.card-body
.field
= f.label :email
br
= f.email_field :email, autofocus: true, autocomplete: "email", class: 'form-control'
- if devise_mapping.confirmable? && resource.pending_reconfirmation?
div
| Currently waiting confirmation for:
= resource.unconfirmed_email
.field
= f.label :name, "Full Name"
br
= f.text_field :name, length: { maximum: 200 }, class: 'form-control'
.field
= f.label :password
- if @minimum_password_length
em
| (
= @minimum_password_length
| characters minimum)
br
= f.password_field :password, autocomplete: "new-password", class: 'form-control'
.field
= f.label :password_confirmation
br
= f.password_field :password_confirmation, autocomplete: "new-password", class: 'form-control'
.field
= f.label :current_password
i
| (we need your current password to confirm your changes)
br
= f.password_field :current_password, autocomplete: "current-password", class: 'form-control'
.field
= f.label :cv, "CV"
br
= f.file_field :cv, accept: User::VALID_FILE_UPLOAD , size: { less_than: 5.megabytes, message:"should be less than 5MB" }
.actions.p-2.text-center
= f.submit "Update", class: "btn btn-primary"
\ No newline at end of file
h2.p-3.text-center h2.p-3.text-center
| Sign up | Register
.row .row
.col-md-6.offset-md-3.form-apply .col-md-6.offset-md-3.form-apply
= form_for(resource, as: resource_name, url: my_path) do |f| = form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
= render 'shared/error_messages', object: resource = render 'shared/error_messages', object: resource
.card .card
.card-body .card-body
...@@ -32,4 +32,4 @@ h2.p-3.text-center ...@@ -32,4 +32,4 @@ h2.p-3.text-center
br br
= f.file_field :cv, accept: "application/pdf", size: { less_than: 5.megabytes, message:"should be less than 5MB" } = f.file_field :cv, accept: "application/pdf", size: { less_than: 5.megabytes, message:"should be less than 5MB" }
.actions.p-3.text-center .actions.p-3.text-center
= f.submit "Sign up", class: "btn btn-primary" = f.submit "Sign up", class: "btn btn-primary"
\ No newline at end of file
<h2>Log in</h2>
<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
<div class="field">
<%= f.label :email %><br />
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
</div>
<div class="field">
<%= f.label :password %><br />
<%= f.password_field :password, autocomplete: "current-password" %>
</div>
<% if devise_mapping.rememberable? %>
<div class="field">
<%= f.check_box :remember_me %>
<%= f.label :remember_me %>
</div>
<% end %>
<div class="actions">
<%= f.submit "Log in" %>
</div>
<% end %>
<%= render "users/shared/links" %>
h2.p-3.text-center
| Log in
.row
.col-md-6.offset-md-3.form-apply
= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
.card
.card-body
.field
= f.label :email
br
= f.email_field :email, autofocus: true, autocomplete: "email", class: 'form-control'
.field
= f.label :password
br
= f.password_field :password, autocomplete: "current-password", class: 'form-control'
- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations'
= link_to "Forgot your password?", forgot_password_path
.actions.p-2.text-center
= f.submit "Log in", class: "btn btn-primary btn-space"
= link_to "Register", register_1_path, class: "btn btn-primary btn-space"
\ No newline at end of file
<% 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>
<% end %>
</ul>
</div>
<% end %>
<%- if controller_name != 'sessions' %>
<%= link_to "Log in", new_session_path(resource_name) %><br />
<% end %>
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
<%= link_to "Sign up", new_registration_path(resource_name) %><br />
<% end %>
<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
<%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
<% end %>
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
<%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
<% end %>
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
<%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
<% end %>
<%- if devise_mapping.omniauthable? %>
<%- resource_class.omniauth_providers.each do |provider| %>
<%= link_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), method: :post %><br />
<% end %>
<% end %>
br
- if devise_mapping.omniauthable?
- resource_class.omniauth_providers.each do |provider|
= link_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), method: :post
br
\ No newline at end of file
p h2.p-3.text-center
| helloo | My Page
=@user.name .row
\ No newline at end of file .col-md-6.offset-md-3.form-apply
= form_with(model: @user, local:true) do |f|
.card
.card-body
.field
= f.label :email
br
= f.email_field :email, required: true, autofocus: true, autocomplete: "email", class: 'form-control'
.field
= f.label :name, "Full Name"
br
= f.text_field :name, required: true, length: { maximum: 200 }, class: 'form-control'
.field
-if @user.cv.attached?
= f.label :cv, "CV"
br
= link_to @user.cv.filename, rails_blob_path(@user.cv, disposition: 'attachment')
.span.p-2.text-center
= link_to "Update", my_info_path, class: "btn btn-primary btn-space"
= link_to "My Jobs", "#", class: "btn btn-primary btn-space"
\ No newline at end of file
...@@ -132,7 +132,7 @@ Devise.setup do |config| ...@@ -132,7 +132,7 @@ Devise.setup do |config|
# config.send_email_changed_notification = false # config.send_email_changed_notification = false
# Send a notification email when the user's password is changed. # Send a notification email when the user's password is changed.
# config.send_password_change_notification = false config.send_password_change_notification = true
# ==> Configuration for :confirmable # ==> Configuration for :confirmable
# A period that the user is allowed to access the website even without # A period that the user is allowed to access the website even without
...@@ -184,6 +184,7 @@ Devise.setup do |config| ...@@ -184,6 +184,7 @@ Devise.setup do |config|
# one (and only one) @ exists in the given string. This is mainly # one (and only one) @ exists in the given string. This is mainly
# to give user feedback and not to assert the e-mail validity. # to give user feedback and not to assert the e-mail validity.
config.email_regexp = /\A[^@\s]+@[^@\s]+\z/ config.email_regexp = /\A[^@\s]+@[^@\s]+\z/
# ==> Configuration for :timeoutable # ==> Configuration for :timeoutable
# The time you want to timeout the user session without activity. After this # The time you want to timeout the user session without activity. After this
...@@ -224,7 +225,7 @@ Devise.setup do |config| ...@@ -224,7 +225,7 @@ Devise.setup do |config|
# Time interval you can reset your password with a reset password key. # Time interval you can reset your password with a reset password key.
# Don't put a too small interval or your users won't have the time to # Don't put a too small interval or your users won't have the time to
# change their passwords. # change their passwords.
config.reset_password_within = 6.hours config.reset_password_within = 24.hours
# When set to false, does not sign a user in automatically after their password is # When set to false, does not sign a user in automatically after their password is
# reset. Defaults to true, so a user is signed in automatically after a reset. # reset. Defaults to true, so a user is signed in automatically after a reset.
......
...@@ -20,13 +20,13 @@ en: ...@@ -20,13 +20,13 @@ en:
confirmation_instructions: confirmation_instructions:
subject: "Welcome To VeNJOB! Confirm Your Email" subject: "Welcome To VeNJOB! Confirm Your Email"
reset_password_instructions: reset_password_instructions:
subject: "Reset password instructions" subject: "VeNJOB Password Assistance"
unlock_instructions: unlock_instructions:
subject: "Unlock instructions" subject: "Unlock instructions"
email_changed: email_changed:
subject: "Email Changed" subject: "Email Changed"
password_change: password_change:
subject: "Password Changed" subject: "VeNJOB Password Assistance: Your password has been reset"
omniauth_callbacks: omniauth_callbacks:
failure: "Could not authenticate you from %{kind} because \"%{reason}\"." failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
success: "Successfully authenticated from %{kind} account." success: "Successfully authenticated from %{kind} account."
...@@ -37,6 +37,7 @@ en: ...@@ -37,6 +37,7 @@ en:
updated: "Your password has been changed successfully. You are now signed in." updated: "Your password has been changed successfully. You are now signed in."
updated_not_active: "Your password has been changed successfully." updated_not_active: "Your password has been changed successfully."
registrations: registrations:
taken: "Please use a different Email "
destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon." destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
signed_up: "Welcome! You have signed up successfully." signed_up: "Welcome! You have signed up successfully."
signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated." signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
...@@ -63,3 +64,4 @@ en: ...@@ -63,3 +64,4 @@ en:
not_saved: not_saved:
one: "1 error prohibited this %{resource} from being saved:" one: "1 error prohibited this %{resource} from being saved:"
other: "%{count} errors prohibited this %{resource} from being saved:" other: "%{count} errors prohibited this %{resource} from being saved:"
...@@ -45,4 +45,4 @@ en: ...@@ -45,4 +45,4 @@ en:
one: "Displaying <b>1</b> %{entry_name}" one: "Displaying <b>1</b> %{entry_name}"
other: "Displaying <b>all %{count}</b> %{entry_name}" other: "Displaying <b>all %{count}</b> %{entry_name}"
more_pages: more_pages:
display_entries: "Displaying %{entry_name} <b>%{first}&nbsp;-&nbsp;%{last}</b> of <b>%{total}</b> in total" display_entries: "Displaying %{entry_name} <b>%{first}&nbsp;-&nbsp;%{last}</b> of <b>%{total}</b> in total"
\ No newline at end of file
...@@ -8,12 +8,16 @@ Rails.application.routes.draw do ...@@ -8,12 +8,16 @@ Rails.application.routes.draw do
get 'apply', to: 'apply_jobs#new' get 'apply', to: 'apply_jobs#new'
post 'confirm', to: 'apply_jobs#confirm' post 'confirm', to: 'apply_jobs#confirm'
post 'done', to: 'apply_jobs#done' post 'done', to: 'apply_jobs#done'
devise_for :users, controllers: { registrations: 'users/registrations', confirmations: 'users/confirmations' } devise_for :users, controllers: { registrations: 'users/registrations', confirmations: 'users/confirmations',
resources :users, :only => [:show] passwords: 'users/passwords', sessions: 'users/sessions' }
post '/my', to: 'users#show' resources :user
get '/my', to: 'users#show'
devise_scope :user do devise_scope :user do
get 'register/1', to: 'devise/confirmations#new' get 'register/1', to: 'users/registrations#new'
post 'register/2', to: 'devise/confirmations#create' get 'register/2', to: 'users/registrations#show'
get 'registration/3', to: 'devise/registrations#new' get 'my/info', to: 'users/registrations#edit'
get 'forgot_password', to: 'users/passwords#new'
get 'reset_password', to: 'users/passwords#edit'
get 'login', to: 'users/sessions#new'
end end
end end
\ No newline at end of file
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