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
2
Merge Requests
2
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
Thanh Hung Pham
veNJOB
Commits
ba0c3d60
Commit
ba0c3d60
authored
Jul 07, 2017
by
Thanh Hung Pham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Custome message css
parent
2ed9d395
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
67 additions
and
23 deletions
+67
-23
app/assets/stylesheets/custom.scss
+33
-0
app/helpers/devise_helper.rb
+15
-0
app/models/user.rb
+1
-1
app/upload/1499411244.zip
+0
-0
app/views/devise/registrations/new.html.erb
+10
-17
app/views/layouts/application.html.erb
+8
-5
No files found.
app/assets/stylesheets/custom.scss
View file @
ba0c3d60
...
@@ -24,3 +24,36 @@ footer {
...
@@ -24,3 +24,36 @@ footer {
.total_jobs
{
.total_jobs
{
text-align
:
center
;
text-align
:
center
;
}
}
.errors_panel
{
margin-top
:
50px
;
}
.alert-error
{
background-color
:
#f2dede
;
border-color
:
#eed3d7
;
color
:
#b94a48
;
text-align
:
left
;
}
.alert-alert
{
background-color
:
#f2dede
;
border-color
:
#eed3d7
;
color
:
#b94a48
;
text-align
:
left
;
}
.alert-success
{
background-color
:
#dff0d8
;
border-color
:
#d6e9c6
;
color
:
#468847
;
text-align
:
left
;
}
.alert-notice
{
background-color
:
#dff0d8
;
border-color
:
#d6e9c6
;
color
:
#468847
;
text-align
:
left
;
}
app/helpers/devise_helper.rb
0 → 100644
View file @
ba0c3d60
module
DeviseHelper
def
devise_error_messages!
return
''
if
resource
.
errors
.
empty?
messages
=
resource
.
errors
.
full_messages
.
map
{
|
msg
|
content_tag
(
:li
,
msg
)
}.
join
html
=
<<-
HTML
<div class="alert alert-error alert-danger"> <button type="button"
class="close" data-dismiss="alert">×</button>
#{
messages
}
</div>
HTML
html
.
html_safe
end
end
app/models/user.rb
View file @
ba0c3d60
...
@@ -6,7 +6,7 @@ class User < ApplicationRecord
...
@@ -6,7 +6,7 @@ class User < ApplicationRecord
:recoverable
,
:rememberable
,
:trackable
,
:recoverable
,
:rememberable
,
:trackable
,
:confirmable
,
:lockable
:confirmable
,
:lockable
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
,
length:
{
maximum:
255
},
format:
{
with:
VALID_EMAIL_REGEX
}
validates
:email
,
length:
{
maximum:
255
},
format:
{
with:
VALID_EMAIL_REGEX
}
,
uniqueness:
true
validates_presence_of
:fullname
,
message:
"can't be empty"
,
unless: :skip_fullname_validation
validates_presence_of
:fullname
,
message:
"can't be empty"
,
unless: :skip_fullname_validation
validates_presence_of
:password
,
message:
"can't be empty"
,
unless: :skip_fullname_validation
validates_presence_of
:password
,
message:
"can't be empty"
,
unless: :skip_fullname_validation
...
...
app/upload/1499411244.zip
0 → 100644
View file @
ba0c3d60
File added
app/views/devise/registrations/new.html.erb
View file @
ba0c3d60
<%-
provide
(
:title
,
'Register'
)
-%>
<%-
provide
(
:title
,
'Register'
)
-%>
<div
class=
"well"
>
<div
class=
"well"
>
<h2>
Register
</h2>
<h2>
Register
</h2>
<%-
if
user_signed_in?
-%>
<%=
form_for
(
resource
,
as:
resource_name
,
url:
registration_path
(
resource_name
))
do
|
f
|
%>
<p>
<%=
devise_error_messages!
%>
Hi guys!
</p>
<%-
else
-%>
<%=
form_for
(
resource
,
as:
resource_name
,
url:
registration_path
(
resource_name
))
do
|
f
|
%>
<%=
devise_error_messages!
%>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<%=
f
.
label
:email
%>
<br
/>
<%=
f
.
label
:email
%>
<br
/>
<%=
f
.
email_field
:email
,
autofocus:
true
,
class:
'form-control'
%>
<%=
f
.
email_field
:email
,
autofocus:
true
,
class:
'form-control'
%>
</div>
</div>
<div
class=
"actions"
>
<%=
f
.
submit
"Confirm your email"
,
class:
'btn btn-primary'
%>
</div>
<%
end
%>
<%-
end
-%>
<div
class=
"actions"
>
<%=
f
.
submit
"Confirm your email"
,
class:
'btn btn-primary'
%>
</div>
<%
end
%>
</div>
</div>
app/views/layouts/application.html.erb
View file @
ba0c3d60
...
@@ -11,11 +11,14 @@
...
@@ -11,11 +11,14 @@
<body>
<body>
<%=
render
'layouts/header'
%>
<%=
render
'layouts/header'
%>
<div
class=
"container"
>
<div
class=
"container"
>
<%
flash
.
each
do
|
key
,
value
|
%>
<div
class=
"errors_panel"
>
<div
class=
"alert alert-
<%=
key
%>
"
>
<%
flash
.
each
do
|
key
,
value
|
%>
<%=
value
%>
<div
class=
"alert alert-
<%=
key
%>
"
>
</div>
<%=
value
%>
<%
end
%>
</div>
<%
end
%>
</div>
<%=
yield
%>
<%=
yield
%>
<%=
render
'layouts/footer'
%>
<%=
render
'layouts/footer'
%>
</div>
</div>
...
...
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