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
a2a7c809
Commit
a2a7c809
authored
Aug 27, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use flash message for notification across app
parent
df9550c7
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
19 additions
and
36 deletions
+19
-36
app/assets/javascripts/flash.js.coffee
app/assets/javascripts/flash.js.coffee
+15
-0
app/assets/javascripts/profile.js.coffee
app/assets/javascripts/profile.js.coffee
+2
-6
app/assets/stylesheets/sections/profile.scss
app/assets/stylesheets/sections/profile.scss
+0
-6
app/assets/stylesheets/sections/themes.scss
app/assets/stylesheets/sections/themes.scss
+0
-7
app/views/profiles/design.html.haml
app/views/profiles/design.html.haml
+0
-6
app/views/profiles/notifications/show.html.haml
app/views/profiles/notifications/show.html.haml
+0
-9
app/views/profiles/notifications/update.js.haml
app/views/profiles/notifications/update.js.haml
+2
-2
No files found.
app/assets/javascripts/flash.js.coffee
0 → 100644
View file @
a2a7c809
class
Flash
constructor
:
(
message
,
type
)
->
flash
=
$
(
".flash-container"
)
flash
.
html
(
""
)
$
(
'<div/>'
,
class
:
"flash-
#{
type
}
"
,
text
:
message
).
appendTo
(
".flash-container"
)
flash
.
click
->
$
(
@
).
fadeOut
()
flash
.
show
()
setTimeout
(
->
flash
.
fadeOut
()),
5000
@
Flash
=
Flash
app/assets/javascripts/profile.js.coffee
View file @
a2a7c809
$
->
$
->
$
(
'.edit_user .application-theme input, .edit_user .code-preview-theme input'
).
click
->
$
(
'.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
# Submit the form
$
(
'.edit_user'
).
submit
()
$
(
'.edit_user'
).
submit
()
# Go up the hierarchy and show the corresponding submission feedback element
new
Flash
(
"Appearance settings saved"
,
"notice"
)
$
(
@
).
closest
(
'fieldset'
).
find
(
'.update-feedback'
).
show
(
'highlight'
,
{
color
:
'#DFF0D8'
},
500
)
$
(
'.update-username form'
).
on
'ajax:before'
,
->
$
(
'.update-username form'
).
on
'ajax:before'
,
->
$
(
'.loading-gif'
).
show
()
$
(
'.loading-gif'
).
show
()
...
@@ -17,6 +13,6 @@ $ ->
...
@@ -17,6 +13,6 @@ $ ->
$
(
'.update-username form'
).
on
'ajax:complete'
,
->
$
(
'.update-username form'
).
on
'ajax:complete'
,
->
$
(
this
).
find
(
'.btn-save'
).
enableButton
()
$
(
this
).
find
(
'.btn-save'
).
enableButton
()
$
(
this
).
find
(
'.loading-gif'
).
hide
()
$
(
this
).
find
(
'.loading-gif'
).
hide
()
$
(
'.update-notifications'
).
on
'ajax:complete'
,
->
$
(
'.update-notifications'
).
on
'ajax:complete'
,
->
$
(
this
).
find
(
'.btn-save'
).
enableButton
()
$
(
this
).
find
(
'.btn-save'
).
enableButton
()
app/assets/stylesheets/sections/profile.scss
View file @
a2a7c809
.save-status-fixed
{
position
:
fixed
;
left
:
20px
;
bottom
:
50px
;
}
.update-notifications
{
.update-notifications
{
margin-bottom
:
0
;
margin-bottom
:
0
;
label
{
label
{
...
...
app/assets/stylesheets/sections/themes.scss
View file @
a2a7c809
.application-theme
,
.code-preview-theme
{
.update-feedback
{
color
:
#468847
;
float
:
right
;
}
}
.themes_opts
{
.themes_opts
{
padding-left
:
20px
;
padding-left
:
20px
;
...
...
app/views/profiles/design.html.haml
View file @
a2a7c809
...
@@ -8,9 +8,6 @@
...
@@ -8,9 +8,6 @@
%fieldset
.application-theme
%fieldset
.application-theme
%legend
%legend
Application theme
Application theme
.update-feedback.hide
%i
.icon-ok
Saved
.themes_opts
.themes_opts
=
label_tag
do
=
label_tag
do
.prev.default
.prev.default
...
@@ -42,9 +39,6 @@
...
@@ -42,9 +39,6 @@
%fieldset
.code-preview-theme
%fieldset
.code-preview-theme
%legend
%legend
Code preview theme
Code preview theme
.update-feedback.hide
%i
.icon-ok
Saved
.code_highlight_opts
.code_highlight_opts
-
color_schemes
.
each
do
|
color_scheme_id
,
color_scheme
|
-
color_schemes
.
each
do
|
color_scheme_id
,
color_scheme
|
=
label_tag
do
=
label_tag
do
...
...
app/views/profiles/notifications/show.html.haml
View file @
a2a7c809
...
@@ -56,12 +56,3 @@
...
@@ -56,12 +56,3 @@
-
@users_projects
.
each
do
|
users_project
|
-
@users_projects
.
each
do
|
users_project
|
-
notification
=
Notification
.
new
(
users_project
)
-
notification
=
Notification
.
new
(
users_project
)
=
render
'settings'
,
type:
'project'
,
membership:
users_project
,
notification:
notification
=
render
'settings'
,
type:
'project'
,
membership:
users_project
,
notification:
notification
.save-status-fixed
%span
.update-success.cgreen.hide
%i
.icon-ok
Saved
%span
.update-failed.cred.hide
%i
.icon-remove
Failed
app/views/profiles/notifications/update.js.haml
View file @
a2a7c809
-
if
@saved
-
if
@saved
:plain
:plain
$('.save-status-fixed .update-success').showAndHide();
new Flash("Notification settings saved", "notice")
-
else
-
else
:plain
:plain
$('.save-status-fixed .update-failed').showAndHide();
new Flash("Failed to save new settings", "alert")
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