Changeset View
Changeset View
Standalone View
Standalone View
swh/web/templates/includes/origin-search-form.html
{% comment %} | {% comment %} | ||||
Copyright (C) 2020-2021 The Software Heritage developers | Copyright (C) 2020-2021 The Software Heritage developers | ||||
See the AUTHORS file at the top-level directory of this distribution | See the AUTHORS file at the top-level directory of this distribution | ||||
License: GNU Affero General Public License version 3, or any later version | License: GNU Affero General Public License version 3, or any later version | ||||
See top-level LICENSE file for more information | See top-level LICENSE file for more information | ||||
{% endcomment %} | {% endcomment %} | ||||
<form class="form-horizontal needs-validation" id="swh-search-origins" novalidate> | <form class="form-horizontal needs-validation" id="swh-search-origins" novalidate> | ||||
<div class="input-group"> | <div class="input-group"> | ||||
<input class="form-control" | <input class="form-control" | ||||
placeholder="Enter a SWHID to resolve or string pattern(s) to search for in origin urls" | placeholder="Enter a SWHID to resolve or string pattern(s) to search for in origin urls" | ||||
type="text" id="swh-origins-url-patterns" | type="text" id="swh-origins-url-patterns" | ||||
oninput="swh.webapp.validateSWHIDInput(this)" autofocus required> | oninput="swh.webapp.validateSWHIDInput(this)" autofocus required autocomplete="off"> | ||||
<div class="input-group-append"> | <div class="input-group-append"> | ||||
<button class="btn btn-primary" type="submit"><i class="swh-search-icon mdi mdi-24px mdi-magnify" aria-hidden="true"></i></button> | <button class="btn btn-primary" type="submit" id="swh-search-submit"><i class="swh-search-icon mdi mdi-24px mdi-magnify" aria-hidden="true"></i></button> | ||||
</div> | </div> | ||||
<div class="invalid-feedback"></div> | <div class="invalid-feedback"></div> | ||||
</div> | </div> | ||||
<div class="row mt-1 mb-1 float-right position-relative" style="z-index: 1000"> | <div class="row mt-1 mb-1 float-right position-relative" style="z-index: 1000"> | ||||
<div class="form-group form-inline"> | <div class="form-group form-inline"> | ||||
<label class="control-label mr-1" style="font-weight: inherit">visit type:</label> | <label class="control-label mr-1" style="font-weight: inherit">visit type:</label> | ||||
<select id="swh-search-visit-type" class="custom-select form-control custom-select-sm"> | <select id="swh-search-visit-type" class="custom-select form-control custom-select-sm"> | ||||
<option selected value="any">any</option> | <option selected value="any">any</option> | ||||
Show All 19 Lines | <form class="form-horizontal needs-validation" id="swh-search-origins" novalidate> | ||||
</div> | </div> | ||||
<div class="custom-control custom-checkbox swhid-option"> | <div class="custom-control custom-checkbox swhid-option"> | ||||
<input class="custom-control-input" value="option-filter-empty-visits" type="checkbox" | <input class="custom-control-input" value="option-filter-empty-visits" type="checkbox" | ||||
id="swh-search-origin-metadata"> | id="swh-search-origin-metadata"> | ||||
<label class="custom-control-label font-weight-normal" for="swh-search-origin-metadata"> | <label class="custom-control-label font-weight-normal" for="swh-search-origin-metadata"> | ||||
search in metadata (instead of URL) | search in metadata (instead of URL) | ||||
</label> | </label> | ||||
</div> | </div> | ||||
{% if user.is_authenticated and user.is_staff or "swh.web.search_ql" in user.get_all_permissions %} | |||||
<div class="custom-control custom-checkbox swhid-option"> | <div class="custom-control custom-checkbox swhid-option"> | ||||
<input class="custom-control-input" value="option-use-ql" type="checkbox" | <input class="custom-control-input" value="option-use-ql" type="checkbox" | ||||
id="swh-search-use-ql"> | id="swh-search-use-ql"> | ||||
<label class="custom-control-label font-weight-normal" for="swh-search-use-ql"> | <label class="custom-control-label font-weight-normal" for="swh-search-use-ql"> | ||||
search using the | search using the | ||||
<a target="_blank" rel="noopener noreferrer" | <a target="_blank" rel="noopener noreferrer" | ||||
href="https://docs.softwareheritage.org/devel/swh-search/query-language.html"> | href="https://docs.softwareheritage.org/devel/swh-search/query-language.html"> | ||||
advanced search query language | advanced search query language | ||||
</a> | </a> | ||||
</label> | </label> | ||||
</div> | </div> | ||||
{% endif %} | |||||
</form> | </form> | ||||
<script> | <script> | ||||
swh.browse.initOriginSearch(); | swh.browse.initOriginSearch(); | ||||
</script> | </script> |