diff options
Diffstat (limited to 'app/views/profiles/preferences')
-rw-r--r-- | app/views/profiles/preferences/show.html.haml | 21 | ||||
-rw-r--r-- | app/views/profiles/preferences/update.js.erb | 20 |
2 files changed, 9 insertions, 32 deletions
diff --git a/app/views/profiles/preferences/show.html.haml b/app/views/profiles/preferences/show.html.haml index aeecb0c0d72..cd76a67b692 100644 --- a/app/views/profiles/preferences/show.html.haml +++ b/app/views/profiles/preferences/show.html.haml @@ -1,14 +1,15 @@ - page_title _('Preferences') - @content_class = "limit-container-width" unless fluid_layout -- user_fields = { gitpod_enabled: @user.gitpod_enabled, sourcegraph_enabled: @user.sourcegraph_enabled } - user_theme_id = Gitlab::Themes.for_user(@user).id -- data_attributes = { integration_views: integration_views.to_json, user_fields: user_fields.to_json } +- user_fields = { theme: user_theme_id, gitpod_enabled: @user.gitpod_enabled, sourcegraph_enabled: @user.sourcegraph_enabled }.to_json +- @themes = Gitlab::Themes::THEMES.to_json +- data_attributes = { themes: @themes, integration_views: integration_views.to_json, user_fields: user_fields, body_classes: Gitlab::Themes.body_classes, profile_preferences_path: profile_preferences_path } - Gitlab::Themes.each do |theme| = stylesheet_link_tag "themes/#{theme.css_filename}" if theme.css_filename -= form_for @user, url: profile_preferences_path, remote: true, method: :put do |f| - .row.gl-mt-3.js-preferences-form += form_for @user, url: profile_preferences_path, remote: true, method: :put, html: { id: "profile-preferences-form" } do |f| + .row.gl-mt-3.js-preferences-form.js-search-settings-section .col-lg-4.application-theme#navigation-theme %h4.gl-mt-0 = s_('Preferences|Navigation theme') @@ -25,6 +26,7 @@ .col-sm-12 %hr + .row.js-preferences-form.js-search-settings-section .col-lg-4.profile-settings-sidebar#syntax-highlighting-theme %h4.gl-mt-0 = s_('Preferences|Syntax highlighting theme') @@ -42,6 +44,7 @@ .col-sm-12 %hr + .row.js-preferences-form.js-search-settings-section .col-lg-4.profile-settings-sidebar#behavior %h4.gl-mt-0 = s_('Preferences|Behavior') @@ -97,7 +100,7 @@ .col-sm-12 %hr - + .row.js-preferences-form.js-search-settings-section .col-lg-4.profile-settings-sidebar#localization %h4.gl-mt-0 = _('Localization') @@ -141,10 +144,4 @@ .form-text.text-muted = s_('Preferences|For example: 30 mins ago.') - #js-profile-preferences-app{ data: data_attributes, user_fields: user_fields.to_json } - - .row.gl-mt-3.js-preferences-form - .col-lg-4.profile-settings-sidebar - .col-lg-8 - .form-group - = f.submit _('Save changes'), class: 'gl-button btn btn-success' + #js-profile-preferences-app{ data: data_attributes } diff --git a/app/views/profiles/preferences/update.js.erb b/app/views/profiles/preferences/update.js.erb deleted file mode 100644 index 241262880c1..00000000000 --- a/app/views/profiles/preferences/update.js.erb +++ /dev/null @@ -1,20 +0,0 @@ -// Remove body class for any previous theme, re-add current one -$('body').removeClass('<%= Gitlab::Themes.body_classes %>') -$('body').addClass('<%= user_application_theme %>') - -// Toggle container-fluid class -if ('<%= current_user.layout %>' === 'fluid') { - $('.content-wrapper .container-fluid').removeClass('container-limited') -} else { - $('.content-wrapper .container-fluid').addClass('container-limited') -} - -// Re-enable the "Save" button -$('input[type=submit]').enable() - -// Show flash messages -<% if flash.notice %> - new Flash({ message: '<%= flash.discard(:notice) %>', type: 'notice'}) -<% elsif flash.alert %> - new Flash({ message: '<%= flash.discard(:alert) %>', type: 'alert'}) -<% end %> |