Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
VeNJOB
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nguyen Hoang Mai Phuong
VeNJOB
Commits
178c8547
Commit
178c8547
authored
Aug 26, 2021
by
Nguyen Hoang Mai Phuong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix routes user and css flash
parent
d3fde0de
Pipeline
#1406
failed with stages
in 0 seconds
Changes
15
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
34 additions
and
218 deletions
+34
-218
app/assets/stylesheets/custom.scss
+12
-17
app/assets/stylesheets/flash.scss
+7
-0
app/controllers/users/confirmations_controller.rb
+3
-19
app/controllers/users/passwords_controller.rb
+0
-23
app/controllers/users/registrations_controller.rb
+0
-60
app/controllers/users/sessions_controller.rb
+0
-25
app/models/user.rb
+1
-1
app/views/layouts/application.html.slim
+0
-2
app/views/users/confirmations/new.html.slim
+5
-7
app/views/users/confirmations/show.html.slim
+0
-36
app/views/users/show.html.slim
+1
-1
app/views/users/unlocks/new.html.erb
+0
-16
config/routes.rb
+0
-1
db/migrate/20210818152915_authenticatable_registerable_trackable_confirmable_to_user.rb
+5
-5
db/schema.rb
+0
-5
No files found.
app/assets/stylesheets/custom.scss
View file @
178c8547
@import
"bootstrap"
;
@import
"flash"
;
@import
url('https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400;500;700&display=swap')
;
#logo
{
float
:
left
;
margin-right
:
10px
;
...
...
@@ -159,30 +161,23 @@ footer {
}
}
.alert-error
{
background-color
:
#f2dede
;
border-color
:
#eed3d7
;
color
:
#b94a48
;
text-align
:
left
;
}
.alert-alert
{
background-color
:
#f2dede
;
border-color
:
#eed3d7
;
color
:
#b94a48
;
.alert-error
,
.alert-alert
{
background-color
:
$background-error-alert-color
;
border-color
:
$border-error-alert-color
;
color
:
$error-alert-color
;
text-align
:
left
;
}
.alert-success
{
background-color
:
#dff0d8
;
border-color
:
#d6e9c6
;
color
:
#468847
;
background-color
:
$background-success-notice-color
;
border-color
:
$border-success-notice-color
;
color
:
$success-notice-color
;
text-align
:
left
;
}
.alert-notice
{
background-color
:
#dff0d8
;
border-color
:
#d6e9c6
;
color
:
#468847
;
background-color
:
$background-success-notice-color
;
border-color
:
$border-success-notice-color
;
color
:
$success-notice-color
;
text-align
:
left
;
}
app/assets/stylesheets/flash.scss
0 → 100644
View file @
178c8547
$background-error-alert-color
:
#f2dede
;
$border-error-alert-color
:
#eed3d7
;
$error-alert-color
:
#b94a48
;
$background-success-notice-color
:
#dff0d8
;
$border-success-notice-color
:
#d6e9c6
;
$success-notice-color
:
#468847
;
\ No newline at end of file
app/controllers/users/confirmations_controller.rb
View file @
178c8547
# 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
def
after_resending_confirmation_instructions_path_for
(
resource_name
)
register_2_path
end
# The path used after confirmation.
def
after_confirmation_path_for
(
resource_name
,
resource
)
...
...
app/controllers/users/passwords_controller.rb
View file @
178c8547
# 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
...
...
app/controllers/users/registrations_controller.rb
View file @
178c8547
# 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]
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
...
...
@@ -63,13 +12,4 @@ class Users::RegistrationsController < Devise::RegistrationsController
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])
# end
end
app/controllers/users/sessions_controller.rb
View file @
178c8547
# 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
app/models/user.rb
View file @
178c8547
...
...
@@ -4,7 +4,7 @@ class User < ApplicationRecord
has_many
:favorite_jobs
,
dependent: :destroy
has_many
:history_jobs
,
dependent: :destroy
devise
:database_authenticatable
,
:registerable
,
:recoverable
,
:rememberable
,
:
trackable
,
:
validatable
,
:recoverable
,
:rememberable
,
:validatable
,
:confirmable
validates
:name
,
length:
{
maximum:
200
}
validates
:email
,
length:
{
maximum:
200
},
uniqueness:
true
...
...
app/views/layouts/application.html.slim
View file @
178c8547
...
...
@@ -13,8 +13,6 @@ html
body
.bg-light
=
render
'layouts/header'
.container
/ p.notice= notice
/ p.alert= alert
-
flash
.
each
do
|
key
,
value
|
=
content_tag
(
:div
,
value
,
class:
"alert alert-
#{
key
}
"
)
=
yield
...
...
app/views/users/confirmations/new.html.slim
View file @
178c8547
h2
.p-3.text-center
|
Resend confirmation instructions
.row
.row.p-3
.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
)
do
|
f
|
=
render
'shared/error_messages'
,
object:
resource
.card
.card-body
.field
=
f
.
label
:email
br
=
f
.
email_field
:email
,
autofocus:
true
,
requir
ed:
true
,
autocomplete:
"email"
,
value:
(
resource
.
pending_reconfirmation?
?
resource
.
unconfirmed_email
:
resource
.
email
),
class:
'form-control'
=
f
.
email_field
:email
,
autofocus:
true
,
disabl
ed:
true
,
autocomplete:
"email"
,
value:
(
resource
.
pending_reconfirmation?
?
resource
.
unconfirmed_email
:
resource
.
email
),
class:
'form-control'
.actions.p-3.text-center
=
f
.
submit
"Confirm your email"
,
class:
"btn btn-primary"
\ No newline at end of file
=
link_to
"Back to Login"
,
new_user_session_path
,
class:
"btn btn-primary"
\ No newline at end of file
app/views/users/confirmations/show.html.slim
deleted
100644 → 0
View file @
d3fde0de
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
app/views/users/show.html.slim
View file @
178c8547
...
...
@@ -2,7 +2,7 @@ h2.p-3.text-center
|
My Page
.row
.col-md-6.offset-md-3.form-apply
=
form_with
(
model
:
@user
,
local
:true
)
do
|
f
|
=
form_with
(
scope
:
@user
,
local
:true
)
do
|
f
|
.card
.card-body
.field
...
...
app/views/users/unlocks/new.html.erb
deleted
100644 → 0
View file @
d3fde0de
<h2>
Resend unlock instructions
</h2>
<%=
form_for
(
resource
,
as:
resource_name
,
url:
unlock_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
"Resend unlock instructions"
%>
</div>
<%
end
%>
<%=
render
"users/shared/links"
%>
config/routes.rb
View file @
178c8547
...
...
@@ -9,7 +9,6 @@ Rails.application.routes.draw do
post
'confirm'
,
to:
'apply_jobs#confirm'
post
'done'
,
to:
'apply_jobs#done'
devise_for
:users
,
skip:
%i[sessions registrations passwords]
,
controllers:
{
confirmations:
'users/confirmations'
}
resources
:users
,
only: :show
get
'/my'
,
to:
'users#show'
devise_scope
:user
do
get
'register/1'
,
to:
'users/registrations#new'
,
as: :new_user_registration
...
...
db/migrate/20210818152915_authenticatable_registerable_trackable_confirmable_to_user.rb
View file @
178c8547
...
...
@@ -13,11 +13,11 @@ class AuthenticatableRegisterableTrackableConfirmableToUser < ActiveRecord::Migr
t
.
datetime
:remember_created_at
## Trackable
t
.
integer
:sign_in_count
,
default:
0
,
null:
false
t
.
datetime
:current_sign_in_at
t
.
datetime
:last_sign_in_at
t
.
string
:current_sign_in_ip
t
.
string
:last_sign_in_ip
#
t.integer :sign_in_count, default: 0, null: false
#
t.datetime :current_sign_in_at
#
t.datetime :last_sign_in_at
#
t.string :current_sign_in_ip
#
t.string :last_sign_in_ip
# Confirmable
t
.
string
:confirmation_token
...
...
db/schema.rb
View file @
178c8547
...
...
@@ -157,11 +157,6 @@ ActiveRecord::Schema.define(version: 2021_08_18_152915) do
t
.
string
"reset_password_token"
t
.
datetime
"reset_password_sent_at"
t
.
datetime
"remember_created_at"
t
.
integer
"sign_in_count"
,
default:
0
,
null:
false
t
.
datetime
"current_sign_in_at"
t
.
datetime
"last_sign_in_at"
t
.
string
"current_sign_in_ip"
t
.
string
"last_sign_in_ip"
t
.
string
"confirmation_token"
t
.
datetime
"confirmed_at"
t
.
datetime
"confirmation_sent_at"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment