Skip to content

Commit

Permalink
clean up code
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-gray-tangent committed Jul 11, 2024
1 parent 42330ff commit 6eb66e1
Showing 1 changed file with 144 additions and 144 deletions.
288 changes: 144 additions & 144 deletions app/templates/app/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,170 +4,170 @@

{% block content %}

<div class="body">
<div class="section mt-3 mb-3">
<div class="card content-card p-2">
<div class="card-body">
<h5 class="card-title">{% trans "Search a term" %}</h5>
<form method="get" class="container">
<div class="body">
<div class="section mt-3 mb-3">
<div class="card content-card p-2">
<div class="card-body">
<h5 class="card-title">{% trans "Search a term" %}</h5>
<form method="get" class="container">

<input type="search" name="{{ filter.form.search.name }}" placeholder="{% trans 'Search...' %}"
class="form-control search-input"
value="{{ request.GET.search|default_if_none:'' }}">
<input type="search" name="{{ filter.form.search.name }}" placeholder="{% trans 'Search...' %}"
class="form-control search-input"
value="{{ request.GET.search|default_if_none:'' }}">

<br>
<input type="submit" class="btn btn-success float-left"/>
</form>
<br>
<br>
<div class="container">
{% for document in search_results %}
<input type="submit" class="btn btn-success float-left"/>
</form>
<br>
<br>
<div class="container">
{% for document in search_results %}

<div>
<ul>
<li>
<span class="mr-5 text-primary"><b>{% trans "Title:" %}</b></span>
<span>{{ document.title }}</span>
</li>
<li class="mb-2">
<span class="mr-5"><b>{% trans "Institution:" %}</b></span>
<span>{{ document.institution }}</span>
</li>
<li class="mb-2">
<span class="mr-5"><b>{% trans "Headline:" %}</b></span>
<span>{{ document.search_headline|safe }}</span>
</li>
<li>
<span class="mr-5"><b>{% trans "File:" %}</b></span>
<span>{{ document.uploaded_file }}</span>
</li>
<li>
<span class="mr-5"><b>{% trans "License:" %}</b></span>
<span>{{ document.license }}</span>
</li>
<li>
<span class="mr-5"><b>{% trans "License:" %}</b></span>
<span>{{ document.document_type }}</span>
</li>
<li>
<span class="mr-5"><b>{% trans "Mime Type:" %}</b></span>
<span>{{ document.mime_type }}</span>
</li>
<li class="mt-2">
<span class="mr-5"><b>{% trans "Rank:" %}</b></span>
<span><i>{{ document.rank }}</i></span>
</li>
</ul>
</div>
{% endfor %}
</div>
<div>
<ul>
<li>
<span class="mr-5 text-primary"><b>{% trans "Title:" %}</b></span>
<span>{{ document.title }}</span>
</li>
<li class="mb-2">
<span class="mr-5"><b>{% trans "Institution:" %}</b></span>
<span>{{ document.institution }}</span>
</li>
<li class="mb-2">
<span class="mr-5"><b>{% trans "Headline:" %}</b></span>
<span>{{ document.search_headline|safe }}</span>
</li>
<li>
<span class="mr-5"><b>{% trans "File:" %}</b></span>
<span>{{ document.uploaded_file }}</span>
</li>
<li>
<span class="mr-5"><b>{% trans "License:" %}</b></span>
<span>{{ document.license }}</span>
</li>
<li>
<span class="mr-5"><b>{% trans "License:" %}</b></span>
<span>{{ document.document_type }}</span>
</li>
<li>
<span class="mr-5"><b>{% trans "Mime Type:" %}</b></span>
<span>{{ document.mime_type }}</span>
</li>
<li class="mt-2">
<span class="mr-5"><b>{% trans "Rank:" %}</b></span>
<span><i>{{ document.rank }}</i></span>
</li>
</ul>
</div>
{% endfor %}
</div>
<div class="container">
<hr>
<div class="pagination ">
{% if documents.has_previous %}
<a href="?search={{ request.GET.search|default_if_none:'' }}
&document_type={{ request.GET.document_type|default_if_none:'' }}
&institution={{ request.GET.institution|default_if_none:'' }}
&subjects={{ request.GET.subjects|default_if_none:'' }}
&languages={{ request.GET.languages|default_if_none:'' }}&page=1">&laquo; first</a>
<a href="?page={{ documents.previous_page_number }}">&lt; previous</a>
{% endif %}
<span class="current">
Page {{ documents.number }} of {{ documents.paginator.num_pages }}.
</span>
{% if documents.has_next %}
<a href="?search={{ request.GET.search|default_if_none:'' }}
&document_type={{ request.GET.document_type|default_if_none:'' }}
&institution={{ request.GET.institution|default_if_none:'' }}
&subjects={{ request.GET.subjects|default_if_none:'' }}
&languages={{ request.GET.languages|default_if_none:'' }}
&page={{ documents.next_page_number }}">next &gt;</a>
<a href="?search=
{{ request.GET.search|default_if_none:'' }}&page={{ documents.paginator.num_pages }}">last
&raquo;</a>
{% endif %}
</div>
<hr>
</div>
<div class="container">
<hr>
<div class="pagination ">
{% if documents.has_previous %}
<a href="?search={{ request.GET.search|default_if_none:'' }}
&document_type={{ request.GET.document_type|default_if_none:'' }}
&institution={{ request.GET.institution|default_if_none:'' }}
&subjects={{ request.GET.subjects|default_if_none:'' }}
&languages={{ request.GET.languages|default_if_none:'' }}&page=1">&laquo; first</a>
<a href="?page={{ documents.previous_page_number }}">&lt; previous</a>
{% endif %}
<span class="current">
Page {{ documents.number }} of {{ documents.paginator.num_pages }}.
</span>
{% if documents.has_next %}
<a href="?search={{ request.GET.search|default_if_none:'' }}
&document_type={{ request.GET.document_type|default_if_none:'' }}
&institution={{ request.GET.institution|default_if_none:'' }}
&subjects={{ request.GET.subjects|default_if_none:'' }}
&languages={{ request.GET.languages|default_if_none:'' }}
&page={{ documents.next_page_number }}">next &gt;</a>
<a href="?search=
{{ request.GET.search|default_if_none:'' }}&page={{ documents.paginator.num_pages }}">last
&raquo;</a>
{% endif %}
</div>
<form method="get" class="container">
<hr>
</div>
<form method="get" class="container">

