Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-06-06 01:01:45 +0300
committerRobert Speicher <rspeicher@gmail.com>2015-06-14 00:58:17 +0300
commit0e21436aaf9ea2ed988c3e515e0db73df70534c4 (patch)
treed01d9374d58e6eebfc16739c10213fb5df1dc260 /app/views/profiles/preferences
parent5f20574db5c7b91d54e829010c1fda093ea8a25e (diff)
Simplify the javascript behavior for Preference updating
Diffstat (limited to 'app/views/profiles/preferences')
-rw-r--r--app/views/profiles/preferences/show.html.haml14
-rw-r--r--app/views/profiles/preferences/update.js.erb1
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')