Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
7392d28d
Commit
7392d28d
authored
Nov 21, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2030 from tsigo/theme_feedback
Improve user feedback on the Profile > Design page
parents
d7ce2c5c
30a66c06
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
73 additions
and
12 deletions
+73
-12
app/assets/javascripts/profile.js.coffee
app/assets/javascripts/profile.js.coffee
+10
-0
app/assets/stylesheets/sections/themes.scss
app/assets/stylesheets/sections/themes.scss
+7
-0
app/controllers/profile_controller.rb
app/controllers/profile_controller.rb
+5
-1
app/views/profile/design.html.haml
app/views/profile/design.html.haml
+12
-11
app/views/profile/update.js.erb
app/views/profile/update.js.erb
+9
-0
features/profile/profile.feature
features/profile/profile.feature
+13
-0
features/steps/profile/profile.rb
features/steps/profile/profile.rb
+17
-0
No files found.
app/assets/javascripts/profile.js.coffee
0 → 100644
View file @
7392d28d
$
->
$
(
'.edit_user .application-theme input, .edit_user .code-preview-theme input'
).
click
->
# Hide any previous submission feedback
$
(
'.edit_user .update-feedback'
).
hide
()
# Submit the form
$
(
'.edit_user'
).
submit
()
# Go up the hierarchy and show the corresponding submission feedback element
$
(
@
).
closest
(
'fieldset'
).
find
(
'.update-feedback'
).
show
(
'highlight'
,
{
color
:
'#DFF0D8'
},
500
)
app/assets/stylesheets/sections/themes.scss
View file @
7392d28d
.application-theme
,
.code-preview-theme
{
.update-feedback
{
color
:
#468847
;
float
:
right
;
}
}
.themes_opts
{
.themes_opts
{
padding-left
:
20px
;
padding-left
:
20px
;
...
...
app/controllers/profile_controller.rb
View file @
7392d28d
...
@@ -9,7 +9,11 @@ class ProfileController < ApplicationController
...
@@ -9,7 +9,11 @@ class ProfileController < ApplicationController
def
update
def
update
@user
.
update_attributes
(
params
[
:user
])
@user
.
update_attributes
(
params
[
:user
])
redirect_to
:back
respond_to
do
|
format
|
format
.
html
{
redirect_to
:back
}
format
.
js
end
end
end
def
token
def
token
...
...
app/views/profile/design.html.haml
View file @
7392d28d
=
form_for
@user
,
url:
profile_update_path
,
remote:
true
,
method: :put
do
|
f
|
=
form_for
@user
,
url:
profile_update_path
,
remote:
true
,
method: :put
do
|
f
|
%fieldset
%fieldset
.application-theme
%legend
Application theme
%legend
Application theme
.update-feedback.hide
%i
.icon-ok
Saved
.themes_opts
.themes_opts
=
label_tag
do
=
label_tag
do
.prev.default
.prev.default
...
@@ -29,8 +33,12 @@
...
@@ -29,8 +33,12 @@
%br
%br
.clearfix
.clearfix
%fieldset
%fieldset
.code-preview-theme
%legend
Code review
%legend
Code preview theme
.update-feedback.hide
%i
.icon-ok
Saved
.code_highlight_opts
.code_highlight_opts
=
label_tag
do
=
label_tag
do
.prev
.prev
...
@@ -42,10 +50,3 @@
...
@@ -42,10 +50,3 @@
=
image_tag
"dark.png"
=
image_tag
"dark.png"
=
f
.
radio_button
:dark_scheme
,
true
=
f
.
radio_button
:dark_scheme
,
true
Dark code preview
Dark code preview
:javascript
$
(
function
(){
$
(
"
.edit_user input
"
).
bind
(
"
click
"
,
function
()
{
$
(
"
.edit_user
"
).
submit
();
});
})
app/views/profile/update.js.erb
0 → 100644
View file @
7392d28d
// Remove body class for any previous theme, re-add current one
$('body').removeClass('ui_basic ui_mars ui_modern ui_gray ui_color')
$('body').addClass('
<%=
app_theme
%>
')
// Re-render the header to reflect the new theme
$('header').html('
<%=
escape_javascript
(
render
(
"layouts/head_panel"
,
title:
"Profile"
))
%>
')
// Re-initialize header tooltips
$('.has_bottom_tooltip').tooltip({placement: 'bottom'})
features/profile/profile.feature
View file @
7392d28d
...
@@ -30,3 +30,16 @@ Feature: Profile
...
@@ -30,3 +30,16 @@ Feature: Profile
Given
I have activity
Given
I have activity
When
I visit profile history page
When
I visit profile history page
Then
I should see my activity
Then
I should see my activity
@javascript
Scenario
:
I
change my application theme
Given
I visit profile design page
When
I change my application theme
Then
I should see the theme change immediately
And
I should receive feedback that the changes were saved
@javascript
Scenario
:
I
change my code preview theme
Given
I visit profile design page
When
I change my code preview theme
Then
I should receive feedback that the changes were saved
features/steps/profile/profile.rb
View file @
7392d28d
...
@@ -59,4 +59,21 @@ class Profile < Spinach::FeatureSteps
...
@@ -59,4 +59,21 @@ class Profile < Spinach::FeatureSteps
Then
'I should see my activity'
do
Then
'I should see my activity'
do
page
.
should
have_content
"
#{
current_user
.
name
}
closed issue"
page
.
should
have_content
"
#{
current_user
.
name
}
closed issue"
end
end
When
"I change my application theme"
do
choose
"Violet"
end
When
"I change my code preview theme"
do
choose
"Dark code preview"
end
Then
"I should see the theme change immediately"
do
page
.
should
have_selector
(
'body.ui_color'
)
page
.
should_not
have_selector
(
'body.ui_basic'
)
end
Then
"I should receive feedback that the changes were saved"
do
page
.
should
have_content
(
"Saved"
)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment