Refactored profile area

This commit is contained in:
Dmitriy Zaporozhets 2012-09-14 19:13:25 +03:00
parent 8f9a450eed
commit dc37c8aaae
15 changed files with 104 additions and 68 deletions

View file

@ -9,20 +9,20 @@
%li.home{class: tab_class(:profile)}
= link_to "Profile", profile_path
%li{class: tab_class(:password)}
= link_to "Authentication", profile_password_path
%li{class: tab_class(:account)}
= link_to "Account", profile_account_path
%li{class: tab_class(:ssh_keys)}
= link_to keys_path do
SSH Keys
%span.count= current_user.keys.count
%li{class: tab_class(:token)}
= link_to "Token", profile_token_path
%li{class: tab_class(:design)}
= link_to "Design", profile_design_path
%li{class: tab_class(:history)}
= link_to "History", profile_history_path
.content
= yield

View file

@ -0,0 +1,57 @@
- if Gitlab.config.omniauth_enabled?
%fieldset
%legend
%h3.page_title Social Accounts
.oauth_select_holder
%p.hint Tip: Click on icon to activate sigin with one of the following services
- User.omniauth_providers.each do |provider|
%span{class: oauth_active_class(provider) }
= link_to authbutton(provider, 32), omniauth_authorize_path(User, provider)
%fieldset
%legend
%h3.page_title
Private token
%span.cred.right
keep it in secret!
.padded
= form_for @user, url: profile_reset_private_token_path, method: :put do |f|
.data
%p.slead
Private token used to access application resources without authentication.
%br
It can be used for atom feed or API
%p.cgray
- if current_user.private_token
= text_field_tag "token", current_user.private_token, class: "xxlarge large_text"
= f.submit 'Reset', confirm: "Are you sure?", class: "btn primary btn-build-token"
- else
%span You don`t have one yet. Click generate to fix it.
= f.submit 'Generate', class: "btn success btn-build-token"
%fieldset
%legend
%h3.page_title Password
= form_for @user, url: profile_password_path, method: :put do |f|
.padded
%p.slead After successful password update you will be redirected to login page where you should login with new password
-if @user.errors.any?
.alert-message.block-message.error
%ul
- @user.errors.full_messages.each do |msg|
%li= msg
.clearfix
= f.label :password
.input= f.password_field :password
.clearfix
= f.label :password_confirmation
.input= f.password_field :password_confirmation
.actions
= f.submit 'Save', class: "btn save-btn"

View file

@ -0,0 +1,5 @@
.profile_history
= render @events
%hr
= paginate @events, theme: "gitlab"

View file

@ -1,29 +0,0 @@
- if Gitlab.config.omniauth_enabled?
%h3.page_title Accounts
%hr
%p.hint Tip: Click on icon to activate sigin with one of the following services
.oauth_select_holder
- User.omniauth_providers.each do |provider|
%span{class: oauth_active_class(provider) }
= link_to authbutton(provider, 32), omniauth_authorize_path(User, provider)
.clearfix.prepend-top-20
%h3.page_title Password
%hr
= form_for @user, url: profile_password_path, method: :put do |f|
%p.slead After successful password update you will be redirected to login page where you should login with new password
-if @user.errors.any?
.alert-message.block-message.error
%ul
- @user.errors.full_messages.each do |msg|
%li= msg
.clearfix
= f.label :password
.input= f.password_field :password
.clearfix
= f.label :password_confirmation
.input= f.password_field :password_confirmation
.actions
= f.submit 'Save', class: "btn save-btn"

View file

@ -33,13 +33,13 @@
%ul
-unless Gitlab.config.disable_gravatar?
%li
%p.hint You can change your avatar at gravatar.com
%p.hint You can change your avatar at #{link_to "gravatar.com", "http://gravatar.com"}
- if Gitlab.config.omniauth_enabled? && @user.provider?
%li
%p.hint
You can login through #{@user.provider.titleize}!
= link_to "click here to change", profile_password_path
= link_to "click here to change", profile_account_path
%hr
.row

View file

@ -1,23 +0,0 @@
%h3.page_title
Private token
%span.cred.right
keep it in secret!
%hr
= form_for @user, url: profile_reset_private_token_path, method: :put do |f|
.data
%p.slead
Private token used to access application resources without authentication.
%br
It can be used for atom feed or API
%p.cgray
- if current_user.private_token
= text_field_tag "token", current_user.private_token, class: "xxlarge large_text"
- else
You don`t have one yet. Click generate to fix it.
.actions
- if current_user.private_token
= f.submit 'Reset', confirm: "Are you sure?", class: "btn"
- else
= f.submit 'Generate', class: "btn primary"