aboutsummaryrefslogtreecommitdiffstats
path: root/python/fatcat_web/templates/coverage_search.html
blob: 3d19611c645ae7901bc2d57e279ae1ae52746150 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
{% import "entity_macros.html" as entity_macros %}
{% import "search_macros.html" as search_macros %}
{% extends "base.html" %}

{% block title %}
{% if query.q %}
  Search: {{ query.q }}
{% else %}
  Preservation Coverage by Query
{% endif %}
{% endblock %}

{% block fullmain %}

<div class="ui vertical stripe segment" style="background-color: #EEE; padding-top: 4.5em;">
  <div class="ui container text">
    <h1>Preservation Coverage by Query</h1>
    <form class="" role="search" action="/coverage/search" method="get">
      <div class="ui form">
        <div class="ui action input huge fluid">
          <input type="text" placeholder="Query..." name="q" value="{% if query.q %}{{ query.q }}{% endif %}" aria-label="visualize preservation coverage">
          <button class="ui primary button">Search</button>
        </div>
        <div class="ui checkbox" style="float: right; margin: 1em;">
          <input type="checkbox" name="recent" id="recent" value="true" {% if query.recent %}checked{% endif %}>
          <label for="recent">Recent Publications Only</label>
        </div>
        <br>Can also search for <b><a href="/release/search?q={{ query.q or "" }}">releases</a></b> (eg, individual papers) or <b><a href="/container/search?q={{ query.q or "" }}">containers</a></b> (eg, journals).
      </div>
    </form>
  </div>
</div>

<div class="ui container" style="margin-top: 2em;">

{% if es_error %}
  <div class="ui container text">
    {{ search_macros.es_error_msg(es_error) }}
  </div>
{% endif %}

{% if coverage_stats != None %}
<div class="ui centered grid">
  <div class="row">
    <div class="twelve wide column">
      <div class="ui large horizontal statistic">
        <div class="value">{{ "{:,}".format(coverage_stats.total) }}</div>
        <div class="label" style="text-transform: none;">Known Releases</div>
      </div>
      {% if coverage_stats.total >= 1 %}
        {{ entity_macros.preservation_bar(coverage_stats.preservation, extra_class="large") }}
        {{ entity_macros.preservation_table(coverage_stats.preservation) }}
      {% endif %}
    </div>
  </div>
</div>
{% endif %}

{% if year_histogram_svg != None %}
  <br><br>
  <h2>Preservation Coverage by Year</h2>

  <figure style="margin: 0 0 0 0;">
    <embed type="image/svg+xml" src="{{ year_histogram_svg|safe }}" />
  </figure>

{% endif %}

{% if date_histogram_svg != None %}
  <br><br>
  <h2>Preservation Coverage by Date</h2>

  <figure style="margin: 0 0 0 0;">
    <embed type="image/svg+xml" src="{{ date_histogram_svg|safe }}" />
  </figure>

{% endif %}

{% if coverage_type_preservation != None %}
  <br><br>
  <h2>Preservation Coverage by Release Type</h2>
  <table class="ui table">
    <thead>
      <tr>
        <th>Release Type
        <th class="right aligned">Total Count
        <th>Coverage
    </thead>
    <tbody>
      {% for type_row in coverage_type_preservation %}
      <tr>
        <td class="two wide">{{ type_row.release_type }}
        <td class="two wide right aligned">{{ "{:,}".format(type_row.total) }}
        <td class="twelve wide">{{ entity_macros.preservation_bar(type_row) }}
      {% endfor %}
    </tbody>
  </table>
{% endif %}

</div>
{% endblock %}