From 2918cc92f3e8f45fa701e925d017e25d566be883 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Sat, 14 Jul 2018 15:09:33 +0530 Subject: [PATCH] search: Duplicate HTML template content for search area. This is preparation for being able to work on the search pills feature without making any user-facing changes until we're ready to enable it. --- templates/zerver/app/navbar.html | 18 +++++++++++++++++- tools/check-templates | 7 +++++++ zerver/views/home.py | 1 + 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/templates/zerver/app/navbar.html b/templates/zerver/app/navbar.html index c08ebd0d5e..2bbce68007 100644 --- a/templates/zerver/app/navbar.html +++ b/templates/zerver/app/navbar.html @@ -44,6 +44,7 @@ 0 + {% if search_pills_enabled %} - {# /searchbox #} + + {% else %} + + {% endif %}
diff --git a/tools/check-templates b/tools/check-templates index 273b5369e1..78d127386b 100755 --- a/tools/check-templates +++ b/tools/check-templates @@ -66,6 +66,13 @@ def check_html_templates(templates, all_dups): 'send_confirm', 'register', 'footer', + # Temporary while we have searchbox forked + 'search_exit', + 'search_query', + 'tab_bar', + 'search_arrows', + 'searchbox_form', + 'searchbox', ] bad_ids_dict = {ids: fns for ids, fns in template_id_dict.items() if (ids not in IGNORE_IDS) and len(fns) > 1} diff --git a/zerver/views/home.py b/zerver/views/home.py index 02f11b7e4f..7acd1e16cb 100644 --- a/zerver/views/home.py +++ b/zerver/views/home.py @@ -265,6 +265,7 @@ def home_real(request: HttpRequest) -> HttpResponse: 'show_debug': settings.DEBUG and ('show_debug' in request.GET), 'pipeline': settings.PIPELINE_ENABLED, + 'search_pills_enabled': settings.SEARCH_PILLS_ENABLED, 'show_invites': show_invites, 'is_admin': user_profile.is_realm_admin, 'is_guest': user_profile.is_guest,