From dcc9dc94d56fc909fa7264e2c0e0541f0029272f Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 28 May 2015 14:44:38 +0200 Subject: Re-organize profile settings titles and headers Signed-off-by: Dmitriy Zaporozhets --- app/views/layouts/profile.html.haml | 4 ++-- app/views/profiles/applications.html.haml | 2 +- app/views/profiles/design.html.haml | 2 +- app/views/profiles/emails/index.html.haml | 2 +- app/views/profiles/keys/index.html.haml | 2 +- app/views/profiles/notifications/show.html.haml | 2 +- app/views/profiles/passwords/edit.html.haml | 3 ++- app/views/profiles/show.html.haml | 4 ++-- 8 files changed, 11 insertions(+), 10 deletions(-) diff --git a/app/views/layouts/profile.html.haml b/app/views/layouts/profile.html.haml index 9799b4cc4d7..3193206fe12 100644 --- a/app/views/layouts/profile.html.haml +++ b/app/views/layouts/profile.html.haml @@ -1,5 +1,5 @@ -- page_title "Profile" -- header_title "Profile", profile_path +- page_title "Settings" +- header_title "Settings", profile_path - sidebar "profile" = render template: "layouts/application" diff --git a/app/views/profiles/applications.html.haml b/app/views/profiles/applications.html.haml index c4f6f59624b..06857c302ac 100644 --- a/app/views/profiles/applications.html.haml +++ b/app/views/profiles/applications.html.haml @@ -1,6 +1,6 @@ - page_title "Applications" %h3.page-title - Application Settings + = page_title %p.light OAuth2 protocol settings below. diff --git a/app/views/profiles/design.html.haml b/app/views/profiles/design.html.haml index af284f60409..6a3b4e88dba 100644 --- a/app/views/profiles/design.html.haml +++ b/app/views/profiles/design.html.haml @@ -1,6 +1,6 @@ - page_title "Design" %h3.page-title - Design Settings + = page_title %p.light Appearance settings will be saved to your profile and made available across all devices. %hr diff --git a/app/views/profiles/emails/index.html.haml b/app/views/profiles/emails/index.html.haml index 2c0d0e10a4c..88e4f69b14c 100644 --- a/app/views/profiles/emails/index.html.haml +++ b/app/views/profiles/emails/index.html.haml @@ -1,6 +1,6 @@ - page_title "Emails" %h3.page-title - Email Settings + = page_title %p.light Your %b Primary Email diff --git a/app/views/profiles/keys/index.html.haml b/app/views/profiles/keys/index.html.haml index e3af0d4e189..06655f7ba3a 100644 --- a/app/views/profiles/keys/index.html.haml +++ b/app/views/profiles/keys/index.html.haml @@ -1,6 +1,6 @@ - page_title "SSH Keys" %h3.page-title - SSH Keys Settings + = page_title .pull-right = link_to "Add SSH Key", new_profile_key_path, class: "btn btn-new" %p.light diff --git a/app/views/profiles/notifications/show.html.haml b/app/views/profiles/notifications/show.html.haml index a74d97dac3b..9480a19f5b2 100644 --- a/app/views/profiles/notifications/show.html.haml +++ b/app/views/profiles/notifications/show.html.haml @@ -1,6 +1,6 @@ - page_title "Notifications" %h3.page-title - Notifications Settings + = page_title %p.light These are your global notification settings. %hr diff --git a/app/views/profiles/passwords/edit.html.haml b/app/views/profiles/passwords/edit.html.haml index 21dabbdfe2c..399ae98adf9 100644 --- a/app/views/profiles/passwords/edit.html.haml +++ b/app/views/profiles/passwords/edit.html.haml @@ -1,5 +1,6 @@ - page_title "Password" -%h3.page-title Password Settings +%h3.page-title + = page_title %p.light - if @user.password_automatically_set? Set your password. diff --git a/app/views/profiles/show.html.haml b/app/views/profiles/show.html.haml index 29c30905117..62fac46df27 100644 --- a/app/views/profiles/show.html.haml +++ b/app/views/profiles/show.html.haml @@ -1,6 +1,6 @@ -- page_title "Settings" +- page_title "Profile" %h3.page-title - Profile Settings + = page_title %p.light This information will appear on your profile. - if current_user.ldap_user? -- cgit v1.2.1 From 47989d6037cf8dee0897a22ecb53921c680e9bce Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 28 May 2015 14:54:05 +0200 Subject: Consistent header look for setting pages Signed-off-by: Dmitriy Zaporozhets --- app/views/profiles/accounts/show.html.haml | 5 +++++ app/views/profiles/applications.html.haml | 1 + app/views/profiles/emails/index.html.haml | 32 +++++++++++++++++------------- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/app/views/profiles/accounts/show.html.haml b/app/views/profiles/accounts/show.html.haml index 06bad7dd84a..5939c951fe8 100644 --- a/app/views/profiles/accounts/show.html.haml +++ b/app/views/profiles/accounts/show.html.haml @@ -1,4 +1,9 @@ - page_title "Account" +%h3.page-title + = page_title +%p.light + Change your username and basic account settings. +%hr - if current_user.ldap_user? .alert.alert-info Some options are unavailable for LDAP accounts diff --git a/app/views/profiles/applications.html.haml b/app/views/profiles/applications.html.haml index 06857c302ac..353b2496a7c 100644 --- a/app/views/profiles/applications.html.haml +++ b/app/views/profiles/applications.html.haml @@ -3,6 +3,7 @@ = page_title %p.light OAuth2 protocol settings below. +%hr %fieldset.oauth-applications %legend Your applications diff --git a/app/views/profiles/emails/index.html.haml b/app/views/profiles/emails/index.html.haml index 88e4f69b14c..66812872c41 100644 --- a/app/views/profiles/emails/index.html.haml +++ b/app/views/profiles/emails/index.html.haml @@ -2,22 +2,26 @@ %h3.page-title = page_title %p.light - Your - %b Primary Email - will be used for avatar detection and web based operations, such as edits and merges. -%p.light - Your - %b Notification Email - will be used for account notifications. -%p.light - Your - %b Public Email - will be displayed on your public profile. -%p.light - All email addresses will be used to identify your commits. - + Control emails linked to your account %hr + +%ul + %li + Your + %b Primary Email + will be used for avatar detection and web based operations, such as edits and merges. + %li + Your + %b Notification Email + will be used for account notifications. + %li + Your + %b Public Email + will be displayed on your public profile. + %li + All email addresses will be used to identify your commits. + .panel.panel-default .panel-heading Emails (#{@emails.count + 1}) -- cgit v1.2.1 From 35d0d774a1b2aa47a68b7c77ba163886327cb4cd Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 28 May 2015 15:26:37 +0200 Subject: Prefer panels over fieldset when different forms Signed-off-by: Dmitriy Zaporozhets --- app/views/profiles/accounts/show.html.haml | 84 ++++++++++++++++-------------- app/views/profiles/applications.html.haml | 13 +++-- app/views/profiles/design.html.haml | 78 +++++++++++++-------------- 3 files changed, 92 insertions(+), 83 deletions(-) diff --git a/app/views/profiles/accounts/show.html.haml b/app/views/profiles/accounts/show.html.haml index 5939c951fe8..55bd9096391 100644 --- a/app/views/profiles/accounts/show.html.haml +++ b/app/views/profiles/accounts/show.html.haml @@ -9,10 +9,10 @@ Some options are unavailable for LDAP accounts .account-page - %fieldset.update-token - %legend + .panel.panel-default.update-token + .panel-heading Reset Private token - %div + .panel-body = form_for @user, url: reset_private_token_profile_path, method: :put do |f| .data %p @@ -32,12 +32,11 @@ = f.submit 'Generate', class: "btn success btn-build-token" - unless current_user.ldap_user? - %fieldset - - if current_user.otp_required_for_login - %legend.text-success - = icon('check') + - if current_user.otp_required_for_login + .panel.panel-success + .panel-heading Two-factor Authentication enabled - %div + .panel-body .pull-right = link_to 'Disable Two-factor Authentication', profile_two_factor_auth_path, method: :delete, class: 'btn btn-close btn-sm', data: { confirm: 'Are you sure?' } @@ -48,9 +47,11 @@ = link_to 'generate new ones', codes_profile_two_factor_auth_path, method: :post, data: { confirm: 'Are you sure?' } invalidating all previous codes. - - else - %legend Two-factor Authentication - %div + - else + .panel.panel-default + .panel-heading + Two-factor Authentication + .panel-body %p Increase your account's security by enabling two-factor authentication (2FA). %p @@ -60,42 +61,45 @@ = link_to 'Enable Two-factor Authentication', new_profile_two_factor_auth_path, class: 'btn btn-success' - if show_profile_social_tab? - %fieldset - %legend Connected Accounts - .oauth-buttons.append-bottom-10 - %p Click on icon to activate signin with one of the following services - - enabled_social_providers.each do |provider| - .btn-group - = link_to oauth_image_tag(provider), omniauth_authorize_path(User, provider), - method: :post, class: "btn btn-lg #{'active' if oauth_active?(provider)}" - - if oauth_active?(provider) - = link_to unlink_profile_account_path(provider: provider), method: :delete, class: 'btn btn-lg' do - = icon('close') + .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 + - enabled_social_providers.each do |provider| + .btn-group + = link_to oauth_image_tag(provider), omniauth_authorize_path(User, provider), + method: :post, class: "btn btn-lg #{'active' if oauth_active?(provider)}" + - if oauth_active?(provider) + = link_to unlink_profile_account_path(provider: provider), method: :delete, class: 'btn btn-lg' do + = icon('close') - if show_profile_username_tab? - %fieldset.update-username - %legend + .panel.panel-warning.update-username + .panel-heading Change Username - = form_for @user, url: update_username_profile_path, method: :put, remote: true do |f| - %p - Changing your username will change path to all personal projects! - %div - = f.text_field :username, required: true, class: 'form-control' -   - .loading-gif.hide + .panel-body + = form_for @user, url: update_username_profile_path, method: :put, remote: true do |f| %p - = icon('spinner spin') - Saving new username - %p.light - = user_url(@user) - %div - = f.submit 'Save username', class: "btn btn-warning" + 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" - if show_profile_remove_tab? - %fieldset.remove-account - %legend + .panel.panel-danger.remove-account + .panel-heading Remove account - %div + .panel-body %p Deleting an account has the following effects: %ul %li All user content like authored issues, snippets, comments will be removed diff --git a/app/views/profiles/applications.html.haml b/app/views/profiles/applications.html.haml index 353b2496a7c..c145a9b7f6d 100644 --- a/app/views/profiles/applications.html.haml +++ b/app/views/profiles/applications.html.haml @@ -5,9 +5,11 @@ OAuth2 protocol settings below. %hr -%fieldset.oauth-applications - %legend Your applications - %p= link_to 'New Application', new_oauth_application_path, class: 'btn btn-success' +.oauth-applications + %h3 + Your applications + .pull-right + = link_to 'New Application', new_oauth_application_path, class: 'btn btn-success' - if @applications.any? %table.table.table-striped %thead @@ -28,8 +30,9 @@ %td= link_to 'Edit', edit_oauth_application_path(application), class: 'btn btn-link btn-sm' %td= render 'doorkeeper/applications/delete_form', application: application -%fieldset.oauth-authorized-applications.prepend-top-20 - %legend Authorized applications +.oauth-authorized-applications.prepend-top-20 + %h3 + Authorized applications - if @authorized_tokens.any? %table.table.table-striped diff --git a/app/views/profiles/design.html.haml b/app/views/profiles/design.html.haml index 6a3b4e88dba..f450ec1c018 100644 --- a/app/views/profiles/design.html.haml +++ b/app/views/profiles/design.html.haml @@ -6,49 +6,51 @@ %hr = form_for @user, url: profile_path, remote: true, method: :put do |f| - %fieldset.application-theme - %legend + .panel.panel-default.application-theme + .panel-heading Application theme - .themes_opts - = label_tag do - .prev.default - = f.radio_button :theme_id, 1 - Graphite + .panel-body + .themes_opts + = label_tag do + .prev.default + = f.radio_button :theme_id, 1 + Graphite - = label_tag do - .prev.classic - = f.radio_button :theme_id, 2 - Charcoal + = label_tag do + .prev.classic + = f.radio_button :theme_id, 2 + Charcoal - = label_tag do - .prev.modern - = f.radio_button :theme_id, 3 - Green + = label_tag do + .prev.modern + = f.radio_button :theme_id, 3 + Green - = label_tag do - .prev.gray - = f.radio_button :theme_id, 4 - Gray + = label_tag do + .prev.gray + = f.radio_button :theme_id, 4 + Gray - = label_tag do - .prev.violet - = f.radio_button :theme_id, 5 - Violet + = label_tag do + .prev.violet + = f.radio_button :theme_id, 5 + Violet - = label_tag do - .prev.blue - = f.radio_button :theme_id, 6 - Blue - %br - .clearfix + = label_tag do + .prev.blue + = f.radio_button :theme_id, 6 + Blue + %br + .clearfix - %fieldset.code-preview-theme - %legend + .panel.panel-default.code-preview-theme + .panel-heading Code preview theme - .code_highlight_opts - - color_schemes.each do |color_scheme_id, color_scheme| - = label_tag do - .prev - = image_tag "#{color_scheme}-scheme-preview.png" - = f.radio_button :color_scheme_id, color_scheme_id - = color_scheme.gsub(/[-_]+/, ' ').humanize + .panel-body + .code_highlight_opts + - color_schemes.each do |color_scheme_id, color_scheme| + = label_tag do + .prev + = image_tag "#{color_scheme}-scheme-preview.png" + = f.radio_button :color_scheme_id, color_scheme_id + = color_scheme.gsub(/[-_]+/, ' ').humanize -- cgit v1.2.1 From 9e50f28ee9b5062c2b1822da95e76c86b44efafa Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 28 May 2015 15:32:28 +0200 Subject: Fix profile tests after header rename Signed-off-by: Dmitriy Zaporozhets --- features/steps/profile/notifications.rb | 2 +- features/steps/profile/profile.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/features/steps/profile/notifications.rb b/features/steps/profile/notifications.rb index 13e93618eb7..b6e03b549af 100644 --- a/features/steps/profile/notifications.rb +++ b/features/steps/profile/notifications.rb @@ -7,6 +7,6 @@ class Spinach::Features::ProfileNotifications < Spinach::FeatureSteps end step 'I should see global notifications settings' do - page.should have_content "Notifications Settings" + page.should have_content "Notifications" end end diff --git a/features/steps/profile/profile.rb b/features/steps/profile/profile.rb index 791982d16c3..b8f79f70ca4 100644 --- a/features/steps/profile/profile.rb +++ b/features/steps/profile/profile.rb @@ -3,7 +3,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps include SharedPaths step 'I should see my profile info' do - page.should have_content "Profile Settings" + page.should have_content "This information will appear on your profile" end step 'I change my profile info' do -- cgit v1.2.1