summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew Blessing <drew@gitlab.com>2017-11-15 15:31:17 -0600
committerDrew Blessing <drew@gitlab.com>2017-11-15 15:35:24 -0600
commit0332356d9275d58c1a3050b54c2a6d653299c6df (patch)
treebcdb2afdebb9cfe9f9800a1b783a90a1674e4f9b
parenta4072db0198896242886d22c644ed91c1016aa8d (diff)
downloadgitlab-ce-0332356d9275d58c1a3050b54c2a6d653299c6df.tar.gz
When a custom header logo is present, don't show GitLab type logo
In the new navigation header, when a user uploads a custom header logo GitLab will still show the 'GitLab' type logo. This is often undesirable as the user may want to upload a logo with their own name present. This change will toggle the GitLab type logo if a custom header logo is present.
-rw-r--r--app/helpers/appearances_helper.rb7
-rw-r--r--app/views/admin/appearances/_form.html.haml2
-rw-r--r--app/views/layouts/header/_default.html.haml2
-rw-r--r--changelogs/unreleased/brand_header_change.yml5
4 files changed, 14 insertions, 2 deletions
diff --git a/app/helpers/appearances_helper.rb b/app/helpers/appearances_helper.rb
index 8ad94d3f723..df590cf47c8 100644
--- a/app/helpers/appearances_helper.rb
+++ b/app/helpers/appearances_helper.rb
@@ -30,4 +30,11 @@ module AppearancesHelper
render 'shared/logo.svg'
end
end
+
+ # Skip the 'GitLab' type logo when custom brand logo is set
+ def brand_header_logo_type
+ unless brand_item && brand_item.header_logo?
+ render 'shared/logo_type.svg'
+ end
+ end
end
diff --git a/app/views/admin/appearances/_form.html.haml b/app/views/admin/appearances/_form.html.haml
index 935787d1a4a..4a2238fe277 100644
--- a/app/views/admin/appearances/_form.html.haml
+++ b/app/views/admin/appearances/_form.html.haml
@@ -43,7 +43,7 @@
= f.hidden_field :header_logo_cache
= f.file_field :header_logo, class: ""
.hint
- Maximum file size is 1MB. Pages are optimized for a 72x72 px header logo
+ Maximum file size is 1MB. Pages are optimized for a 28px tall header logo
.form-actions
= f.submit 'Save', class: 'btn btn-save append-right-10'
diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml
index 1eca412aff9..e2407f6a428 100644
--- a/app/views/layouts/header/_default.html.haml
+++ b/app/views/layouts/header/_default.html.haml
@@ -7,7 +7,7 @@
= link_to root_path, title: 'Dashboard', id: 'logo' do
= brand_header_logo
%span.logo-text.hidden-xs
- = render 'shared/logo_type.svg'
+ = brand_header_logo_type
- if current_user
= render "layouts/nav/dashboard"
diff --git a/changelogs/unreleased/brand_header_change.yml b/changelogs/unreleased/brand_header_change.yml
new file mode 100644
index 00000000000..6ea6e8192a4
--- /dev/null
+++ b/changelogs/unreleased/brand_header_change.yml
@@ -0,0 +1,5 @@
+---
+title: When a custom header logo is present, don't show GitLab type logo
+merge_request:
+author:
+type: changed