aboutsummaryrefslogtreecommitdiffstats
path: root/fatcat_scholar/templates/search.html
blob: 6d9fec2082a02080e716c81f02402a4e7834aa5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{% import "search_macros.html" as search_macros %}
{% extends "base.html" %}

{% block fullbody %}
<div class="ui equal height divided grid" style="margin-top: 1em;">
  <div class="ui two wide column">

    {% if hits %}
    <div style="width: 100%; text-align: right;">
      {# <h2>{{ "{:,}".format(hits.count_found) }}</h2> #}
      <h3 style="font-size: {% if hits.count_found >= 10000000 %}1.0em{% elif hits.count_found >= 1000 %}1.5em{% else %}2.0em{% endif %};">{{ "{:,}".format(hits.count_found) }}</h3>
      Hits
    </div>
    <div style="text-align: right;">
      <span style="color: rgba(0,0,0,0.4);">in {{ "{:0.2}".format(hits.query_time_ms/1000.0) }}sec</span>
    </div>
    <div class="ui clearing divider"></div>
    {% endif %}

    <div style="text-align: right;">
      {{ search_macros.query_option(query.time_options, query.filter_time) }}
      {{ search_macros.query_option(query.type_options, query.filter_type) }}
      {{ search_macros.query_option(query.availability_options, query.filter_availability) }}
      {{ search_macros.query_option(query.sort_options, query.sort_order) }}
    </div>
    
  </div>
  <div class="ui thirteen wide column">
    {% if search_error %}
      <div class="ui error message">
        <div class="header">Query Error</div>
        <p>{{ search_error }}</p>
      </div>
    {% elif hits %}
      {% if hits.results %}
        {% for paper in hits.results %}
          {{ search_macros.fulltext_search_result_row(paper) }}
        {% endfor %}
      {% endif %}
    {% else %}
    No search submitted? Some message should go here.
    {% endif %}
  </div>
</div>
{% endblock %}