Commit 54d95f5897235009f670a8de262333fe528875cf

Authored by Dmitriy Zaporozhets
1 parent e6b5f4ad

Restyle flash message. Not it does not overflow head panel

app/assets/javascripts/main.js.coffee
@@ -54,10 +54,10 @@ $ -> @@ -54,10 +54,10 @@ $ ->
54 $(@).parents('form').submit() 54 $(@).parents('form').submit()
55 55
56 # Flash 56 # Flash
57 - if (flash = $("#flash-container")).length > 0  
58 - flash.click -> $(@).slideUp("slow")  
59 - flash.slideDown "slow"  
60 - setTimeout (-> flash.slideUp("slow")), 3000 57 + if (flash = $(".flash-container")).length > 0
  58 + flash.click -> $(@).fadeOut()
  59 + flash.show()
  60 + setTimeout (-> flash.fadeOut()), 3000
61 61
62 # Disable form buttons while a form is submitting 62 # Disable form buttons while a form is submitting
63 $('body').on 'ajax:complete, ajax:beforeSend, submit', 'form', (e) -> 63 $('body').on 'ajax:complete, ajax:beforeSend, submit', 'form', (e) ->
app/assets/stylesheets/common.scss
@@ -67,27 +67,17 @@ table a code { @@ -67,27 +67,17 @@ table a code {
67 } 67 }
68 68
69 /** FLASH message **/ 69 /** FLASH message **/
70 -#flash-container {  
71 - height: 50px;  
72 - position: fixed;  
73 - z-index: 10001;  
74 - top: 0px;  
75 - width: 100%;  
76 - margin-bottom: 15px;  
77 - overflow: hidden;  
78 - background: white;  
79 - cursor: pointer;  
80 - border-bottom: 1px solid #ccc;  
81 - text-align: center; 70 +.flash-container {
82 display: none; 71 display: none;
  72 + .alert {
  73 + cursor: pointer;
  74 + margin: 0;
  75 + text-align: center;
  76 + border-radius: 0;
83 77
84 - h4 {  
85 - color: #666;  
86 - font-size: 18px;  
87 - line-height: 38px;  
88 - padding-top: 5px;  
89 - margin: 2px;  
90 - font-weight: normal; 78 + span {
  79 + font-size: 14px;
  80 + }
91 } 81 }
92 } 82 }
93 83
app/assets/stylesheets/sections/login.scss
1 /* Login Page */ 1 /* Login Page */
2 body.login-page{ 2 body.login-page{
3 - padding-top: 7%;  
4 - background: #666; 3 + background: #EEE;
  4 + .container .content { padding-top: 5%; }
5 } 5 }
6 6
7 .login-box{ 7 .login-box{
app/views/layouts/_flash.html.haml
1 -- if text = alert || notice  
2 - #flash-container  
3 - %h4= text 1 +.flash-container
  2 + - if alert
  3 + .alert
  4 + %span= alert
  5 +
  6 + - elsif notice
  7 + .alert.alert-info
  8 + %span= notice
app/views/layouts/admin.html.haml
@@ -2,8 +2,8 @@ @@ -2,8 +2,8 @@
2 %html{ lang: "en"} 2 %html{ lang: "en"}
3 = render "layouts/head", title: "Admin area" 3 = render "layouts/head", title: "Admin area"
4 %body{class: "#{app_theme} admin"} 4 %body{class: "#{app_theme} admin"}
5 - = render "layouts/flash"  
6 = render "layouts/head_panel", title: "Admin area" 5 = render "layouts/head_panel", title: "Admin area"
  6 + = render "layouts/flash"
7 .container 7 .container
8 %ul.main_menu 8 %ul.main_menu
9 = nav_link(controller: :dashboard, html_options: {class: 'home'}) do 9 = nav_link(controller: :dashboard, html_options: {class: 'home'}) do
app/views/layouts/application.html.haml
@@ -2,8 +2,8 @@ @@ -2,8 +2,8 @@
2 %html{ lang: "en"} 2 %html{ lang: "en"}
3 = render "layouts/head", title: "Dashboard" 3 = render "layouts/head", title: "Dashboard"
4 %body{class: "#{app_theme} application"} 4 %body{class: "#{app_theme} application"}
5 - = render "layouts/flash"  
6 = render "layouts/head_panel", title: "Dashboard" 5 = render "layouts/head_panel", title: "Dashboard"
  6 + = render "layouts/flash"
7 .container 7 .container
8 %ul.main_menu 8 %ul.main_menu
9 = nav_link(path: 'dashboard#show', html_options: {class: 'home'}) do 9 = nav_link(path: 'dashboard#show', html_options: {class: 'home'}) do
app/views/layouts/devise.html.haml
@@ -3,4 +3,7 @@ @@ -3,4 +3,7 @@
3 = render "layouts/head" 3 = render "layouts/head"
4 %body.ui_basic.login-page 4 %body.ui_basic.login-page
5 = render "layouts/flash" 5 = render "layouts/flash"
6 - .container= yield 6 + .container
  7 + .content
  8 + %center
  9 + = yield
app/views/layouts/errors.html.haml
@@ -2,8 +2,8 @@ @@ -2,8 +2,8 @@
2 %html{ lang: "en"} 2 %html{ lang: "en"}
3 = render "layouts/head", title: "Error" 3 = render "layouts/head", title: "Error"
4 %body{class: "#{app_theme} application"} 4 %body{class: "#{app_theme} application"}
5 - = render "layouts/flash"  
6 = render "layouts/head_panel", title: "" 5 = render "layouts/head_panel", title: ""
  6 + = render "layouts/flash"
7 .container 7 .container
8 .content 8 .content
9 %center.padded.prepend-top-20 9 %center.padded.prepend-top-20
app/views/layouts/group.html.haml
@@ -2,8 +2,8 @@ @@ -2,8 +2,8 @@
2 %html{ lang: "en"} 2 %html{ lang: "en"}
3 = render "layouts/head", title: "#{@group.name}" 3 = render "layouts/head", title: "#{@group.name}"
4 %body{class: "#{app_theme} application"} 4 %body{class: "#{app_theme} application"}
5 - = render "layouts/flash"  
6 = render "layouts/head_panel", title: "group: #{@group.name}" 5 = render "layouts/head_panel", title: "group: #{@group.name}"
  6 + = render "layouts/flash"
7 .container 7 .container
8 %ul.main_menu 8 %ul.main_menu
9 = nav_link(path: 'groups#show', html_options: {class: 'home'}) do 9 = nav_link(path: 'groups#show', html_options: {class: 'home'}) do
app/views/layouts/profile.html.haml
@@ -2,8 +2,8 @@ @@ -2,8 +2,8 @@
2 %html{ lang: "en"} 2 %html{ lang: "en"}
3 = render "layouts/head", title: "Profile" 3 = render "layouts/head", title: "Profile"
4 %body{class: "#{app_theme} profile"} 4 %body{class: "#{app_theme} profile"}
5 - = render "layouts/flash"  
6 = render "layouts/head_panel", title: "Profile" 5 = render "layouts/head_panel", title: "Profile"
  6 + = render "layouts/flash"
7 .container 7 .container
8 %ul.main_menu 8 %ul.main_menu
9 = nav_link(path: 'profiles#show', html_options: {class: 'home'}) do 9 = nav_link(path: 'profiles#show', html_options: {class: 'home'}) do
app/views/layouts/project_resource.html.haml
@@ -2,8 +2,8 @@ @@ -2,8 +2,8 @@
2 %html{ lang: "en"} 2 %html{ lang: "en"}
3 = render "layouts/head", title: @project.name_with_namespace 3 = render "layouts/head", title: @project.name_with_namespace
4 %body{class: "#{app_theme} project"} 4 %body{class: "#{app_theme} project"}
5 - = render "layouts/flash"  
6 = render "layouts/head_panel", title: project_title(@project) 5 = render "layouts/head_panel", title: project_title(@project)
  6 + = render "layouts/flash"
7 - if can?(current_user, :download_code, @project) 7 - if can?(current_user, :download_code, @project)
8 = render 'shared/no_ssh' 8 = render 'shared/no_ssh'
9 9
app/views/layouts/user_team.html.haml
@@ -2,8 +2,8 @@ @@ -2,8 +2,8 @@
2 %html{ lang: "en"} 2 %html{ lang: "en"}
3 = render "layouts/head", title: "#{@team.name}" 3 = render "layouts/head", title: "#{@team.name}"
4 %body{class: "#{app_theme} application"} 4 %body{class: "#{app_theme} application"}
5 - = render "layouts/flash"  
6 = render "layouts/head_panel", title: "team: #{@team.name}" 5 = render "layouts/head_panel", title: "team: #{@team.name}"
  6 + = render "layouts/flash"
7 .container 7 .container
8 %ul.main_menu 8 %ul.main_menu
9 = nav_link(path: 'teams#show', html_options: {class: 'home'}) do 9 = nav_link(path: 'teams#show', html_options: {class: 'home'}) do