Changeset View
Changeset View
Standalone View
Standalone View
swh/web/ui/templates/includes/search-form.html
- This file was moved from swh/web/ui/templates/search-form.html.
<!-- The text-based SHA1 or SHA256 search --> | <!-- The text-based SHA1 or SHA256 search --> | ||||
<h2>Search with SHA-1 or SHA-256:</h2> | <label for="text-hash-form">Search with SHA-1 or SHA-256:</label> | ||||
<form id="text-hash-form" | <form id="text-hash-form" | ||||
action="{{ url_for('search_content') }}" | action="{{ url_for('search_content') }}" | ||||
class="form" | class="form" | ||||
method="get"> | method="get"> | ||||
<br/> | <br/> | ||||
<div class="input-group"> | <div class="input-group"> | ||||
<input id="text-hash-input" | <input id="text-hash-input" | ||||
type="text" class="form-control" | type="text" class="form-control" | ||||
name="q" | name="q" | ||||
placeholder="SHA-1 or SHA-256 checksum" /> | placeholder="SHA-1 or SHA-256 checksum" /> | ||||
<span class="input-group-btn"> | <span class="input-group-btn"> | ||||
<button id="text-hash-submit" | <button id="text-hash-submit" | ||||
class="btn btn-primary" | class="btn btn-primary" | ||||
type="submit"> | type="submit"> | ||||
Text search | Text search | ||||
</button> | </button> | ||||
</span> | </span> | ||||
</div> | </div> | ||||
</form> | </form> | ||||
<!-- The file-based drag&drop UI--> | <!-- The file-based drag&drop UI--> | ||||
<h2>Search with files</h2> | <label for="file-hash-form">Search with files</label> | ||||
<form id="file-hash-form" | <form id="file-hash-form" | ||||
action="{{ url_for('search_content') }}" | action="{{ url_for('search_content') }}" | ||||
class="text-center form" | class="text-center form" | ||||
method="post" | method="post" | ||||
enctype="multipart/form-data"> | enctype="multipart/form-data"> | ||||
<!--Form input --> | <!--Form input --> | ||||
<input type="file" | <input type="file" | ||||
Show All 20 Lines | <div class="btn-group" style="margin-top: 10px"> | ||||
<button id="file-hash-clear" class="btn btn-primary"> | <button id="file-hash-clear" class="btn btn-primary"> | ||||
Clear | Clear | ||||
<span class="glyphicon glyphicon-erase" aria-hidden="true"></span> | <span class="glyphicon glyphicon-erase" aria-hidden="true"></span> | ||||
</button> | </button> | ||||
</div> | </div> | ||||
</form> | </form> | ||||
<!-- Required JS --> | <!-- Required JS --> | ||||
<script src="{{ url_for('static', filename='lib/core.js') }}"></script> | {% for fname in ['lib/core.js', 'lib/lib-typedarrays.js', 'lib/sha256.js', 'js/search.js'] %} | ||||
<script src="{{ url_for('static', filename='lib/lib-typedarrays.js') }}"></script> | <script language="javascript" type="text/javascript" src="{{ url_for('static', filename=fname) }}"></script> | ||||
<script src="{{ url_for('static', filename='lib/sha1.js') }}"></script> | {% endfor %} | ||||
<script src="{{ url_for('static', filename='lib/sha256.js') }}"></script> | |||||
<script src="{{ url_for('static', filename='js/search.js') }}"></script> | |||||
<!-- Script setup --> | <!-- Script setup --> | ||||
<script> | <script> | ||||
var sfc = new SearchFormController($('#text-hash-form'), $('#file-hash-form'), $('#search-message')); | var sfc = new SearchFormController($('#text-hash-form'), $('#file-hash-form'), $('#search-message')); | ||||
sfc.setupTextForm($('#text-hash-input')); | sfc.setupTextForm($('#text-hash-input')); | ||||
sfc.setupFileForm($('#file-drop'),$('#filelist'),$('#file-hash-input'),$('#file-hash-clear')); | sfc.setupFileForm($('#file-drop'),$('#filelist'),$('#file-hash-input'),$('#file-hash-clear')); | ||||
</script> | </script> |