forked from ontoportal/ontoportal_web_ui
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #321 from ncbo/feature/add-signup-fields/315
Add support for GitHub and ORCID identifiers, plus enhancements to user account management
- Loading branch information
Showing
21 changed files
with
471 additions
and
387 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
.signup { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
padding-top: 40px; | ||
padding-bottom: 40px; | ||
} | ||
|
||
.form-signup { | ||
width: 100%; | ||
max-width: 400px; | ||
padding: 15px; | ||
margin: 0 auto; | ||
|
||
a { | ||
text-decoration: none; | ||
} | ||
|
||
a:hover { | ||
text-decoration: underline; | ||
} | ||
|
||
h4, p { | ||
text-align: center; | ||
} | ||
} | ||
|
||
.form-signup .enable-lists { | ||
color: red; | ||
} | ||
|
||
.edit-user-info { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
|
||
form { | ||
width: 100%; | ||
max-width: 640px; | ||
padding: 15px; | ||
margin: 0 auto; | ||
} | ||
} | ||
|
||
.account-info { | ||
a { | ||
text-decoration: none; | ||
} | ||
|
||
a:hover { | ||
text-decoration: underline; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
.signin { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
padding-top: 40px; | ||
padding-bottom: 40px; | ||
} | ||
|
||
.form-signin { | ||
width: 100%; | ||
max-width: 400px; | ||
padding: 15px; | ||
margin: 0 auto; | ||
|
||
a { | ||
text-decoration: none; | ||
} | ||
|
||
a:hover { | ||
text-decoration: underline; | ||
} | ||
|
||
h4, p { | ||
text-align: center; | ||
} | ||
} | ||
|
||
.form-signin .enable-lists { | ||
color: red; | ||
} | ||
|
||
.password-reset { | ||
display: flex; | ||
justify-content: center; | ||
padding-top: 40px; | ||
padding-bottom: 40px; | ||
|
||
form { | ||
max-width: 640px; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# frozen_string_literal: true | ||
|
||
class PasswordsController < ApplicationController | ||
before_action :require_logged_in_user | ||
before_action :set_user | ||
|
||
layout :determine_layout | ||
|
||
def edit; end | ||
|
||
def update | ||
if params[:password] != params[:password_confirmation] | ||
flash.now[:warning] = 'New password and password confirmation do not match. Please try again.' | ||
render 'edit' | ||
return | ||
end | ||
|
||
response = @user.update(values: { password: params[:password] }) | ||
if response_error?(response) | ||
@errors = response_errors(response) | ||
render 'edit' | ||
else | ||
flash[:success] = 'Password successfully updated!' | ||
redirect_to user_path(@user.username) | ||
end | ||
end | ||
|
||
private | ||
|
||
def password_params | ||
p = params.permit(:password, :password_confirmation) | ||
p.to_h | ||
end | ||
|
||
def require_logged_in_user | ||
if session[:user].blank? | ||
flash[:warning] = 'You must be logged in to access that page' | ||
redirect_to login_index_path | ||
end | ||
end | ||
|
||
def set_user | ||
@user = session[:user] | ||
end | ||
end |
Oops, something went wrong.