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.
This commit is contained in:
Tim Abbott 2018-07-14 15:09:33 +05:30
parent 8dca8f1087
commit 2918cc92f3
3 changed files with 25 additions and 1 deletions

View File

@ -44,6 +44,7 @@
<span id="streamlist-toggle-unreadcount">0</span> <span id="streamlist-toggle-unreadcount">0</span>
</a> </a>
</div> </div>
{% if search_pills_enabled %}
<div id="searchbox" class="searchbox-rightmargin"> <div id="searchbox" class="searchbox-rightmargin">
<div id="tab_bar" class="notdisplayed"> <div id="tab_bar" class="notdisplayed">
</div> </div>
@ -56,7 +57,22 @@
<a class="search_icon" href="#search-operators" data-overlay-trigger="search-operators" title="{{ _('Search help') }}"><i class="fa fa-search" aria-hidden="true"></i></a> <a class="search_icon" href="#search-operators" data-overlay-trigger="search-operators" title="{{ _('Search help') }}"><i class="fa fa-search" aria-hidden="true"></i></a>
</div> </div>
</form> </form>
</div>{# /searchbox #} </div>
{% else %}
<div id="searchbox" class="searchbox-rightmargin">
<div id="tab_bar" class="notdisplayed">
</div>
<form id="searchbox_form" class="form-search navbar-search">
<div id="search_arrows" class="input-append">
<input class="search-query input-block-level" id="search_query" type="text" placeholder="{{ _('Search') }}"
autocomplete="off" aria-label="{{ _('Search') }}" title="{{ _('Search') }} (/)"/>
{# Start the button off disabled since there is no active search #}
<button class="btn search_button" type="button" id="search_exit" disabled="disabled" aria-label="{{ _('Exit search') }}"><i class="fa fa-remove" aria-hidden="true"></i></button>
<a class="search_icon" href="#search-operators" data-overlay-trigger="search-operators" title="{{ _('Search help') }}"><i class="fa fa-search" aria-hidden="true"></i></a>
</div>
</form>
</div>
{% endif %}
</div> </div>
</div> </div>
<div class="column-right"> <div class="column-right">

View File

@ -66,6 +66,13 @@ def check_html_templates(templates, all_dups):
'send_confirm', 'send_confirm',
'register', 'register',
'footer', '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() bad_ids_dict = {ids: fns for ids, fns in template_id_dict.items()
if (ids not in IGNORE_IDS) and len(fns) > 1} if (ids not in IGNORE_IDS) and len(fns) > 1}

View File

@ -265,6 +265,7 @@ def home_real(request: HttpRequest) -> HttpResponse:
'show_debug': 'show_debug':
settings.DEBUG and ('show_debug' in request.GET), settings.DEBUG and ('show_debug' in request.GET),
'pipeline': settings.PIPELINE_ENABLED, 'pipeline': settings.PIPELINE_ENABLED,
'search_pills_enabled': settings.SEARCH_PILLS_ENABLED,
'show_invites': show_invites, 'show_invites': show_invites,
'is_admin': user_profile.is_realm_admin, 'is_admin': user_profile.is_realm_admin,
'is_guest': user_profile.is_guest, 'is_guest': user_profile.is_guest,