summaryrefslogtreecommitdiffstats
path: root/python/fatcat_web/templates/base.html
blob: c17f81de6ab962c5696f7ce9b0e91d819549f611 (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
<!DOCTYPE html>
<html lang="en" style="position: relative; min-height: 100%; height: auto;">
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="referrer" content="origin-when-cross-origin">

  <title>{%- block title -%}
    {%- if config.FATCAT_DOMAIN.startswith('qa.') -%}
      {{- "[QA] " -}}
    {%- elif config.FATCAT_DOMAIN.startswith('dev.') -%}
      {{- "[DEV] " -}}
    {%- endif -%}
    Perpetual Access To The Scholarly Record
  {%- endblock %} | fatcat!</title>

  <link rel="stylesheet"
    type="text/css"
    href="https://cdn.jsdelivr.net/npm/fomantic-ui@2.8.6/dist/semantic.min.css"
    type="text/css"
    crossorigin="anonymous">
  <link rel="preload"
    href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic&subset=latin&display=swap"
    as="style">
  <link rel="preload"
    href="https://cdn.jsdelivr.net/npm/fomantic-ui@2.8.6/dist/themes/default/assets/fonts/icons.woff2"
    as="font"
    type="font/woff2"
    crossorigin="anonymous">
  <link rel="icon" href="data:,">

  <style>
    {# bnewbold: fix light grey bars in header #}
    .ui.inverted.menu .item:before { background: none; }

    @media only screen and (max-width: 479px) {
      .mobile-hide{ display: none !important; }
    }

    .field textarea#toml {
      font-family: monospace;
    }
  </style>
  {% block extra_head %}{% endblock %}
</head>
<body style="margin-bottom: 130px;">

<header class="ui fixed inverted menu">
  <div class="ui container">
    {% if config.FATCAT_DOMAIN.startswith('qa.') %}
      <div class="ui left corner orange small label">
        <div data-tooltip="[QA] environment (data not preserved)" data-position="bottom left">
          <i class="ui cogs icon"></i>
        </div>
      </div>
    {% elif config.FATCAT_DOMAIN.startswith('dev.') %}
      <div class="ui left corner pink small label">
        <div data-tooltip="[DEV] environment (data not preserved)" data-position="bottom left">
          <i class="ui cogs icon"></i>
        </div>
      </div>
    {% endif %}
    <a href="/" class="header item">
      <!-- <img class="logo" src="assets/images/logo.png"> -->
      fatcat!
    </a>
    <a href="/about" class="item mobile-hide">About</a>
    <a href="https://guide.{{ config.FATCAT_DOMAIN }}/" class="item mobile-hide">Guide</a>
    <a href="/changelog" class="item mobile-hide">Changelog</a>
    <div class="right menu">
      <div class="item" style="padding: 0;">
        <form class="" action="/search" method="get" role="search" aria-label="Papers">
          <div class="ui transparent inverted icon input">
            <i class="search icon" style="padding-right: 2em;"></i>
            <input type="text" placeholder="Search Papers..." name="q" style="border: 1px solid #777 !important; padding: 5px !important; width: 15em;">
          </div>
        </form>
      </div>
{% if current_user.is_authenticated %}
      <div class="ui simple dropdown item">
      {{ current_user.username }} <i class="dropdown icon"></i>
        <div class="menu">
          <a class="item" href="/editor/{{ current_user.editor_id }}/editgroups"><i class="history icon"></i>Edit History</a>
          <a class="item" href="/editor/{{ current_user.editor_id }}/annotations"><i class="edit icon"></i>Comment History</a>
          <div class="divider"></div>
          <a class="item" href="/auth/account"><i class="settings icon"></i>Account</a>
          <a class="item" href="/auth/logout"><i class="sign out icon"></i>Logout</a>
        </div>
      </div>
{% else %}
      <div class="ui simple item">
        <a href="/auth/login">Login/Signup</a>
      </div>
{% endif %}
    </div>
  </div>
</header>

{% block fullmain %}
<!-- 4em top margin is "enough" -->
<main class="ui main container" style="margin-top: 6em; margin-bottom: 2em;" {% block main_extra_attr %}{% endblock %}>
{% with messages = get_flashed_messages() %}
  {% if messages %}
    <div class="ui info message" style="margin: 1em auto; max-width: 45em;">
    {# Needs more javascript: <i class="close icon"></i> #}
    {% if messages|length == 1 %}
      <div class="header">{{ messages[0]|safe }}</div>
    {% else %}
      <ul class="list">
      {% for message in messages %}
        <li>{{ message|safe }}
      {% endfor %}
      </ul>
    {% endif %}
    </div>
  {% endif %}
{% endwith %}
{% block fullbody %}
  <div class="ui container text">
    {% block body %}Nothing to see here.{% endblock %}
  </div>
{% endblock %}
</main>
{% endblock %}


<footer class="ui inverted vertical footer segment" style="margin-top: 2em; padding-top: 2em; padding-bottom:2em; position: absolute; bottom: 0px; width: 100%;">
  <div class="ui center aligned container">
    <div class="ui horizontal inverted small divided link list">
      <a class="item" href="/">fatcat!</a>
      <a class="item" href="/about">About</a>
      <a class="item" href="https://guide.{{ config.FATCAT_DOMAIN }}/sources.html">Sources</a>
      <a class="item" href="{% if config.FATCAT_DOMAIN == "fatcat.wiki" %}https://stats.uptimerobot.com/GM9YNSrB0{% elif config.FATCAT_DOMAIN =="qa.fatcat.wiki" %}https://stats.uptimerobot.com/WQ8wAUREA{% else %}#{% endif %}">Status</a>
      <a class="item" href="https://guide.{{ config.FATCAT_DOMAIN }}/bulk_exports.html">Bulk Exports</a>
      <a class="item" href="https://github.com/internetarchive/fatcat/">Code</a>
      <a class="item" href="https://github.com/internetarchive/fatcat/tree/{{ config.GIT_REVISION }}"><code>{{ config.GIT_REVISION }}</code></a>
      {% if config.FATCAT_DOMAIN.startswith('qa.') %}
        <a class="item"><b style="color: orange;">[QA]</b></a>
      {% elif config.FATCAT_DOMAIN.startswith('dev.') %}
        <a class="item"><b style="color: magenta;">[DEV]</b></a>
      {% endif %}
    </div>
  </div>
</footer>

<script
  src="https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js"
  integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
  crossorigin="anonymous">
</script>
<script
  src="https://cdn.jsdelivr.net/npm/fomantic-ui@2.8.6/dist/semantic.min.js"
  integrity="sha256-9H3HWYnPJ2bEHgkOrw+48KheOqYzTvJd1hbeU9sEDFk="
  crossorigin="anonymous">
</script>
{% if config.ENABLE_GOATCOUNTER -%}
  <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="{{ config.GOATCOUNTER_ENDPOINT }}" async src="{{ config.GOATCOUNTER_SCRIPT_URL }}"></script>
{%- endif %}
{% block postscript %}{% endblock %}

</body>
</html>