<input type="search" name="{{ filter.form.search.name }}" placeholder="{% trans 'Search...' %}"
class="form-control search-input"
value="{{ request.GET.search|default_if_none:'' }}">
<input type="search" name="{{ filter.form.search.name }}" placeholder="{% trans 'Search...' %}"
class="form-control search-input"
value="{{ request.GET.search|default_if_none:'' }}">

<br>
<br>

<div class="row">
<div class="col-md-3">
<div class="form-group">
<label for="id_subjects">Institution</label>
<div class="subjects-checkbox-container">
{% for checkbox in filter.form.institution %}
<div class="form-check">
{{ checkbox.tag }}
<label class="form-check-label"
for="{{ checkbox.id_for_label }}">
{{ checkbox.choice_label }}
</label>
</div>
{% endfor %}
</div>
<div class="row">
<div class="col-md-3">
<div class="form-group">
<label for="id_subjects">Institution</label>
<div class="subjects-checkbox-container">
{% for checkbox in filter.form.institution %}
<div class="form-check">
{{ checkbox.tag }}
<label class="form-check-label"
for="{{ checkbox.id_for_label }}">
{{ checkbox.choice_label }}
</label>
</div>
{% endfor %}
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label for="id_subjects">Document Type</label>
<div class="subjects-checkbox-container">
{% for checkbox in filter.form.document_type %}
<div class="form-check">
{{ checkbox.tag }}
<label class="form-check-label" for="{{ checkbox.id_for_label }}">
{{ checkbox.choice_label }}
</label>
</div>
{% endfor %}
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label for="id_subjects">Document Type</label>
<div class="subjects-checkbox-container">
{% for checkbox in filter.form.document_type %}
<div class="form-check">
{{ checkbox.tag }}
<label class="form-check-label" for="{{ checkbox.id_for_label }}">
{{ checkbox.choice_label }}
</label>
</div>
{% endfor %}
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label for="id_subjects">Subjects</label>
<div class="subjects-checkbox-container">
{% for checkbox in filter.form.subjects %}
<div class="form-check">
{{ checkbox.tag }}
<label class="form-check-label" for="{{ checkbox.id_for_label }}">
{{ checkbox.choice_label }}
</label>
</div>
{% endfor %}
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label for="id_subjects">Subjects</label>
<div class="subjects-checkbox-container">
{% for checkbox in filter.form.subjects %}
<div class="form-check">
{{ checkbox.tag }}
<label class="form-check-label" for="{{ checkbox.id_for_label }}">
{{ checkbox.choice_label }}
</label>
</div>
{% endfor %}
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label for="id_subjects">Languages</label>
<div class="subjects-checkbox-container">
{% for checkbox in filter.form.languages %}
<div class="form-check">
{{ checkbox.tag }}
<label class="form-check-label" for="{{ checkbox.id_for_label }}">
{{ checkbox.choice_label }}
</label>
</div>
{% endfor %}
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label for="id_subjects">Languages</label>
<div class="subjects-checkbox-container">
{% for checkbox in filter.form.languages %}
<div class="form-check">
{{ checkbox.tag }}
<label class="form-check-label" for="{{ checkbox.id_for_label }}">
{{ checkbox.choice_label }}
</label>
</div>
{% endfor %}
</div>
</div>
</div>
<input type="submit" class="btn btn-success float-left"/>
<br>
</form>
</div>
<input type="submit" class="btn btn-success float-left"/>
<br>
</form>

</div>
<br>
</div>
<br>
</div>
</div>

{% endblock content %}

0 comments on commit 6eb66e1

Please sign in to comment.