2015-04-30 17:06:18 +00:00
|
|
|
|
- page_title "Account"
|
2015-09-09 21:05:47 +00:00
|
|
|
|
- header_title page_title, profile_account_path
|
2015-09-09 22:34:09 +00:00
|
|
|
|
- @blank_container = true
|
2015-09-09 21:05:47 +00:00
|
|
|
|
|
2015-03-22 00:44:40 +00:00
|
|
|
|
- if current_user.ldap_user?
|
|
|
|
|
.alert.alert-info
|
2013-10-09 13:37:37 +00:00
|
|
|
|
Some options are unavailable for LDAP accounts
|
|
|
|
|
|
2013-10-10 07:30:07 +00:00
|
|
|
|
.account-page
|
2015-05-28 13:26:37 +00:00
|
|
|
|
.panel.panel-default.update-token
|
|
|
|
|
.panel-heading
|
2015-02-23 18:40:06 +00:00
|
|
|
|
Reset Private token
|
2015-05-28 13:26:37 +00:00
|
|
|
|
.panel-body
|
2013-10-09 13:37:37 +00:00
|
|
|
|
= form_for @user, url: reset_private_token_profile_path, method: :put do |f|
|
|
|
|
|
.data
|
|
|
|
|
%p
|
|
|
|
|
Your private token is used to access application resources without authentication.
|
|
|
|
|
%br
|
|
|
|
|
It can be used for atom feeds or the API.
|
|
|
|
|
%span.cred
|
|
|
|
|
Keep it secret!
|
|
|
|
|
|
|
|
|
|
%p.cgray
|
|
|
|
|
- if current_user.private_token
|
2013-12-31 00:50:36 +00:00
|
|
|
|
= text_field_tag "token", current_user.private_token, class: "form-control"
|
|
|
|
|
%div
|
2015-05-28 18:36:47 +00:00
|
|
|
|
= f.submit 'Reset private token', data: { confirm: "Are you sure?" }, class: "btn btn-default btn-build-token"
|
2013-10-09 13:37:37 +00:00
|
|
|
|
- else
|
|
|
|
|
%span You don`t have one yet. Click generate to fix it.
|
2015-05-28 18:36:47 +00:00
|
|
|
|
= f.submit 'Generate', class: "btn btn-default btn-build-token"
|
2013-10-09 13:37:37 +00:00
|
|
|
|
|
2015-03-31 01:19:01 +00:00
|
|
|
|
- unless current_user.ldap_user?
|
2015-05-28 18:36:47 +00:00
|
|
|
|
.panel.panel-default
|
|
|
|
|
.panel-heading
|
|
|
|
|
Two-factor Authentication
|
|
|
|
|
.panel-body
|
2015-06-19 19:14:37 +00:00
|
|
|
|
- if current_user.two_factor_enabled?
|
2015-03-31 01:19:01 +00:00
|
|
|
|
.pull-right
|
2015-05-09 18:23:34 +00:00
|
|
|
|
= link_to 'Disable Two-factor Authentication', profile_two_factor_auth_path, method: :delete, class: 'btn btn-close btn-sm',
|
2015-05-04 18:11:00 +00:00
|
|
|
|
data: { confirm: 'Are you sure?' }
|
2015-05-28 18:36:47 +00:00
|
|
|
|
%p.text-success
|
|
|
|
|
%strong
|
|
|
|
|
Two-factor Authentication is enabled
|
2015-04-02 18:57:36 +00:00
|
|
|
|
%p
|
2015-05-09 00:45:50 +00:00
|
|
|
|
If you lose your recovery codes you can
|
2015-04-02 18:57:36 +00:00
|
|
|
|
%strong
|
2015-05-09 00:45:50 +00:00
|
|
|
|
= succeed ',' do
|
2015-05-09 18:23:34 +00:00
|
|
|
|
= link_to 'generate new ones', codes_profile_two_factor_auth_path, method: :post, data: { confirm: 'Are you sure?' }
|
2015-05-09 00:45:50 +00:00
|
|
|
|
invalidating all previous codes.
|
2015-03-31 19:42:17 +00:00
|
|
|
|
|
2015-05-28 18:36:47 +00:00
|
|
|
|
- else
|
2015-03-31 19:42:17 +00:00
|
|
|
|
%p
|
2015-05-09 00:55:45 +00:00
|
|
|
|
Increase your account's security by enabling two-factor authentication (2FA).
|
|
|
|
|
%p
|
|
|
|
|
Each time you log in you’ll be required to provide your username and
|
|
|
|
|
password as usual, plus a randomly-generated code from your phone.
|
2015-03-31 19:42:17 +00:00
|
|
|
|
%div
|
2015-05-09 18:23:34 +00:00
|
|
|
|
= link_to 'Enable Two-factor Authentication', new_profile_two_factor_auth_path, class: 'btn btn-success'
|
2013-10-09 13:37:37 +00:00
|
|
|
|
|
2015-07-02 14:33:38 +00:00
|
|
|
|
- if button_based_providers.any?
|
2015-05-28 13:26:37 +00:00
|
|
|
|
.panel.panel-default
|
|
|
|
|
.panel-heading
|
|
|
|
|
Connected Accounts
|
|
|
|
|
.panel-body
|
|
|
|
|
.oauth-buttons.append-bottom-10
|
|
|
|
|
%p Click on icon to activate signin with one of the following services
|
2015-07-02 14:33:38 +00:00
|
|
|
|
- button_based_providers.each do |provider|
|
2015-05-28 13:26:37 +00:00
|
|
|
|
.btn-group
|
2015-07-02 14:33:38 +00:00
|
|
|
|
= link_to provider_image_tag(provider), user_omniauth_authorize_path(provider), method: :post, class: "btn btn-lg #{'active' if auth_active?(provider)}", "data-no-turbolink" => "true"
|
2015-09-09 21:05:47 +00:00
|
|
|
|
|
2015-07-02 14:33:38 +00:00
|
|
|
|
- if auth_active?(provider)
|
2015-05-28 13:26:37 +00:00
|
|
|
|
= link_to unlink_profile_account_path(provider: provider), method: :delete, class: 'btn btn-lg' do
|
|
|
|
|
= icon('close')
|
2013-10-09 13:37:37 +00:00
|
|
|
|
|
2015-07-02 14:33:38 +00:00
|
|
|
|
- if current_user.can_change_username?
|
2015-05-28 13:26:37 +00:00
|
|
|
|
.panel.panel-warning.update-username
|
|
|
|
|
.panel-heading
|
2015-02-23 18:40:06 +00:00
|
|
|
|
Change Username
|
2015-05-28 13:26:37 +00:00
|
|
|
|
.panel-body
|
|
|
|
|
= form_for @user, url: update_username_profile_path, method: :put, remote: true do |f|
|
2014-02-05 18:30:57 +00:00
|
|
|
|
%p
|
2015-05-28 13:26:37 +00:00
|
|
|
|
Changing your username will change path to all personal projects!
|
|
|
|
|
%div
|
|
|
|
|
= f.text_field :username, required: true, class: 'form-control'
|
|
|
|
|
|
|
|
|
|
.loading-gif.hide
|
|
|
|
|
%p
|
|
|
|
|
= icon('spinner spin')
|
|
|
|
|
Saving new username
|
|
|
|
|
%p.light
|
|
|
|
|
= user_url(@user)
|
|
|
|
|
%div
|
|
|
|
|
= f.submit 'Save username', class: "btn btn-warning"
|
2013-10-09 13:37:37 +00:00
|
|
|
|
|
2015-07-02 14:33:38 +00:00
|
|
|
|
- if signup_enabled?
|
2015-05-28 13:26:37 +00:00
|
|
|
|
.panel.panel-danger.remove-account
|
|
|
|
|
.panel-heading
|
2013-10-09 13:37:37 +00:00
|
|
|
|
Remove account
|
2015-05-28 13:26:37 +00:00
|
|
|
|
.panel-body
|
2015-05-28 10:00:02 +00:00
|
|
|
|
- if @user.can_be_removed?
|
|
|
|
|
%p Deleting an account has the following effects:
|
|
|
|
|
%ul
|
|
|
|
|
%li All user content like authored issues, snippets, comments will be removed
|
|
|
|
|
- rp = current_user.personal_projects.count
|
|
|
|
|
- unless rp.zero?
|
|
|
|
|
%li #{pluralize rp, 'personal project'} will be removed and cannot be restored
|
|
|
|
|
= link_to 'Delete account', user_registration_path, data: { confirm: "REMOVE #{current_user.name}? Are you sure?" }, method: :delete, class: "btn btn-remove"
|
|
|
|
|
- else
|
|
|
|
|
- if @user.solo_owned_groups.present?
|
|
|
|
|
%p
|
|
|
|
|
Your account is currently an owner in these groups:
|
|
|
|
|
%strong #{@user.solo_owned_groups.map(&:name).join(', ')}
|
|
|
|
|
%p
|
2015-06-12 03:15:11 +00:00
|
|
|
|
You must transfer ownership or delete these groups before you can delete your account.
|