Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
3832b2aa
Commit
3832b2aa
authored
Sep 04, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve Profile#account page
parent
3707cc11
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
128 additions
and
79 deletions
+128
-79
app/helpers/profile_helper.rb
app/helpers/profile_helper.rb
+12
-0
app/views/profiles/account.html.haml
app/views/profiles/account.html.haml
+116
-79
No files found.
app/helpers/profile_helper.rb
View file @
3832b2aa
...
@@ -4,4 +4,16 @@ module ProfileHelper
...
@@ -4,4 +4,16 @@ module ProfileHelper
'active'
'active'
end
end
end
end
def
show_profile_username_tab?
current_user
.
can_change_username?
end
def
show_profile_social_tab?
Gitlab
.
config
.
omniauth
.
enabled
&&
!
current_user
.
ldap_user?
end
def
show_profile_remove_tab?
Gitlab
.
config
.
gitlab
.
signup_enabled
&&
!
current_user
.
ldap_user?
end
end
end
app/views/profiles/account.html.haml
View file @
3832b2aa
...
@@ -5,47 +5,41 @@
...
@@ -5,47 +5,41 @@
-
if
current_user
.
ldap_user?
-
if
current_user
.
ldap_user?
Some options are unavailable for LDAP accounts
Some options are unavailable for LDAP accounts
%hr
%hr
-
unless
current_user
.
ldap_user?
-
if
Gitlab
.
config
.
omniauth
.
enabled
%fieldset
%legend
Social Accounts
.oauth_select_holder
%p
.hint
Tip: Click on icon to activate signin with one of the following services
-
enabled_social_providers
.
each
do
|
provider
|
%span
{
class:
oauth_active_class
(
provider
)
}
=
link_to
authbutton
(
provider
,
32
),
omniauth_authorize_path
(
User
,
provider
)
%fieldset
.update-password
.row
%legend
Password
.span2
=
form_for
@user
,
url:
update_password_profile_path
,
method: :put
do
|
f
|
%ul
.nav.nav-pills.nav-stacked.nav-stacked-menu
.padded
%li
.active
%p
.slead
After a successful password update you will be redirected to login page where you should login with your new password
=
link_to
'#tab-token'
,
'data-toggle'
=>
'tab'
do
-
if
@user
.
errors
.
any?
Private Token
.alert.alert-error
%li
%ul
=
link_to
'#tab-password'
,
'data-toggle'
=>
'tab'
do
-
@user
.
errors
.
full_messages
.
each
do
|
msg
|
Password
%li
=
msg
.control-group
=
f
.
label
:password
.controls
=
f
.
password_field
:password
,
required:
true
.control-group
=
f
.
label
:password_confirmation
.controls
=
f
.
password_field
:password_confirmation
,
required:
true
.control-group
.controls
=
f
.
submit
'Save password'
,
class:
"btn btn-save"
-
if
show_profile_social_tab?
%li
=
link_to
'#tab-social'
,
'data-toggle'
=>
'tab'
do
Social Accounts
-
if
show_profile_username_tab?
%li
=
link_to
'#tab-username'
,
'data-toggle'
=>
'tab'
do
Change Username
%fieldset
.update-token
-
if
show_profile_remove_tab?
%li
=
link_to
'#tab-remove'
,
'data-toggle'
=>
'tab'
do
Remove Account
.span10
.tab-content
.tab-pane.active
#tab-token
%fieldset
.update-token
%legend
%legend
Private token
Private token
%span
.cred.pull-right
%span
.cred.pull-right
keep it secret!
keep it secret!
.padded
%div
=
form_for
@user
,
url:
reset_private_token_profile_path
,
method: :put
do
|
f
|
=
form_for
@user
,
url:
reset_private_token_profile_path
,
method: :put
do
|
f
|
.data
.data
%p
.slead
%p
.slead
...
@@ -60,15 +54,48 @@
...
@@ -60,15 +54,48 @@
%span
You don`t have one yet. Click generate to fix it.
%span
You don`t have one yet. Click generate to fix it.
=
f
.
submit
'Generate'
,
class:
"btn success btn-build-token"
=
f
.
submit
'Generate'
,
class:
"btn success btn-build-token"
.tab-pane
#tab-password
%fieldset
.update-password
%legend
Password
=
form_for
@user
,
url:
update_password_profile_path
,
method: :put
do
|
f
|
%div
%p
.slead
After a successful password update you will be redirected to login page where you should login with your new password
-
if
@user
.
errors
.
any?
.alert.alert-error
%ul
-
@user
.
errors
.
full_messages
.
each
do
|
msg
|
%li
=
msg
.control-group
=
f
.
label
:password
.controls
=
f
.
password_field
:password
,
required:
true
.control-group
=
f
.
label
:password_confirmation
.controls
=
f
.
password_field
:password_confirmation
,
required:
true
.control-group
.controls
=
f
.
submit
'Save password'
,
class:
"btn btn-save"
-
if
show_profile_social_tab?
.tab-pane
#tab-social
%fieldset
%legend
Social Accounts
.oauth_select_holder
%p
.hint
Tip: Click on icon to activate signin with one of the following services
-
enabled_social_providers
.
each
do
|
provider
|
%span
{
class:
oauth_active_class
(
provider
)
}
=
link_to
authbutton
(
provider
,
32
),
omniauth_authorize_path
(
User
,
provider
)
-
if
current_user
.
can_change_username?
-
if
show_profile_username_tab?
.tab-pane
#tab-username
%fieldset
.update-username
%fieldset
.update-username
%legend
%legend
Username
Username
%small
.cred.pull-right
%small
.cred.pull-right
Changing your username can have unintended side effects!
Changing your username can have unintended side effects!
=
form_for
@user
,
url:
update_username_profile_path
,
method: :put
,
remote:
true
do
|
f
|
=
form_for
@user
,
url:
update_username_profile_path
,
method: :put
,
remote:
true
do
|
f
|
.padded
%div
.control-group
=
f
.
label
:username
=
f
.
label
:username
.controls
.controls
=
f
.
text_field
:username
,
required:
true
=
f
.
text_field
:username
,
required:
true
...
@@ -86,10 +113,20 @@
...
@@ -86,10 +113,20 @@
.controls
.controls
=
f
.
submit
'Save username'
,
class:
"btn btn-save"
=
f
.
submit
'Save username'
,
class:
"btn btn-save"
-
if
gitlab_config
.
signup_enabled
&&
!
current_user
.
ldap_user?
-
if
show_profile_remove_tab?
.tab-pane
#tab-remove
%fieldset
.remove-account
%fieldset
.remove-account
%legend
%legend
Remove account
Remove account
%small
.cred.pull-right
%div
Before removing the account you must remove all projects!
%p
Deleting an account has the following effects:
=
link_to
'Delete account'
,
user_registration_path
,
confirm:
"REMOVE
#{
current_user
.
name
}
? Are you sure?"
,
method: :delete
,
class:
"btn btn-remove delete-key btn-small pull-right"
%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
-
if
current_user
.
solo_owned_groups
.
present?
%li
Next groups will be abandoned. You should transfer or remove them:
%strong
#{
current_user
.
solo_owned_groups
.
map
(
&
:name
).
join
(
', '
)
}
=
link_to
'Delete account'
,
user_registration_path
,
confirm:
"REMOVE
#{
current_user
.
name
}
? Are you sure?"
,
method: :delete
,
class:
"btn btn-remove"
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