Commit f8049f4e authored by André Luís's avatar André Luís Committed by Douwe Maan

Backport changes in EE MR 4972: System Header and Footer

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