Commit 20d6f969 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Improve flash messages

* dont fadeout so user can read
* show inside content block so user can notice it
Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent a6b4e371
...@@ -149,7 +149,6 @@ $ -> ...@@ -149,7 +149,6 @@ $ ->
if (flash = $(".flash-container")).length > 0 if (flash = $(".flash-container")).length > 0
flash.click -> $(@).fadeOut() flash.click -> $(@).fadeOut()
flash.show() flash.show()
setTimeout (-> flash.fadeOut()), 5000
# Disable form buttons while a form is submitting # Disable form buttons while a form is submitting
$('body').on 'ajax:complete, ajax:beforeSend, submit', 'form', (e) -> $('body').on 'ajax:complete, ajax:beforeSend, submit', 'form', (e) ->
......
...@@ -10,6 +10,5 @@ class Flash ...@@ -10,6 +10,5 @@ class Flash
flash.click -> $(@).fadeOut() flash.click -> $(@).fadeOut()
flash.show() flash.show()
setTimeout (-> flash.fadeOut()), 5000
@Flash = Flash @Flash = Flash
.flash-container { .flash-container {
display: none;
cursor: pointer; cursor: pointer;
margin: 0; margin: 0;
text-align: center;
color: #fff;
font-size: 14px; font-size: 14px;
position: fixed;
bottom: 0;
width: 100%; width: 100%;
opacity: 0.8;
z-index: 100; z-index: 100;
.flash-notice { .flash-notice {
background: #49C; @extend .alert;
padding: 10px; @extend .alert-info;
text-shadow: 0 1px 1px #178;
} }
.flash-alert { .flash-alert {
background: #C67; @extend .alert;
text-shadow: 0 1px 1px #945; @extend .alert-danger;
padding: 10px;
} }
} }
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
%body{class: "#{app_theme} admin", :'data-page' => body_data_page} %body{class: "#{app_theme} admin", :'data-page' => body_data_page}
= render "layouts/broadcast" = render "layouts/broadcast"
= render "layouts/head_panel", title: "Admin area" = render "layouts/head_panel", title: "Admin area"
= render "layouts/flash"
%nav.main-nav.navbar-collapse.collapse %nav.main-nav.navbar-collapse.collapse
.container= render 'layouts/nav/admin' .container= render 'layouts/nav/admin'
.container .container
.content= yield .content
= render "layouts/flash"
= yield
= yield :embedded_scripts = yield :embedded_scripts
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
%body{class: "#{app_theme} application", :'data-page' => body_data_page } %body{class: "#{app_theme} application", :'data-page' => body_data_page }
= render "layouts/broadcast" = render "layouts/broadcast"
= render "layouts/head_panel", title: "Dashboard" = render "layouts/head_panel", title: "Dashboard"
= render "layouts/flash"
%nav.main-nav.navbar-collapse.collapse %nav.main-nav.navbar-collapse.collapse
.container= render 'layouts/nav/dashboard' .container= render 'layouts/nav/dashboard'
.container .container
.content= yield .content
= render "layouts/flash"
= yield
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
%html{ lang: "en"} %html{ lang: "en"}
= render "layouts/head" = render "layouts/head"
%body.ui_basic.login-page %body.ui_basic.login-page
= render "layouts/flash"
.container .container
.content .content
.login-title .login-title
...@@ -10,6 +9,7 @@ ...@@ -10,6 +9,7 @@
%hr %hr
.container .container
.content .content
= render "layouts/flash"
.row .row
.col-md-7.brand-holder .col-md-7.brand-holder
- if brand_item - if brand_item
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
= render "layouts/head", title: "Error" = render "layouts/head", title: "Error"
%body{class: "#{app_theme} application"} %body{class: "#{app_theme} application"}
= render "layouts/head_panel", title: "" if current_user = render "layouts/head_panel", title: "" if current_user
= render "layouts/flash"
.container.navless-container .container.navless-container
= render "layouts/flash"
.error-page .error-page
= yield = yield
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
%body{class: "#{app_theme} application", :'data-page' => body_data_page} %body{class: "#{app_theme} application", :'data-page' => body_data_page}
= render "layouts/broadcast" = render "layouts/broadcast"
= render "layouts/head_panel", title: "group: #{@group.name}" = render "layouts/head_panel", title: "group: #{@group.name}"
= render "layouts/flash"
%nav.main-nav.navbar-collapse.collapse %nav.main-nav.navbar-collapse.collapse
.container= render 'layouts/nav/group' .container= render 'layouts/nav/group'
.container .container
.content= yield .content
= render "layouts/flash"
= yield
...@@ -4,8 +4,7 @@ ...@@ -4,8 +4,7 @@
%body{class: "#{app_theme} application", :'data-page' => body_data_page} %body{class: "#{app_theme} application", :'data-page' => body_data_page}
= render "layouts/broadcast" = render "layouts/broadcast"
= render "layouts/head_panel", title: @title = render "layouts/head_panel", title: @title
= render "layouts/flash"
.container.navless-container .container.navless-container
.content .content
= render "layouts/flash"
= yield = yield
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
%body{class: "#{app_theme} profile", :'data-page' => body_data_page} %body{class: "#{app_theme} profile", :'data-page' => body_data_page}
= render "layouts/broadcast" = render "layouts/broadcast"
= render "layouts/head_panel", title: "Profile" = render "layouts/head_panel", title: "Profile"
= render "layouts/flash"
%nav.main-nav.navbar-collapse.collapse %nav.main-nav.navbar-collapse.collapse
.container= render 'layouts/nav/profile' .container= render 'layouts/nav/profile'
.container .container
.content= yield .content
= render "layouts/flash"
= yield
...@@ -5,15 +5,13 @@ ...@@ -5,15 +5,13 @@
= render "layouts/broadcast" = render "layouts/broadcast"
= render "layouts/head_panel", title: project_title(@project) = render "layouts/head_panel", title: project_title(@project)
= render "layouts/init_auto_complete" = render "layouts/init_auto_complete"
= render "layouts/flash"
- if can?(current_user, :download_code, @project) - if can?(current_user, :download_code, @project)
= render 'shared/no_ssh' = render 'shared/no_ssh'
%nav.main-nav.navbar-collapse.collapse %nav.main-nav.navbar-collapse.collapse
.container= render 'layouts/nav/project' .container= render 'layouts/nav/project'
.container .container
.content .content
= render "layouts/flash"
.row .row
.col-md-2 .col-md-2
= render "projects/settings_nav" = render "projects/settings_nav"
......
...@@ -5,13 +5,12 @@ ...@@ -5,13 +5,12 @@
= render "layouts/broadcast" = render "layouts/broadcast"
= render "layouts/head_panel", title: project_title(@project) = render "layouts/head_panel", title: project_title(@project)
= render "layouts/init_auto_complete" = render "layouts/init_auto_complete"
= render "layouts/flash"
- if can?(current_user, :download_code, @project) - if can?(current_user, :download_code, @project)
= render 'shared/no_ssh' = render 'shared/no_ssh'
%nav.main-nav.navbar-collapse.collapse %nav.main-nav.navbar-collapse.collapse
.container= render 'layouts/nav/project' .container= render 'layouts/nav/project'
.container .container
.content= yield .content
= render "layouts/flash"
= yield
= yield :embedded_scripts = yield :embedded_scripts
...@@ -4,8 +4,7 @@ ...@@ -4,8 +4,7 @@
%body{class: "#{app_theme} application", :'data-page' => body_data_page} %body{class: "#{app_theme} application", :'data-page' => body_data_page}
= render "layouts/broadcast" = render "layouts/broadcast"
= render "layouts/head_panel", title: "Search" = render "layouts/head_panel", title: "Search"
= render "layouts/flash"
.container.navless-container .container.navless-container
.content .content
= render "layouts/flash"
= yield = yield
!!! 5
%html{ lang: "en"}
= render "layouts/head", title: "#{@team.name}"
%body{class: "#{app_theme} application", :'data-page' => body_data_page}
= render "layouts/broadcast"
= render "layouts/head_panel", title: "team: #{@team.name}"
= render "layouts/flash"
%nav.main-nav.navbar-collapse.collapse
.container= render 'layouts/nav/team'
.container
.content= yield
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment