From 54d95f5897235009f670a8de262333fe528875cf Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 28 Feb 2013 11:06:52 +0200 Subject: [PATCH] Restyle flash message. Not it does not overflow head panel --- app/assets/javascripts/main.js.coffee | 8 +++--- app/assets/stylesheets/common.scss | 28 +++++++------------- app/assets/stylesheets/sections/login.scss | 4 +-- app/views/layouts/_flash.html.haml | 11 +++++--- app/views/layouts/admin.html.haml | 2 +- app/views/layouts/application.html.haml | 2 +- app/views/layouts/devise.html.haml | 5 +++- app/views/layouts/errors.html.haml | 2 +- app/views/layouts/group.html.haml | 2 +- app/views/layouts/profile.html.haml | 2 +- app/views/layouts/project_resource.html.haml | 2 +- app/views/layouts/user_team.html.haml | 2 +- 12 files changed, 34 insertions(+), 36 deletions(-) diff --git a/app/assets/javascripts/main.js.coffee b/app/assets/javascripts/main.js.coffee index d789f54a..d707657d 100644 --- a/app/assets/javascripts/main.js.coffee +++ b/app/assets/javascripts/main.js.coffee @@ -54,10 +54,10 @@ $ -> $(@).parents('form').submit() # Flash - if (flash = $("#flash-container")).length > 0 - flash.click -> $(@).slideUp("slow") - flash.slideDown "slow" - setTimeout (-> flash.slideUp("slow")), 3000 + if (flash = $(".flash-container")).length > 0 + flash.click -> $(@).fadeOut() + flash.show() + setTimeout (-> flash.fadeOut()), 3000 # Disable form buttons while a form is submitting $('body').on 'ajax:complete, ajax:beforeSend, submit', 'form', (e) -> diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 7ac8c2dd..ead27922 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -67,27 +67,17 @@ table a code { } /** FLASH message **/ -#flash-container { - height: 50px; - position: fixed; - z-index: 10001; - top: 0px; - width: 100%; - margin-bottom: 15px; - overflow: hidden; - background: white; - cursor: pointer; - border-bottom: 1px solid #ccc; - text-align: center; +.flash-container { display: none; + .alert { + cursor: pointer; + margin: 0; + text-align: center; + border-radius: 0; - h4 { - color: #666; - font-size: 18px; - line-height: 38px; - padding-top: 5px; - margin: 2px; - font-weight: normal; + span { + font-size: 14px; + } } } diff --git a/app/assets/stylesheets/sections/login.scss b/app/assets/stylesheets/sections/login.scss index 89b8f1c0..e3fe0b43 100644 --- a/app/assets/stylesheets/sections/login.scss +++ b/app/assets/stylesheets/sections/login.scss @@ -1,7 +1,7 @@ /* Login Page */ body.login-page{ - padding-top: 7%; - background: #666; + background: #EEE; + .container .content { padding-top: 5%; } } .login-box{ diff --git a/app/views/layouts/_flash.html.haml b/app/views/layouts/_flash.html.haml index 9961ce8d..a3bed593 100644 --- a/app/views/layouts/_flash.html.haml +++ b/app/views/layouts/_flash.html.haml @@ -1,3 +1,8 @@ -- if text = alert || notice - #flash-container - %h4= text +.flash-container + - if alert + .alert + %span= alert + + - elsif notice + .alert.alert-info + %span= notice diff --git a/app/views/layouts/admin.html.haml b/app/views/layouts/admin.html.haml index a01886cd..00a08e61 100644 --- a/app/views/layouts/admin.html.haml +++ b/app/views/layouts/admin.html.haml @@ -2,8 +2,8 @@ %html{ lang: "en"} = render "layouts/head", title: "Admin area" %body{class: "#{app_theme} admin"} - = render "layouts/flash" = render "layouts/head_panel", title: "Admin area" + = render "layouts/flash" .container %ul.main_menu = nav_link(controller: :dashboard, html_options: {class: 'home'}) do diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 7ee44238..90c26534 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -2,8 +2,8 @@ %html{ lang: "en"} = render "layouts/head", title: "Dashboard" %body{class: "#{app_theme} application"} - = render "layouts/flash" = render "layouts/head_panel", title: "Dashboard" + = render "layouts/flash" .container %ul.main_menu = nav_link(path: 'dashboard#show', html_options: {class: 'home'}) do diff --git a/app/views/layouts/devise.html.haml b/app/views/layouts/devise.html.haml index 36c6b4c6..e790b22c 100644 --- a/app/views/layouts/devise.html.haml +++ b/app/views/layouts/devise.html.haml @@ -3,4 +3,7 @@ = render "layouts/head" %body.ui_basic.login-page = render "layouts/flash" - .container= yield + .container + .content + %center + = yield diff --git a/app/views/layouts/errors.html.haml b/app/views/layouts/errors.html.haml index 3554d88f..b9395873 100644 --- a/app/views/layouts/errors.html.haml +++ b/app/views/layouts/errors.html.haml @@ -2,8 +2,8 @@ %html{ lang: "en"} = render "layouts/head", title: "Error" %body{class: "#{app_theme} application"} - = render "layouts/flash" = render "layouts/head_panel", title: "" + = render "layouts/flash" .container .content %center.padded.prepend-top-20 diff --git a/app/views/layouts/group.html.haml b/app/views/layouts/group.html.haml index 9057ad50..2c144de4 100644 --- a/app/views/layouts/group.html.haml +++ b/app/views/layouts/group.html.haml @@ -2,8 +2,8 @@ %html{ lang: "en"} = render "layouts/head", title: "#{@group.name}" %body{class: "#{app_theme} application"} - = render "layouts/flash" = render "layouts/head_panel", title: "group: #{@group.name}" + = render "layouts/flash" .container %ul.main_menu = nav_link(path: 'groups#show', html_options: {class: 'home'}) do diff --git a/app/views/layouts/profile.html.haml b/app/views/layouts/profile.html.haml index 57f250c7..611063e8 100644 --- a/app/views/layouts/profile.html.haml +++ b/app/views/layouts/profile.html.haml @@ -2,8 +2,8 @@ %html{ lang: "en"} = render "layouts/head", title: "Profile" %body{class: "#{app_theme} profile"} - = render "layouts/flash" = render "layouts/head_panel", title: "Profile" + = render "layouts/flash" .container %ul.main_menu = nav_link(path: 'profiles#show', html_options: {class: 'home'}) do diff --git a/app/views/layouts/project_resource.html.haml b/app/views/layouts/project_resource.html.haml index 13fb8637..3b689215 100644 --- a/app/views/layouts/project_resource.html.haml +++ b/app/views/layouts/project_resource.html.haml @@ -2,8 +2,8 @@ %html{ lang: "en"} = render "layouts/head", title: @project.name_with_namespace %body{class: "#{app_theme} project"} - = render "layouts/flash" = render "layouts/head_panel", title: project_title(@project) + = render "layouts/flash" - if can?(current_user, :download_code, @project) = render 'shared/no_ssh' diff --git a/app/views/layouts/user_team.html.haml b/app/views/layouts/user_team.html.haml index 19bbc373..e5e08aab 100644 --- a/app/views/layouts/user_team.html.haml +++ b/app/views/layouts/user_team.html.haml @@ -2,8 +2,8 @@ %html{ lang: "en"} = render "layouts/head", title: "#{@team.name}" %body{class: "#{app_theme} application"} - = render "layouts/flash" = render "layouts/head_panel", title: "team: #{@team.name}" + = render "layouts/flash" .container %ul.main_menu = nav_link(path: 'teams#show', html_options: {class: 'home'}) do