aboutsummaryrefslogtreecommitdiffstats
path: root/fatcat_scholar/templates/base.html
blob: 6af387d1351e46e38112114e45b9d41385af0fc7 (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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
<!DOCTYPE html>
<html lang="{{ locale or 'en' }}" style="position: relative; min-height: 100%; height: auto;" {% if locale in ['ar'] %}dir="rtl"{% endif %}>
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="referrer" content="origin-when-cross-origin">
  {% if settings.ONION_DOMAIN %}
    <meta http-equiv="onion-location" content="//{{ settings.ONION_DOMAIN }}">
  {%- endif %}
  <title>
    {%- if settings.SCHOLAR_ENV != "prod" -%}[{{ settings.SCHOLAR_ENV|upper }}] {% endif -%}
    {%- block title -%}{% trans %}Internet Archive Scholar{% endtrans %}{%- endblock %}
  </title>
  <link rel="stylesheet"
    href="/static/scholar-semantic-ui.v2.4.2.min.css"
    type="text/css">
  <style>
    {# bnewbold: accessibility/contrast #}
    a {
      color: #28629c;
    }
    .ui.basic.blue.label {
      color: #28629c!important;
      border-color: #28629c!important;
    }
    .ui.basic.orange.label {
      color: #c54e00!important;
      border-color: #c54e00!important;
    }
    .ui.card .meta, .ui.cards>.card .meta {
      color: rgba(0,0,0,0.55);
    }

    {# bnewbold: fix light grey bars in header, and "rounded" header #}
    nav.ui.inverted.menu .item:before { background: none; }
    nav.ui.menu { border-radius: 0; }

    .ui.button.serp-button {
      border-radius: 0;
      margin-bottom: 0.4em;
      text-align: left;
    }

    .ui.blue.button.serp-button {
      background-color: #6b6ebb;
    }

    .ui.labeled.icon.button.serp-button {
      padding-left: 3.0em!important;
      padding-right: 1em!important;
      min-width: 12em;
      max-width: 15em;
      box-shadow: 1px 1px 2px 1px rgba(0, 0, 0, 0.3);
    }

    .action-bar {
      display: flex;
      justify-content: center;
      column-gap: 0.3em;
    }

    @media only screen and (max-width: 767px) {
      .mobile-hide { display: none !important; }
    }
    @media only screen and (min-width: 768px) {
      .mobile-only { display: none !important; }
    }
    @media only screen and (max-width: 991px) {
      .tablet-hide { display: none !important; }
      .ui.grid>[class*="fourteen wide"].column.serp-column {
        width: 100% !important;
        box-shadow: none !important;
      }
    }
    @media only screen and (min-width: 992px) {
      .tablet-only { display: none !important; }
    }
    @media only screen and (min-width: 1200px) {
      .ui.container {
        font-size: 16px;
        line-height: 20px;
      }
      .ui.serp.card {
        max-width: 180px;
      }
      div.fulltext-link {
        width: 180px;
      }
      div.biblio-record {
        padding-left: 1.1em;
      }
    }

    .ui.serp.card {
      margin-bottom: 0.2em;
      border-radius: 0;
    }
    .ui.serp.card img {
      max-width: 100%;
    }
    .hit-count {
      font-weight: bold;
      line-height: 1.28571429em;
    }

    .biblio-record .biblio-title {
      margin-bottom: 0.1em;
      font-size: 1.2em;
      font-weight: bold;
      line-height: 1.2em;
    }
    .biblio-record .biblio-title a {
      color: #2224c7;
    }
    .biblio-record .release-type {
      text-transform: uppercase;
      font-weight: bold;
    }
    .biblio-record .original-title {
      font-style: italic;
      font-weight: normal;
    }
    .biblio-record .author-row {
      margin-top: 0;
      margin-bottom: 0.2em;
      font-size: 1.1em;
    }
    .biblio-record .release-stage {
      color: brown;
      font-weight: bold;
      text-transform: uppercase;
    }
    .biblio-record details > summary {
      list-style-type: none;
      color: #28629c;
      text-decoration: underline;
      margin-left: 0.3em;
    }
    .biblio-record details > summary::-webkit-details-marker {
      display: none;
    }

    {# fix RTL dividers #}
    {% if locale in ['ar'] %}
    .ui.divided.grid:not([class*="vertically divided"])>.column:not(.row), .ui.divided.grid:not([class*="vertically divided"])>.row>.column {
      box-shadow: 1px 0 0 0 rgba(34,36,38,.15);
    }
    .ui.divided.grid:not([class*="vertically divided"])>.column:first-child, .ui.divided.grid:not([class*="vertically divided"])>.row>.column:first-child {
      box-shadow: none;
    }
    .ui.inverted.divided.grid:not([class*="vertically divided"])>.column:not(.row), .ui.inverted.divided.grid:not([class*="vertically divided"])>.row>.column {
      box-shadow: 1px 0 0 0 rgba(255,255,255,.1);
    }
    {% endif %}

    {# for fulltext search result highlighting #}
    .search_highlights em {
      {# yellow #}
      {# background-color: #FFFFBB; #}
      font-style: normal;
      font-weight: bold;
    }

    .search_filters summary::marker {
      display: none;
    }
    .search_filters summary::-webkit-details-marker {
      display: none;
    }

    footer p a {
      color: rgba(255, 255, 255, 0.5);
    }
    footer p a:hover {
      color: rgba(255, 255, 255, 1.0);
      opacity: 1.0;
    }

    .ui.label.small {
      border-radius: 0;
    }

    a:hover .ui.card {
      opacity: 0.75;
    }

    .text-button {
      border: none;
      background-color: inherit;
      padding: 0;
      font-family: inherit;
      cursor: pointer;
      display: inline-block;
    }

    .modal-overlay {
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      right: 0;
      background: rgba(0,0,0,0.5);
      transition: opacity 200ms;
      visibility: hidden;
      opacity: 0;
    }
    .modal-overlay .cancel {
      position: absolute;
      width: 100%;
      height: 100%;
      cursor: default;
    }
    .modal-overlay:target {
      visibility: visible;
      opacity: 1;
    }

    .modal-popup {
        margin: 75px auto;
        padding: 20px;
        background: #fff;
        border: 1px solid #666;
        width: 300px;
        box-shadow: 0 0 50px rgba(0,0,0,0.5);
        position: relative;
    }
    .modal-popup .close {
        position: absolute;
        width: 20px;
        height: 20px;
        top: 20px;
        right: 20px;
        opacity: 0.8;
        transition: all 200ms;
        font-size: 24px;
        font-weight: bold;
        text-decoration: none;
        color: #666;
    }
    .modal-popup:hover {
      opacity: 1;
    }
    .modal-popup .content {
      max-height: 400px;
      overflow: auto;
    }

  </style>
  <link rel="icon" 
    type="image/x-icon" 
    href="/static/ia-favicon.ico">
  {% block extra_head %}{% endblock %}
</head>

<body>
<nav class="ui inverted menu" style="margin: 0;" dir="ltr">
  <div class="ui container">
    {% if settings.SCHOLAR_ENV != "prod" %}
      <div class="ui left corner {% if settings.SCHOLAR_ENV == "qa" %}orange{% else %}pink{% endif %} small label">
        <div data-tooltip="[{{ settings.SCHOLAR_ENV|upper }}] instance" data-position="bottom left">
          <i class="ui cogs icon"></i>
        </div>
      </div>
    {% endif %}
    <a href="https://archive.org/" class="header item">
      <img class="logo" src="/static/ia-logo.svg" style="width: 20px;" alt="">
      <img class="mobile-hide" src="/static/ia-wordmark.svg" style="margin-left: 10px; width: 180px;" alt="Internet Archive">
    </a>
    <span style="margin-top: 0.5em;">
      <a class="ui grey label" style="background-color: #fbbd08a6;" href="{{ lang_prefix }}/#alphanotice"><i>alpha</i></a>
    </span>

    <div class="right menu">
      <div class="ui simple dropdown item" aria-expanded="false" role="menu" aria-controls="language_menu" title="{{ _('language selection menu') }}">
        <!-- language/translate SVG icon -->
        <img src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB3aWR0aD0iMTc5MiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNzgyIDEwNzhxLTEgMy0xMi41LS41dC0zMS41LTExLjVsLTIwLTlxLTQ0LTIwLTg3LTQ5LTctNS00MS0zMS41dC0zOC0yOC41cS02NyAxMDMtMTM0IDE4MS04MSA5NS0xMDUgMTEwLTQgMi0xOS41IDR0LTE4LjUgMHE2LTQgODItOTIgMjEtMjQgODUuNS0xMTV0NzguNS0xMThxMTctMzAgNTEtOTguNXQzNi03Ny41cS04LTEtMTEwIDMzLTggMi0yNy41IDcuNXQtMzQuNSA5LjUtMTcgNXEtMiAyLTIgMTAuNXQtMSA5LjVxLTUgMTAtMzEgMTUtMjMgNy00NyAwLTE4LTQtMjgtMjEtNC02LTUtMjMgNi0yIDI0LjUtNXQyOS41LTZxNTgtMTYgMTA1LTMyIDEwMC0zNSAxMDItMzUgMTAtMiA0My0xOS41dDQ0LTIxLjVxOS0zIDIxLjUtOHQxNC41LTUuNSA2IC41cTIgMTItMSAzMyAwIDItMTIuNSAyN3QtMjYuNSA1My41LTE3IDMzLjVxLTI1IDUwLTc3IDEzMWw2NCAyOHExMiA2IDc0LjUgMzJ0NjcuNSAyOHE0IDEgMTAuNSAyNS41dDQuNSAzMC41em0tMjA1LTQ4NnEzIDE1LTQgMjgtMTIgMjMtNTAgMzgtMzAgMTItNjAgMTItMjYtMy00OS0yNi0xNC0xNS0xOC00MWwxLTNxMyAzIDE5LjUgNXQyNi41IDAgNTgtMTZxMzYtMTIgNTUtMTQgMTcgMCAyMSAxN3ptNjk4IDEyOWw2MyAyMjctMTM5LTQyem0tMTEwOCA4MDBsNjk0LTIzMnYtMTAzMmwtNjk0IDIzM3YxMDMxem0xMjQxLTMxN2wxMDIgMzEtMTgxLTY1Ny0xMDAtMzEtMjE2IDUzNiAxMDIgMzEgNDUtMTEwIDIxMSA2NXptLTUwMy05NjJsNTczIDE4NHYtMzgwem0zMTEgMTMyM2wxNTggMTMtNTQgMTYwLTQwLTY2cS0xMzAgODMtMjc2IDEwOC01OCAxMi05MSAxMmgtODRxLTc5IDAtMTk5LjUtMzl0LTE4My41LTg1cS04LTctOC0xNiAwLTggNS0xMy41dDEzLTUuNXE0IDAgMTggNy41dDMwLjUgMTYuNSAyMC41IDExcTczIDM3IDE1OS41IDYxLjV0MTU3LjUgMjQuNXE5NSAwIDE2Ny0xNC41dDE1Ny01MC41cTE1LTcgMzAuNS0xNS41dDM0LTE5IDI4LjUtMTYuNXptNDQ4LTEwNzl2MTA3OWwtNzc0LTI0NnEtMTQgNi0zNzUgMTI3LjV0LTM2OCAxMjEuNXEtMTMgMC0xOC0xMyAwLTEtMS0zdi0xMDc4cTMtOSA0LTEwIDUtNiAyMC0xMSAxMDYtMzUgMTQ5LTUwdi0zODRsNTU4IDE5OHEyIDAgMTYwLjUtNTV0MzE2LTEwOC41IDE2MS41LTUzLjVxMjAgMCAyMCAyMXY0MTh6Ii8+PC9zdmc+"
      alt="" style="height: 1.5em; filter: invert(100%);">
        <i class="dropdown icon" style="margin-left: 0.2em;"></i>
        <div id="language_menu" class="menu">
            {# TODO: as a dynamic array #}
            {# TODO: do url_for() here, with current endpoint (from request?) #}
            <a role="menuitem" class="item" href="/en/">English</a>
            <a role="menuitem" class="item" href="/ar/">عَرَبِيّ</a>
            <a role="menuitem" class="item" href="/de/">Deutsch</a>
            <a role="menuitem" class="item" href="/es/">Español</a>
            <a role="menuitem" class="item" href="/fr/">Français</a>
            <a role="menuitem" class="item" href="/hr/">Hrvatski</a>
            <a role="menuitem" class="item" href="/nb/">Norwegian Bokmål</a>
            <a role="menuitem" class="item" href="/ru/">Русский</a>
            <a role="menuitem" class="item" href="/zh/">中文</a>
            <div class="divider"></div>
            <a class="item" href="https://hosted.weblate.org/projects/internetarchive/fatcat-scholar/">{% trans %}Contribute to translations{% endtrans %}</a>
        </div>
      </div>
    </div>
  </div>
</nav>

{% block fullbody %}
<div class="ui vertical stripe segment" style="background-color: #dedede;">
  <div class="ui container" style="padding-top: 1em; padding-bottom: 0; padding-left: 0; padding-right: 0;">
    <div class="ui equal height stackable grid">
      <div class="ui four wide column" style="padding-bottom: 0;">
        <div style="display: flex; justify-content: center; align-items: center; height: 100%; width: 100%;">
          <a href="{{ lang_prefix }}/">
            <img src="/static/scholar-vaporwave-logo-small.png" alt="Internet Archive Scholar" style="width: 200px; margin-top: -1.5em;">
          </a>
        </div>
      </div>
      <div class="ui twelve wide column">
        <form class="" id="search_form" name="search_form" action="{{ lang_prefix }}/search" method="get" role="search" itemprop="potentialAction" itemscope itemtype="https://schema.org/SearchAction">
          <meta itemprop="target" content="/search?q={q}"/>
          <div class="ui form">
            <div class="ui action input large fluid">
              <input type="search" placeholder="{{ _("by title, authors, keywords...") }}" name="q" aria-label="{{ _('search for papers') }}" required itemprop="query-input" style="border-radius: 0; border: 1px #999 solid;" {% if query and query.q %}value="{{ query.q }}"{% endif %}>
              <button id="search_submit_button" class="ui green button" style="border-radius: 0; background-color: #44a25a; font-size: 1.2rem;">{{ _("Search") }}</button>
            </div>
          </div>
        </form>
        <div style="display: flex; width: 100%; justify-content: space-between; padding-top: 0.5em;">
          <div></div>
          <div>
            <a rel="help" href="{{ lang_prefix }}/help" style="order: -1;">{{ _("User Guide") }}</a>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
<main class="ui main container" style="min-height: calc(100vh - 30em);">
{% block fullmain %}
  <div class="ui container text" style="margin-top: 2em;">
    {% block main %}Nothing to see here.{% endblock %}
  </div>
{% endblock %}
</main>
{% endblock %}

<footer class="ui inverted vertical footer segment" style="padding: 4em 0em; margin-top: 3em; width: 100%;">
  <div class="ui container">
    <div class="ui stackable mobile reversed inverted divided equal height grid">
      <nav class="nine wide column">
        <div class="ui grid">
          <div class="tablet-hide two wide column" style="padding-top: 4em; padding-right: 0;">
            <img class="logo" src="/static/ia-logo.svg" alt="" style="width: 100%; opacity: 0.5;">
          </div>
          <div class="one wide column computer only"></div>
          <div class="thirteen wide twelve wide computer column">
            <h4 style="font-size: 1.28571429rem;">Internet Archive</h4>
            <p style="color: rgba(255, 255, 255, 0.5);">
            {% trans %}We are a US 501(c)(3) non-profit library, building a global archive of Internet sites and other cultural artifacts in digital form.{% endtrans %}

            {% trans trimmed wayback='<a target="_blank" rel="noopener" href="https://web.archive.org">The Wayback Machine</a>'|safe,
                archive_org = '<a target="_blank" rel="noopener" href="https://archive.org">archive.org</a>'|safe,
                openlibrary = '<a target="_blank" rel="noopener" href="https://openlibrary.org">Open Library</a>'|safe,
                archive_it = '<a target="_blank" rel="noopener" href="https://archive-it.org">Archive-It</a>'|safe %}
              Other projects include {{ wayback }}, {{ archive_org }}, {{ openlibrary }}, and {{ archive_it }}.
            {% endtrans %}
            <div class="ui horizontal inverted link list">
              <a class="item" target="_blank" rel="noopener" href="https://archive.org/about/">{{ _("About Us") }}</a>
              <a class="item" target="_blank" rel="noopener" href="https://archive.org/about/contact.php">{{ _("Contact Us") }}</a>
              <a class="item" target="_blank" rel="noopener" href="https://archive.org/about/terms.php">{{ _("Policies") }}</a>
              <a class="item" target="_blank" rel="noopener" href="https://archive.org/donate">{{ _("Donate") }}</a>
            </div>
          </div>
        </div>
      </nav>
      <nav class="three wide column">
        <h4 class="ui inverted header">{% trans %}Open Infrastructure{% endtrans %}</h4>
        <div class="ui inverted link list">
          <a target="_blank" rel="noopener" href="https://fatcat.wiki" class="item">{{ _("Editable Catalog (Fatcat)") }}</a>
          <a target="_blank" rel="noopener" href="https://guide.fatcat.wiki" class="item">{{ _("Contribute") }}</a>
          <a target="_blank" rel="noopener" href="/api/redoc" class="item">{{ _("Search API") }}</a>
          <a target="_blank" rel="noopener noreferrer" href="https://status.fatcat.wiki" class="item">{{ _("Service Status") }}</a>
          <a target="_blank" rel="external noopener noreferrer" href="https://github.com/internetarchive/fatcat-scholar" class="item">{{ _("Source Code") }}</a>
        </div>
      </nav>
      <nav class="three wide column">
        <h4 class="ui inverted header">scholar.archive.org</h4>
        <div class="ui inverted link list">
          <a href="{{ lang_prefix }}/about#howitworks" class="item">{{ _("How It Works") }}</a>
          <a href="{{ lang_prefix }}/about#sources" class="item">{{ _("Content Sources") }}</a>
          <a href="{{ lang_prefix }}/about#tdm" class="item">{{ _("Text and Data Mining") }}</a>
          <a href="{{ lang_prefix }}/help" rel="help" class="item">{{ _("Help") }}</a>
        </div>
      </nav>
    </div>
  </div>
</footer>

<script>
// when search is submitted, have submit button animate
document.getElementById("search_form").onsubmit = function(){
  document.getElementById("search_submit_button").classList.add("loading");
};
</script>
{% if settings.ENABLE_GOATCOUNTER -%}
  {# for local testing: <script>window.goatcounter = {allow_local: true};</script> #}
  <script>
    window.goatcounter = {
        /* title leaks search query, so don't report it */
        title: "",
        {# to allow localhost connections (dev) to be colected, set: allow_local: true #}
    };
  </script>
  <script data-goatcounter="{{ settings.GOATCOUNTER_ENDPOINT }}" async src="{{ settings.GOATCOUNTER_SCRIPT_URL }}"></script>
{%- endif %}
{% block postscript %}{% endblock %}
</body>
</html>