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 Ngoc Nghia
VeNJOB
Commits
1bc1aba8
Commit
1bc1aba8
authored
Dec 04, 2019
by
Nguyen Ngoc Nghia
Committed by
nnnghia98
Dec 06, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
login page
parent
a7686a7d
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
8 deletions
+38
-8
app/assets/stylesheets/custom.scss
+1
-1
app/controllers/application_controller.rb
+5
-1
app/views/layouts/_header.html.erb
+3
-3
app/views/users/sessions/new.html.erb
+26
-0
app/views/users/shared/_links.html.erb
+3
-3
No files found.
app/assets/stylesheets/custom.scss
View file @
1bc1aba8
...
@@ -14,7 +14,7 @@ $light-gray: #777;
...
@@ -14,7 +14,7 @@ $light-gray: #777;
/* universal */
/* universal */
body
{
body
{
padding-top
:
9
0px
;
padding-top
:
6
0px
;
}
}
section
{
section
{
...
...
app/controllers/application_controller.rb
View file @
1bc1aba8
...
@@ -6,7 +6,11 @@ class ApplicationController < ActionController::Base
...
@@ -6,7 +6,11 @@ class ApplicationController < ActionController::Base
protected
protected
def
configure_permitted_parameters
def
configure_permitted_parameters
added_attrs
=
[
:username
,
:email
,
:password
,
:password_confirmation
]
added_attrs
=
[
:username
,
:email
,
:password
,
:password_confirmation
,
:remember_me
]
devise_parameter_sanitizer
.
permit
:sign_up
,
keys:
added_attrs
devise_parameter_sanitizer
.
permit
:sign_up
,
keys:
added_attrs
end
end
def
after_sign_in_path_for
(
resource
)
stored_location_for
(
resource
)
||
root_path
end
end
end
app/views/layouts/_header.html.erb
View file @
1bc1aba8
...
@@ -5,11 +5,11 @@
...
@@ -5,11 +5,11 @@
<ul
class=
"nav navbar-nav navbar-right"
>
<ul
class=
"nav navbar-nav navbar-right"
>
<ul
class=
"list"
>
<ul
class=
"list"
>
<%
if
user_signed_in?
%>
<%
if
user_signed_in?
%>
Logged in as
<strong>
<%=
current_user
.
email
%>
</strong>
.
Logged in as
<strong>
<%=
current_user
.
email
%>
</strong>
<li
class=
"list-inline-item"
></li>
<%=
link_to
"My Page"
,
"#"
%>
</li>
<li
class=
"list-inline-item"
></li>
<%=
link_to
"My Page"
,
"#"
%>
</li>
<li
class=
"list-inline-item"
></li>
<%=
link_to
"Logout"
,
"#"
%>
</li>
<li
class=
"list-inline-item"
></li>
<%=
link_to
"Logout"
,
destroy_user_session_path
,
method: :delete
%>
</li>
<%
else
%>
<%
else
%>
<li
class=
"list-inline-item"
>
<%=
link_to
"Login"
,
"#"
%>
</li>
<li
class=
"list-inline-item"
>
<%=
link_to
"Login"
,
new_user_session_path
%>
</li>
<li
class=
"list-inline-item"
>
<%=
link_to
"Register"
,
new_user_registration_path
%>
</li>
<li
class=
"list-inline-item"
>
<%=
link_to
"Register"
,
new_user_registration_path
%>
</li>
<%
end
%>
<%
end
%>
<li
class=
"list-inline-item"
>
<%=
link_to
"Favorite"
,
"#"
%>
</li>
<li
class=
"list-inline-item"
>
<%=
link_to
"Favorite"
,
"#"
%>
</li>
...
...
app/views/users/sessions/new.html.erb
0 → 100644
View file @
1bc1aba8
<h1>
Login
</h1>
<%=
form_for
(
resource
,
as:
resource_name
,
url:
session_path
(
resource_name
))
do
|
f
|
%>
<div
class=
"form-group"
>
<%=
f
.
label
:email
%>
<br
/>
<%=
f
.
email_field
:email
,
autofocus:
true
,
autocomplete:
"email"
,
class:
"form-control"
%>
</div>
<div
class=
"form-group"
>
<%=
f
.
label
:password
%>
<br
/>
<%=
f
.
password_field
:password
,
autocomplete:
"current-password"
,
class:
"form-control"
%>
</div>
<%
if
devise_mapping
.
rememberable?
%>
<div
class=
"form-group"
>
<%=
f
.
check_box
:remember_me
%>
<%=
f
.
label
:remember_me
%>
</div>
<%
end
%>
<div
class=
"actions"
>
<%=
f
.
submit
"Login"
,
class:
"btn btn-primary"
%>
</div>
<%
end
%>
<%=
render
"users/shared/links"
%>
app/views/users/shared/_links.html.erb
View file @
1bc1aba8
<%-
if
controller_name
!=
'sessions'
%>
<%-
if
controller_name
!=
'sessions'
%>
<%=
link_to
"Log
in"
,
new_session_path
(
resource_name
)
%>
<br
/>
<%=
link_to
"Login"
,
new_session_path
(
resource_name
)
%>
<br
/>
<%
end
%>
<%
end
%>
<%-
if
devise_mapping
.
registerable?
&&
controller_name
!=
"registrations"
%>
<%-
if
devise_mapping
.
registerable?
&&
controller_name
!=
"registrations"
%>
<%=
link_to
"
Sign up
"
,
new_registration_path
(
resource_name
)
%>
<br
/>
<%=
link_to
"
Register
"
,
new_registration_path
(
resource_name
)
%>
<br
/>
<%
end
%>
<%
end
%>
<%-
if
devise_mapping
.
recoverable?
&&
controller_name
!=
"passwords"
&&
controller_name
!=
"registrations"
%>
<%-
if
devise_mapping
.
recoverable?
&&
controller_name
!=
"passwords"
&&
controller_name
!=
"registrations"
%>
<%=
link_to
"Forgot
your
password?"
,
new_password_path
(
resource_name
)
%>
<br
/>
<%=
link_to
"Forgot password?"
,
new_password_path
(
resource_name
)
%>
<br
/>
<%
end
%>
<%
end
%>
<%-
if
devise_mapping
.
confirmable?
&&
controller_name
!=
"confirmations"
%>
<%-
if
devise_mapping
.
confirmable?
&&
controller_name
!=
"confirmations"
%>
...
...
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