diff --git a/.gitignore b/.gitignore index d22760e778069498ed0e86a4bccbcb06f870a28a..e678713dfc67d050369d1254c667f0e07cc3b6d2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,25 +1,26 @@ +*.swp +.DS_Store .bundle +.chef +.directory +.idea +.rbenv-version .rbx/ -db/*.sqlite3 -db/*.sqlite3-journal -log/*.log -tmp/ -.sass-cache/ -coverage/* -backups/* -*.swp -public/uploads/ .rvmrc -.rbenv-version -.directory -nohup.out -Vagrantfile +.sass-cache/ .vagrant -config/gitlab.yml +Vagrantfile +app/assets/stylesheets/overrides.scss +backups/* config/database.yml +config/gitlab.yml config/initializers/omniauth.rb config/unicorn.rb +coverage/* +db/*.sqlite3 +db/*.sqlite3-journal db/data.yml -.idea -.DS_Store -.chef +log/*.log +nohup.out +public/uploads/ +tmp/ diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 424ba71f7cbe3cb29975975cce5ddd3eba754298..88ee5678a40fe04f6ead6c017d39e1115e9da41a 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -6,6 +6,6 @@ *= require jquery.ui.aristo *= require jquery.atwho *= require chosen - *= require_self *= require main + *= require overrides */ diff --git a/app/assets/stylesheets/overrides.scss b/app/assets/stylesheets/overrides.scss new file mode 100644 index 0000000000000000000000000000000000000000..fc472d83d904b4ba4610beab5eeb34de886d0bb4 --- /dev/null +++ b/app/assets/stylesheets/overrides.scss @@ -0,0 +1,11 @@ +// Place here any custom CSS overrides you want to make. +// +// For example, to customize the logo across all themes: +// +// .ui_basic, .ui_mars, .ui_modern { +// .app_logo { +// h1 { +// background: url('http://assets.example.com/images/logo.png') no-repeat 0px -3px; +// } +// } +// } diff --git a/app/assets/stylesheets/sections/header.scss b/app/assets/stylesheets/sections/header.scss index 8328a5ab9a7f0f254eec4a16c093ae7600bb59d9..a280a91012e78ac71c74c8bd005fed625f663c1e 100644 --- a/app/assets/stylesheets/sections/header.scss +++ b/app/assets/stylesheets/sections/header.scss @@ -22,7 +22,6 @@ header { * */ .app_logo { - width:200px; float:left; position:relative; top:-5px; @@ -31,7 +30,7 @@ header { h1 { padding-top: 5px; - width:90px; + width:auto; background: url('logo_dark.png') no-repeat 0px -3px; float:left; margin-left:5px; @@ -43,19 +42,26 @@ header { padding-left:50px; height:40px; font-family: 'Korolev', sans-serif; + text-transform: uppercase; } } - .separator { - margin-left:20px; - float: left; - height: 60px; - width: 1px; - background: white; + } + + // Spacing between logo and header title + .separator { + float: left; + line-height: 60px; + margin: -15px 15px 0 15px; + + // Visible "Bar" inside the separator + .vertical-bar { border-left: 1px solid #DDD; - margin-top: -10px; + border-right: 1px solid #FFF; + height: 60px; } } + .container { .top_panel_content { margin:auto; diff --git a/app/assets/stylesheets/themes/ui_mars.scss b/app/assets/stylesheets/themes/ui_mars.scss index c630f38894538091b56e7ae1b9fb3ff4860782fa..6423dfc19f3a84302df98255334467236e185323 100644 --- a/app/assets/stylesheets/themes/ui_mars.scss +++ b/app/assets/stylesheets/themes/ui_mars.scss @@ -64,6 +64,7 @@ .search-input::-webkit-input-placeholder { color: #666; } + .app_logo { a { h1 { @@ -72,11 +73,14 @@ text-shadow: 0 1px 1px #111; } } - .separator { - display:none; - } + } + .separator { + .vertical-bar { + border: none; + } } + .project_name { color:#fff; text-shadow: 0 1px 1px #111; diff --git a/app/assets/stylesheets/themes/ui_modern.scss b/app/assets/stylesheets/themes/ui_modern.scss index 1f0d795562ba1185bf9cd57bb0217c658f22ee70..d20f5771c1307c401c3f54e2fa8480446afcc44b 100644 --- a/app/assets/stylesheets/themes/ui_modern.scss +++ b/app/assets/stylesheets/themes/ui_modern.scss @@ -37,7 +37,6 @@ * */ .app_logo { - width:160px; a { h1 { background: none; @@ -47,13 +46,16 @@ padding-left: 0; } } - .separator { - width: 1px; - height: 40px; - margin: 0 10px; - overflow: hidden; - background: #222; + } + + .separator { + line-height: 40px; + margin-top: -5px; + + .vertical-bar { border-left: 1px solid #333; + border-right: 1px solid #222; + height: 40px; } } diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 911b46c9a305969f587630961c1033b67f88feb7..6aef49aa6abed9b2d7d107bd0953cfd027de5078 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -30,6 +30,32 @@ module ApplicationHelper args.any? { |v| v.to_s.downcase == action_name } end + # Returns an H1 element to be used in the page's logo section + # + # Calls `custom_application_title` if it's defined, allowing customization + def application_title + if defined?(custom_application_title) + custom_application_title + else + content_tag(:h1, "GitLab") + end + end + + # Returns a title to be used in the page's element + # + # Automatically appends a project's name if @project is set. + # + # Calls `custom_page_title` if it's defined, allowing customization + def page_title + if defined?(custom_page_title) + custom_page_title + else + title = "GitLab" + title += " > #{@project.name}" if @project && @project.persisted? + title + end + end + def gravatar_icon(user_email = '', size = 40) if Gitlab.config.disable_gravatar? || user_email.blank? 'no_avatar.png' diff --git a/app/views/dashboard/issues.html.haml b/app/views/dashboard/issues.html.haml index cc488d57e9e9b63d8c1829547997ed7b20707c18..131928d056bbb8bc2ea11a8f4e58a76ba3907418 100644 --- a/app/views/dashboard/issues.html.haml +++ b/app/views/dashboard/issues.html.haml @@ -8,8 +8,8 @@ - if @issues.any? - @issues.group_by(&:project).each do |group| %div.ui-box - - @project = group[0] - %h5= @project.name + - project = group[0] + %h5= project.name %ul.unstyled.issues_table - group[1].each do |issue| = render(partial: 'issues/show', locals: {issue: issue}) diff --git a/app/views/dashboard/merge_requests.html.haml b/app/views/dashboard/merge_requests.html.haml index 23a7e7222d7ccc340e9372723b6684a57881b7ee..030374500fadcd2f30f18c761f59d6fdddf26eb2 100644 --- a/app/views/dashboard/merge_requests.html.haml +++ b/app/views/dashboard/merge_requests.html.haml @@ -7,8 +7,8 @@ - if @merge_requests.any? - @merge_requests.group_by(&:project).each do |group| %ul.unstyled.ui-box - - @project = group[0] - %h5= @project.name + - project = group[0] + %h5= project.name - group[1].each do |merge_request| = render(partial: 'merge_requests/merge_request', locals: {merge_request: merge_request}) %hr diff --git a/app/views/layouts/_head.html.haml b/app/views/layouts/_head.html.haml index 25fe9d806bc356af3599bc431a2fc50050192d38..ff72e3049390006ab64e5905ea775dc13ff35b4f 100644 --- a/app/views/layouts/_head.html.haml +++ b/app/views/layouts/_head.html.haml @@ -1,8 +1,6 @@ %head %meta{charset: "utf-8"} - %title - GitLab - = " > #{@project.name}" if @project && !@project.new_record? + %title= page_title = favicon_link_tag 'favicon.ico' = stylesheet_link_tag "application" = javascript_include_tag "application" diff --git a/app/views/layouts/_head_panel.html.haml b/app/views/layouts/_head_panel.html.haml index f5e423a5abf3c59331cebe0d22cf2384c50abf2e..daba03654b6091c2633979b744dc04e626f92de4 100644 --- a/app/views/layouts/_head_panel.html.haml +++ b/app/views/layouts/_head_panel.html.haml @@ -3,10 +3,9 @@ .container .top_panel_content %div.app_logo - = link_to root_path, class: "home", title: "Home" do - %h1 - GITLAB - %span.separator + = link_to application_title, root_path, class: "home", title: "Home" + %div.separator + %div.vertical-bar %h1.project_name= title .search = form_tag search_path, method: :get do |f| diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index a94d5505a91ea710340c9db66a165d14f44753c6..b890fc7ed5496f5b490ebf2ee18564e3aabe52f3 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -39,6 +39,39 @@ describe ApplicationHelper do end end + describe 'application_title' do + it "returns an H1 element" do + application_title.should match(/<h1>/) + end + + it "returns 'GitLab'" do + application_title.should match(/GitLab/) + end + + it "calls custom_application_title if it's defined" do + def custom_application_title; "Custom Title"; end + + application_title.should == "Custom Title" + end + end + + describe 'page_title' do + it "returns 'GitLab'" do + page_title.should == "GitLab" + end + + it "includes a project's name when @project is set" do + @project = double(name: 'Project Name', persisted?: true) + page_title.should match(/ > Project Name/) + end + + it "calls custom_page_title if it's defined" do + def custom_page_title; "Custom Title"; end + + page_title.should == "Custom Title" + end + end + describe "gravatar_icon" do let(:user_email) { 'user@email.com' }