diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-06-05 18:01:45 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-06-13 17:58:17 -0400 |
commit | 0e21436aaf9ea2ed988c3e515e0db73df70534c4 (patch) | |
tree | d01d9374d58e6eebfc16739c10213fb5df1dc260 /app/views | |
parent | 5f20574db5c7b91d54e829010c1fda093ea8a25e (diff) | |
download | gitlab-ce-0e21436aaf9ea2ed988c3e515e0db73df70534c4.tar.gz |
Simplify the javascript behavior for Preference updating
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/profiles/preferences/show.html.haml | 14 | ||||
-rw-r--r-- | app/views/profiles/preferences/update.js.erb | 1 |
2 files changed, 7 insertions, 8 deletions
diff --git a/app/views/profiles/preferences/show.html.haml b/app/views/profiles/preferences/show.html.haml index a30f302dea7..bfce0d8ef96 100644 --- a/app/views/profiles/preferences/show.html.haml +++ b/app/views/profiles/preferences/show.html.haml @@ -5,7 +5,7 @@ Appearance settings will be saved to your profile and made available across all devices. %hr -= form_for @user, url: profile_preferences_path, remote: true, method: :put do |f| += form_for @user, url: profile_preferences_path, remote: true, method: :put, html: {class: 'js-preferences-form'} do |f| .panel.panel-default.application-theme .panel-heading Application theme @@ -20,10 +20,8 @@ .panel-heading Code preview theme .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 + - color_schemes.each do |color_scheme_id, color_scheme| + = label_tag do + .preview= image_tag "#{color_scheme}-scheme-preview.png" + = f.radio_button :color_scheme_id, color_scheme_id + = color_scheme.tr('-_', ' ').titleize diff --git a/app/views/profiles/preferences/update.js.erb b/app/views/profiles/preferences/update.js.erb index cd2c5b632e0..e952d8f47ea 100644 --- a/app/views/profiles/preferences/update.js.erb +++ b/app/views/profiles/preferences/update.js.erb @@ -1,3 +1,4 @@ // Remove body class for any previous theme, re-add current one $('body').removeClass('<%= Gitlab::Themes.body_classes %>') $('body').addClass('<%= user_application_theme %>') +new Flash('<%= flash.discard(:notice) %>', 'notice') |