Commit 15eaf2de authored by Douwe Maan's avatar Douwe Maan

Merge branch 'backport-to-CE-5023' into 'master'

Backport changes in EE MR 4972: System Header and Footer

See merge request gitlab-org/gitlab-ce!18001
parents 712da68b f8049f4e
...@@ -88,7 +88,6 @@ ...@@ -88,7 +88,6 @@
.right-sidebar { .right-sidebar {
border-left: 1px solid $border-color; border-left: 1px solid $border-color;
height: calc(100% - #{$header-height});
} }
.with-performance-bar .right-sidebar.affix { .with-performance-bar .right-sidebar.affix {
......
...@@ -522,10 +522,6 @@ ...@@ -522,10 +522,6 @@
.with-performance-bar .right-sidebar { .with-performance-bar .right-sidebar {
top: $header-height + $performance-bar-height; top: $header-height + $performance-bar-height;
.issuable-sidebar {
height: calc(100% - #{$performance-bar-height});
}
} }
.sidebar-move-issue-confirmation-button { .sidebar-move-issue-confirmation-button {
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
.ide-view { .ide-view {
display: flex; display: flex;
height: calc(100vh - #{$header-height}); height: calc(100vh - #{$header-height});
margin-top: 40px; margin-top: 0;
border-top: 1px solid $white-dark; border-top: 1px solid $white-dark;
border-bottom: 1px solid $white-dark; border-bottom: 1px solid $white-dark;
...@@ -457,6 +457,8 @@ ...@@ -457,6 +457,8 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
flex: 1; flex: 1;
max-height: 100%;
overflow: auto;
} }
.multi-file-commit-empty-state-container { .multi-file-commit-empty-state-container {
...@@ -467,7 +469,7 @@ ...@@ -467,7 +469,7 @@
.multi-file-commit-panel-header { .multi-file-commit-panel-header {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 12px; margin-bottom: 0;
border-bottom: 1px solid $white-dark; border-bottom: 1px solid $white-dark;
padding: $gl-btn-padding 0; padding: $gl-btn-padding 0;
...@@ -674,8 +676,14 @@ ...@@ -674,8 +676,14 @@
overflow: hidden; overflow: hidden;
&.nav-only { &.nav-only {
padding-top: $header-height;
.with-performance-bar & {
padding-top: $header-height + $performance-bar-height;
}
.flash-container { .flash-container {
margin-top: $header-height; margin-top: 0;
margin-bottom: 0; margin-bottom: 0;
} }
...@@ -685,7 +693,7 @@ ...@@ -685,7 +693,7 @@
} }
.content-wrapper { .content-wrapper {
margin-top: $header-height; margin-top: 0;
padding-bottom: 0; padding-bottom: 0;
} }
...@@ -709,11 +717,11 @@ ...@@ -709,11 +717,11 @@
.with-performance-bar .ide.nav-only { .with-performance-bar .ide.nav-only {
.flash-container { .flash-container {
margin-top: #{$header-height + $performance-bar-height}; margin-top: 0;
} }
.content-wrapper { .content-wrapper {
margin-top: #{$header-height + $performance-bar-height}; margin-top: 0;
padding-bottom: 0; padding-bottom: 0;
} }
...@@ -722,10 +730,6 @@ ...@@ -722,10 +730,6 @@
} }
&.flash-shown { &.flash-shown {
.content-wrapper {
margin-top: 0;
}
.ide-view { .ide-view {
height: calc(100vh - #{$header-height + $performance-bar-height + $flash-height}); height: calc(100vh - #{$header-height + $performance-bar-height + $flash-height});
} }
......
This diff is collapsed.
...@@ -50,9 +50,19 @@ class Admin::AppearancesController < Admin::ApplicationController ...@@ -50,9 +50,19 @@ class Admin::AppearancesController < Admin::ApplicationController
# Only allow a trusted parameter "white list" through. # Only allow a trusted parameter "white list" through.
def appearance_params def appearance_params
params.require(:appearance).permit( params.require(:appearance).permit(allowed_appearance_params)
:title, :description, :logo, :logo_cache, :header_logo, :header_logo_cache, end
:new_project_guidelines, :updated_by
) def allowed_appearance_params
%i[
title
description
logo
logo_cache
header_logo
header_logo_cache
new_project_guidelines
updated_by
]
end end
end end
module AppearancesHelper module AppearancesHelper
def brand_title def brand_title
brand_item&.title.presence || 'GitLab Community Edition' current_appearance&.title.presence || 'GitLab Community Edition'
end end
def brand_image def brand_image
image_tag(brand_item.logo) if brand_item&.logo? image_tag(current_appearance.logo) if current_appearance&.logo?
end end
def brand_text def brand_text
markdown_field(brand_item, :description) markdown_field(current_appearance, :description)
end end
def brand_new_project_guidelines def brand_new_project_guidelines
markdown_field(brand_item, :new_project_guidelines) markdown_field(current_appearance, :new_project_guidelines)
end end
def brand_item def current_appearance
@appearance ||= Appearance.current @appearance ||= Appearance.current
end end
def brand_header_logo def brand_header_logo
if brand_item&.header_logo? if current_appearance&.header_logo?
image_tag brand_item.header_logo image_tag current_appearance.header_logo
else else
render 'shared/logo.svg' render 'shared/logo.svg'
end end
...@@ -29,7 +29,7 @@ module AppearancesHelper ...@@ -29,7 +29,7 @@ module AppearancesHelper
# Skip the 'GitLab' type logo when custom brand logo is set # Skip the 'GitLab' type logo when custom brand logo is set
def brand_header_logo_type def brand_header_logo_type
unless brand_item&.header_logo? unless current_appearance&.header_logo?
render 'shared/logo_type.svg' render 'shared/logo_type.svg'
end end
end end
......
...@@ -285,6 +285,10 @@ module ApplicationHelper ...@@ -285,6 +285,10 @@ module ApplicationHelper
class_names class_names
end end
# EE feature: System header and footer, unavailable in CE
def system_message_class
end
# Returns active css class when condition returns true # Returns active css class when condition returns true
# otherwise returns nil. # otherwise returns nil.
# #
......
...@@ -54,9 +54,9 @@ module EmailsHelper ...@@ -54,9 +54,9 @@ module EmailsHelper
end end
def header_logo def header_logo
if brand_item && brand_item.header_logo? if current_appearance&.header_logo?
image_tag( image_tag(
brand_item.header_logo, current_appearance.header_logo,
style: 'height: 50px' style: 'height: 50px'
) )
else else
......
!!! 5 !!! 5
%html.devise-layout-html %html.devise-layout-html{ class: system_message_class }
= render "layouts/head" = render "layouts/head"
%body.ui_indigo.login-page.application.navless{ data: { page: body_data_page } } %body.ui_indigo.login-page.application.navless{ data: { page: body_data_page } }
.page-wrap .page-wrap
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
%h1 %h1
= brand_title = brand_title
= brand_image = brand_image
- if brand_item&.description? - if current_appearance&.description?
= brand_text = brand_text
- else - else
%h3 Open source software to collaborate on code %h3 Open source software to collaborate on code
......
!!! 5 !!! 5
%html{ lang: "en" } %html{ lang: "en", class: system_message_class }
= render "layouts/head" = render "layouts/head"
%body.ui_indigo.login-page.application.navless %body.ui_indigo.login-page.application.navless
= render "layouts/header/empty" = render "layouts/header/empty"
......
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