-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Search: inline editing and ordering (#3766)
* Query Field: Separates query field from the pagination part Separates the query search field from the pagination part and adds filters and sorting options in UI * Query Field: Adds sorting feature from the query field dropdown * Refactors code for sorting and filtering * Autosort and auto filter queries on selecting dropdown * Adds selenium tests and more sort options * Adds fixes for some accessibility issues related to input * Refactor codes to make more readable * Fix selenium tests - add delay before screenshots to avoid capturing transitions - revert to original search for other tests * Adds sorting direction feature with suitable icons * Shows dropdown labels and enables autosearch in page with results * Use bootstrap button group for sorting * Use default autosizing width of button for sort dropdown * Fixes button display in RTL * Adds sort_by to SearchForm along with the direction * Uses a separate class to identify autosubmit * Adds query search field in zen pages * Adds check to see if the current page has a sort field and a sort value set Issue #3308, #3710 Co-authored-by: Michal Čihař <[email protected]>
- Loading branch information
Showing
18 changed files
with
347 additions
and
85 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{% load i18n %} | ||
{% load translations %} | ||
{% load icons %} | ||
{% load crispy_forms_field %} | ||
<div class="row"> | ||
<div class="col-sm-9"> | ||
<div class="form-group"> | ||
<div class="search-group query-field" role="group" > | ||
<div class="input-group"> | ||
<div class="input-group-btn"> | ||
<button type="button" id="query-dropdown" class="btn btn-default dropdown-toggle search-field" data-field="" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | ||
{% if filter_name and filter_name != search_query.strip %} | ||
<span class="search-label">{{ filter_name }}</span> | ||
{% else %} | ||
<span class="search-label">{% trans "Custom Search" %}</span> | ||
{% endif %} | ||
<span class="caret"></span> | ||
</button> | ||
<ul class="dropdown-menu"> | ||
{% for _, name, query in custom_filter_list %} | ||
<li><a data-field="{{ query }}">{{ name }}</a></li> | ||
{% endfor %} | ||
</ul> | ||
</div><!-- /btn-group --> | ||
{% crispy_field field 'class' 'form-control' 'aria-label' _('Query') %} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="col-sm-3"> | ||
<div class="form-group"> | ||
<div class="btn-group search-group sort-field" role="group"> | ||
<div class="input-group"> | ||
<div class="input-group-btn"> | ||
<button type="button" id="query-sort-dropdown" class="btn btn-default dropdown-toggle search-field" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | ||
{% if sort_name %} | ||
<span class="search-label">{{ sort_name }}</span> | ||
{% else %} | ||
<span class="search-label">{% trans "Sort By" %}</span> | ||
{% endif %} | ||
<span class="caret"></span> | ||
</button> | ||
<input type="hidden" id="id_sort_by" name="sort_by" value="{{ sort_query|default:'-priority,position' }}" aria-label="{% trans "Sort By" %}" /> | ||
<ul class="dropdown-menu"> | ||
<li><a data-sort="-priority,position">{% trans "Position and priority" %}</a></li> | ||
<li><a data-sort="position">{% trans "Position" %}</a></li> | ||
<li><a data-sort="priority">{% trans "Priority" %}</a></li> | ||
<li><a data-sort="num_words">{% trans "Word count" %}</a></li> | ||
<li><a data-sort="context">{% trans "Context" %}</a></li> | ||
</ul> | ||
</div> | ||
<span class="input-group-btn"> | ||
<button type="button" id="query-sort-toggle" class="btn btn-default search-field"> | ||
<span class="search-label asc active"> | ||
{% icon "sort-ascending.svg" %} | ||
</span> | ||
<span class="search-label desc">{% icon "sort-descending.svg" %}</span> | ||
</button> | ||
</span> | ||
</div><!-- /input-group --> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.