From 16123c9a58b9929161d7cd14d134e2fd3fa0e402 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Sat, 2 Mar 2019 09:23:57 -0800 Subject: [PATCH] realm_logo: Fix synchronization of realm night logo. The night logo synchronization on the settings page was perfect, but the actual display logic had a few problems: * We were including the realm_logo in context_processors, even though it is only used in home.py. * We used different variable names for the templating in navbar.html than anywhere else the codebase. * The behavior that the night logo would default to the day logo if only one was uploaded was not correctly implemented for the navbar position, either in the synchronization for updates code or the logic in the navbar.html templates. --- static/js/realm_logo.js | 2 +- templates/zerver/app/navbar.html | 2 +- zerver/context_processors.py | 7 ---- zerver/lib/events.py | 13 +++++--- zerver/tests/test_auth_backends.py | 2 -- zerver/tests/test_home.py | 52 +++++++++++++++++++++++++++++- zerver/views/auth.py | 2 -- zerver/views/home.py | 13 +++++++- 8 files changed, 73 insertions(+), 20 deletions(-) diff --git a/static/js/realm_logo.js b/static/js/realm_logo.js index f109c43506..6ee02852e3 100644 --- a/static/js/realm_logo.js +++ b/static/js/realm_logo.js @@ -75,7 +75,7 @@ var realm_logo = (function () { $("#realm-settings-night-logo").attr("src", page_params.realm_night_logo_url); } - if (page_params.night_mode) { + if (page_params.night_mode && page_params.realm_night_logo_source !== 'D') { $("#realm-logo").attr("src", page_params.realm_night_logo_url); } else { $("#realm-logo").attr("src", page_params.realm_logo_url); diff --git a/templates/zerver/app/navbar.html b/templates/zerver/app/navbar.html index 7f11a9da73..0b6ac827c4 100644 --- a/templates/zerver/app/navbar.html +++ b/templates/zerver/app/navbar.html @@ -31,7 +31,7 @@