Skip to content

Commit 9bc8a2e

Browse files
authored
Modify search template buttons (#801)
* Modify search page button colors * Rename Clear Options to Reset and reset URL as well * Add search improvements to CHANGES
1 parent 43e5c8b commit 9bc8a2e

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

CHANGES.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ pywb 2.7.3 changelist
44
(In progress)
55

66
* Catch warcio exceptions when indexing CDX by @oskarhek
7-
oskarhek
87
* Add ui.logo_home_url as config.yaml option
98
* wb-manager: Show error when adding duplicate warc files by @kuechensofa
9+
* Improve search template and add help text by @krakan
1010

1111
pywb 2.7.2 changelist
1212
~~~~~~~~~~~~~~~~~~~~~

pywb/static/search.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ var elemIds = {
2525
form: 'search-form',
2626
resultsNewWindow: 'open-results-new-window',
2727
advancedOptions: 'advanced-options',
28-
clearOptions: 'clear-options',
28+
resetSearchForm: 'reset-search-form',
2929
};
3030

31-
function clearOptions(event) {
31+
function resetSearchForm(event) {
3232
for (const field of [
33+
elemIds.url,
3334
elemIds.match,
3435
elemIds.dateTime.from,
3536
elemIds.dateTime.fromTime,
@@ -206,7 +207,7 @@ $(document).ready(function() {
206207
elemIds.dateTime.to,
207208
document.getElementById(elemIds.dateTime.toBad)
208209
);
209-
document.getElementById(elemIds.clearOptions).onclick = clearOptions;
210+
document.getElementById(elemIds.resetSearchForm).onclick = resetSearchForm;
210211
document.getElementById(elemIds.filtering.add).onclick = addFilter;
211212
document.getElementById(elemIds.filtering.clear).onclick = clearFilters;
212213
var searchURLInput = document.getElementById(elemIds.url);

pywb/templates/search.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,16 @@ <h4 class="display-4">
5858
</div>
5959
</div>
6060
<div class="col-7">
61-
<button type="submit" id="search-button" class="btn btn-outline-primary float-right" role="button" aria-label="{{ _('Search') }}">
61+
<button type="submit" id="search-button" class="btn btn-primary float-right" role="button" aria-label="{{ _('Search') }}">
6262
{% trans %}Search{% endtrans %}
6363
</button>
64-
<button class="btn btn-outline-info float-right mr-3" type="button" role="button"
64+
<button class="btn btn-outline-secondary float-right mr-3" type="button" role="button"
6565
data-toggle="collapse" data-target="#advancedOptions" id="advanced-options"
6666
aria-expanded="false" aria-controls="advancedOptions" aria-label="{{ _('Search Options') }}">
6767
{{ _('Search Options') }}
6868
</button>
69-
<button id="clear-options" class="btn btn-outline-warning float-right mr-3" type="button" role="button" aria-label="{{ _('Reset Options') }}">
70-
{{ _('Reset Options') }}
69+
<button id="reset-search-form" class="btn btn-outline-danger float-right mr-3" type="button" role="button" aria-label="{{ _('Reset Options') }}">
70+
{{ _('Reset') }}
7171
</button>
7272
</div>
7373
</div>
@@ -153,7 +153,7 @@ <h4 class="display-4">
153153
<ul id="filter-list" class="filter-list">
154154
<li id="filtering-nothing">{% trans %}No Filter{% endtrans %}</li>
155155
</ul>
156-
<button id="clear-filters" class="btn btn-outline-warning float-right mr-2" type="button">
156+
<button id="clear-filters" class="btn btn-outline-danger float-right mr-2" type="button">
157157
{% trans %}Clear Filters{% endtrans %}
158158
</button>
159159
</div>

0 commit comments

Comments
 (0)