nopaque/web/app/templates/nopaque.html.j2

285 lines
17 KiB
Plaintext
Raw Normal View History

2020-10-23 06:51:46 +00:00
{% extends "materialize/base.html.j2" %}
2020-10-28 14:34:12 +00:00
{% from '_colors.html.j2' import colors %}
2020-02-24 08:18:49 +00:00
2020-10-23 06:51:46 +00:00
{% block html_attribs %} lang="en"{% endblock html_attribs %}
2020-08-25 09:49:43 +00:00
2020-10-23 06:51:46 +00:00
{% block head %}
{{ super() }}
<link href="{{ url_for('static', filename='images/nopaque_-_favicon.png') }}" rel="icon">
{% endblock head %}
2020-08-24 12:21:16 +00:00
2020-10-23 06:51:46 +00:00
{% block metas %}
<meta charset="UTF-8">
{{ super() }}
{% endblock metas %}
2020-08-24 12:21:16 +00:00
2020-11-04 12:30:48 +00:00
{% block title %}{{ title }}{% endblock title %}
2020-08-25 09:49:43 +00:00
2020-10-23 06:51:46 +00:00
{% block styles %}
{{ super() }}
{% if current_user.is_authenticated %}
2020-10-28 10:21:05 +00:00
<link href="{{ url_for('static', filename='css/materialize.sidenav-fixed.css') }}" media="screen,projection" rel="stylesheet">
{% endif %}
2020-10-28 10:21:05 +00:00
<link href="{{ url_for('static', filename='css/materialize.sticky-footer.css') }}" media="screen,projection" rel="stylesheet">
2020-10-23 06:51:46 +00:00
<link href="{{ url_for('static', filename='css/nopaque.css') }}" media="screen,projection" rel="stylesheet">
<style>
2020-10-28 14:34:12 +00:00
.primary-color {background-color: {{ colors.primary }} !important;}
.primary-color-text {color: {{ colors.primary }} !important;}
.secondary-color {background-color: {{ colors.secondary }} !important;}
.secondary-color-text {color: {{ colors.secondary }} !important;}
.footer-color {background-color: {{ colors.footer }} !important;}
.footer-color-text {color: {{ colors.footer }} !important;}
2020-10-26 11:46:46 +00:00
2020-10-28 14:34:12 +00:00
.corpus-analysis-color {background-color: {{ colors.corpus_analysis }} !important;}
.corpus-analysis-color-text {color: {{ colors.corpus_analysis }} !important;}
.corpus-analysis-color.darken {background-color: {{ colors.corpus_analysis_darken }} !important;}
.corpus-analysis-color-text.text-darken {color: {{ colors.corpus_analysis_darken }} !important;}
.corpus-analysis-color.lighten {background-color: {{ colors.corpus_analysis_lighten }} !important;}
.corpus-analysis-color-text.text-lighten {color: {{ colors.corpus_analysis_lighten }} !important;}
2020-10-26 11:46:46 +00:00
2020-10-28 14:34:12 +00:00
.file-setup-color {background-color: {{ colors.file_setup }} !important;}
.file-setup-color-text {color: {{ colors.file_setup }} !important;}
.file-setup-color.darken {background-color: {{ colors.file_setup_darken }} !important;}
.file-setup-color-text.text-darken {color: {{ colors.file_setup_darken }} !important;}
.file-setup-color.lighten {background-color: {{ colors.file_setup_lighten }} !important;}
.file-setup-color-text.text-lighten {color: {{ colors.file_setup_lighten }} !important;}
2020-10-26 11:46:46 +00:00
2020-10-28 14:34:12 +00:00
.ocr-color {background-color: {{ colors.ocr }} !important;}
.ocr-color-text {color: {{ colors.ocr }} !important;}
.ocr-color.darken {background-color: {{ colors.ocr_darken }} !important;}
.ocr-color-text.text-darken {color: {{ colors.ocr_darken }} !important;}
.ocr-color.lighten {background-color: {{ colors.ocr_lighten }} !important;}
.ocr-color-text.text-lighten {color: {{ colors.ocr_lighten }} !important;}
2020-10-26 11:46:46 +00:00
2020-10-28 14:34:12 +00:00
.nlp-color {background-color: {{ colors.nlp }} !important;}
.nlp-color-text {color: {{ colors.nlp }} !important;}
.nlp-color.darken {background-color: {{ colors.nlp_darken }} !important;}
.nlp-color-text.text-darken {color: {{ colors.nlp_darken }} !important;}
.nlp-color.lighten {background-color: {{ colors.nlp_lighten }} !important;}
.nlp-color-text.text-lighten {color: {{ colors.nlp_lighten }} !important;}
2020-10-26 11:46:46 +00:00
2020-10-28 11:25:36 +00:00
{% if scheme_primary_color is not defined %}
2020-10-28 14:34:12 +00:00
{% set scheme_primary_color = colors.primary %}
2020-10-26 11:46:46 +00:00
{% endif %}
2020-10-28 11:25:36 +00:00
{% if scheme_secondary_color is not defined %}
2020-10-28 14:34:12 +00:00
{% set scheme_secondary_color = colors.secondary %}
2020-10-28 11:25:36 +00:00
{% endif %}
main .btn, main .btn-small, main .btn-large, main .btn-floating {background-color: {{ scheme_primary_color }};}
main .btn:hover, main .btn-large:hover, main .btn-small:hover, main .btn-floating:hover {background-color: {{ scheme_secondary_color }};}
main .pagination li.active {background-color: {{ scheme_primary_color }};}
main .table-of-contents a.active {border-color: {{ scheme_primary_color }};}
2020-10-26 11:46:46 +00:00
main .tabs .tab a {color: inherit;}
2020-11-03 08:57:00 +00:00
main .tabs .tab.disabled a {color: {{ scheme_primary_color }}28;}
main .tabs .tab.disabled a:hover {color: {{ scheme_primary_color }}28;}
2020-10-28 11:25:36 +00:00
main .tabs .tab a:hover {color: {{ scheme_primary_color }};}
2020-10-26 11:46:46 +00:00
main .tabs .tab a.active, .tabs .tab a:focus.active {
2020-10-28 11:25:36 +00:00
color: {{ scheme_primary_color }};
background-color: {{ scheme_primary_color }}28;
2020-10-23 06:51:46 +00:00
}
2020-10-28 11:25:36 +00:00
main .tabs .indicator {background-color: {{ scheme_primary_color }};}
2020-10-23 06:51:46 +00:00
</style>
{% endblock styles %}
{% block navbar %}
2020-10-26 11:46:46 +00:00
<div class="navbar-fixed">
<nav class="nav-extended">
<div class="nav-wrapper primary-color">
2020-10-26 11:46:46 +00:00
{% if current_user.is_authenticated %}
<a href="#" data-target="sidenav" class="sidenav-trigger"><i class="material-icons">menu</i></a>
{% endif %}
2020-10-29 18:21:33 +00:00
<a href="{{ url_for('main.index') }}" class="brand-logo hide-on-med-and-down" style="height: 100%; overflow: hidden;"><img src="{{ url_for('static', filename='images/nopaque_-_logo_name_slogan.svg') }}" style="height: 128px; margin-top: -32px; margin-left: -32px;"></a>
<a href="{{ url_for('main.index') }}" class="brand-logo hide-on-large-only" style="height: 100%; overflow: hidden;"><img src="{{ url_for('static', filename='images/nopaque_-_logo.svg') }}" style="height: 128px; margin-top: -32px; margin-left: -32px;"></a>
2020-10-26 11:46:46 +00:00
<ul class="right">
<li class="hide-on-med-and-down{% if request.path == url_for('main.news') %} active{% endif %}"><a href="{{ url_for('main.news') }}"><i class="material-icons left">notifications</i>News</a></li>
{% if current_user.is_authenticated %}
2020-10-26 11:46:46 +00:00
<li class="hide-on-med-and-down{% if request.path == url_for('main.dashboard') %} active{% endif %}"><a href="{{ url_for('main.dashboard') }}"><i class="material-icons left">dashboard</i>Dashboard</a></li>
<li class="hide-on-med-and-down"><a class="dropdown-trigger no-autoinit" data-target="nav-more-dropdown" href="#!" id="nav-more-dropdown-trigger"><i class="material-icons">more_vert</i></a></li>
{% else %}
<li{% if request.path == url_for('auth.register') %} class="active"{% endif %}><a href="{{ url_for('auth.register') }}"><i class="material-icons left">assignment</i>Register</a></li>
<li{% if request.path == url_for('auth.login') %} class="active"{% endif %}><a href="{{ url_for('auth.login') }}"><i class="material-icons left">login</i>Log in</a></li>
2020-02-18 14:31:10 +00:00
{% endif %}
2020-10-26 11:46:46 +00:00
</ul>
</div>
<div class="nav-content secondary-color">
2020-10-30 14:01:41 +00:00
{% block nav_content %}{% endblock nav_content %}
2020-11-02 12:06:37 +00:00
{% if current_user.is_authenticated %}
<a class="btn-floating btn-large halfway-fab modal-trigger pink tooltipped waves-effect waves-light" data-tooltip="Roadmap" href="#roadmap-modal"><i class="material-icons">explore</i></a>
2020-11-02 12:06:37 +00:00
{% endif %}
2020-10-26 11:46:46 +00:00
</div>
</nav>
</div>
2020-10-23 06:51:46 +00:00
2020-10-26 11:46:46 +00:00
{% if current_user.is_authenticated %}
<ul class="dropdown-content" id="nav-more-dropdown">
<li><a href="{{ url_for('settings.index') }}"><i class="material-icons left">settings</i>Settings</a></li>
<li class="divider" tabindex="-1"></li>
<li><a href="{{ url_for('auth.logout') }}">Log out</a></li>
</ul>
{% endif %}
2020-10-23 06:51:46 +00:00
{% endblock navbar %}
{% block sidenav %}
2020-10-26 11:46:46 +00:00
<ul class="sidenav sidenav-fixed{% if not current_user.is_authenticated %} hide{% endif %}">
2020-10-23 06:51:46 +00:00
{% if current_user.is_authenticated %}
<li>
<div class="user-view">
<div class="background primary-color"></div>
<span class="white-text name">{{ current_user.username }}</span>
<span class="white-text email">{{ current_user.email }}</span>
</div>
</li>
2020-10-28 10:21:05 +00:00
<li><a href="{{ url_for('main.index') }}">nopaque</a></li>
2020-10-23 06:51:46 +00:00
<li><a href="#"><i class="material-icons">linear_scale</i>Workflow</a></li>
<li><a href="{{ url_for('main.dashboard') }}"><i class="material-icons">dashboard</i>Dashboard</a></li>
<li><a href="{{ url_for('main.dashboard', _anchor='corpora') }}" style="padding-left: 47px;"><i class="material-icons">book</i>My Corpora</a></li>
<li><a href="{{ url_for('main.dashboard', _anchor='jobs') }}" style="padding-left: 47px;"><i class="material-icons">work</i>My Jobs</a></li>
<li><div class="divider"></div></li>
<li><a class="subheader">Processes & Services</a></li>
2020-10-28 14:34:12 +00:00
<li style="background-color: {{ colors.file_setup }}; border-left: 10px solid {{ colors.file_setup_darken }};"><a href="{{ url_for('services.service', service='file-setup') }}"><i class="material-icons">burst_mode</i>File setup</a></li>
<li style="background-color: {{ colors.ocr }}; border-left: 10px solid {{ colors.ocr_darken }}; margin-top: 5px;"><a href="{{ url_for('services.service', service='ocr') }}"><i class="material-icons">find_in_page</i>OCR</a></li>
<li style="background-color: {{ colors.nlp }}; border-left: 10px solid {{ colors.nlp_darken }}; margin-top: 5px;"><a href="{{ url_for('services.service', service='nlp') }}"><i class="material-icons">format_textdirection_l_to_r</i>NLP</a></li>
<li style="background-color: {{ colors.corpus_analysis }}; border-left: 10px solid {{ colors.corpus_analysis_darken }}; margin-top: 5px;"><a href="{{ url_for('services.service', service='corpus_analysis') }}"><i class="material-icons">search</i>Corpus analysis</a></li>
<li><div class="divider"></div></li>
<li><a class="subheader">Account</a></li>
<li><a href="{{ url_for('settings.index') }}"><i class="material-icons">settings</i>Settings</a></li>
<li><a href="{{ url_for('auth.logout') }}">Log out</a></li>
2020-10-23 06:51:46 +00:00
{% else %}
<li><a href="{{ url_for('auth.register') }}"><i class="material-icons">assignment</i>Register</a></li>
<li><a href="{{ url_for('auth.login') }}"><i class="material-icons">login</i>Log in</a></li>
2020-10-23 06:51:46 +00:00
{% endif %}
{% if current_user.is_administrator() %}
<li><div class="divider"></div></li>
<li><a class="subheader">Administration</a></li>
<li><a href="{{ url_for('admin.index') }}"><i class="material-icons">build</i>Administration</a></li>
2020-10-23 06:51:46 +00:00
{% endif %}
</ul>
{% endblock sidenav %}
{% block main_attribs %} class="grey lighten-5"{% endblock main_attribs %}
2020-10-26 11:46:46 +00:00
{% block main %}
2020-11-02 12:06:37 +00:00
{% block page_content %}{% endblock page_content %}
{% if current_user.is_authenticated %}
<div id="roadmap-modal" class="modal">
<div class="modal-content">
2020-11-02 14:41:58 +00:00
<h2>Roadmap</h2>
2020-11-02 12:06:37 +00:00
<p>The roadmap guides you through nopaque's workflow! If you have the necessary input fie formats, you can directly jump into the corresponding process. If not, you can use the roadmap to jump right to the preceding process.</p>
<ul class="tabs tabs-fixed-width">
<li class="tab"><a{%if request.path == url_for('services.service', service='file-setup') %} class="active"{% endif %} href="{{ url_for('services.service', service='file-setup') }}" target="_self">File setup</a></li>
2020-11-02 14:41:58 +00:00
<li class="tab disabled"><i class="material-icons">navigate_next</i></li>
2020-11-02 12:06:37 +00:00
<li class="tab"><a{%if request.path == url_for('services.service', service='ocr') %} class="active"{% endif %} href="{{ url_for('services.service', service='ocr') }}" target="_self">OCR</a></li>
2020-11-02 14:41:58 +00:00
<li class="tab disabled"><i class="material-icons">navigate_next</i></li>
2020-11-02 12:06:37 +00:00
<li class="tab"><a{%if request.path == url_for('services.service', service='nlp') %} class="active"{% endif %} href="{{ url_for('services.service', service='nlp') }}" target="_self">NLP</a></li>
2020-11-02 14:41:58 +00:00
<li class="tab disabled"><i class="material-icons">navigate_next</i></li>
2020-11-02 12:06:37 +00:00
<li class="tab"><a{%if request.path == url_for('corpora.add_corpus') %} class="active"{% endif %} href="{{ url_for('corpora.add_corpus') }}" target="_self">Add corpus</a></li>
2020-11-02 14:41:58 +00:00
<li class="tab disabled"><i class="material-icons">navigate_next</i></li>
2020-11-02 12:06:37 +00:00
{% if corpus %}
<li class="tab"><a{%if request.path == url_for('corpora.add_corpus_file', corpus_id=corpus.id) %} class="active"{% endif %} href="{{ url_for('corpora.add_corpus_file', corpus_id=corpus.id) }}" target="_self">Add corpus file(s)</a></li>
{% else %}
<li class="tab disabled tooltipped" data-tooltip="Select a corpus first" target="_self"><a>Add corpus file(s)</a></li>
{% endif %}
2020-11-02 14:41:58 +00:00
<li class="tab disabled"><i class="material-icons">navigate_next</i></li>
2020-11-02 12:06:37 +00:00
{% if corpus %}
{% if corpus.files.all() %}
<li class="tab"><a{%if request.path == url_for('corpora.analyse_corpus', corpus_id=corpus.id) %} class="active"{% endif %} href="{{ url_for('corpora.analyse_corpus', corpus_id=corpus.id) }}" target="_self">Corpus analysis</a></li>
{% else %}
<li class="tab disabled tooltipped" data-tooltip="Add at least one corpus file first"><a>Corpus analysis</a></li>
{% endif %}
{% else %}
<li class="tab disabled tooltipped" data-tooltip="Select a corpus first"><a>Corpus analysis</a></li>
{% endif %}
</ul>
</div>
<div class="modal-footer">
<a href="#!" class="modal-close waves-effect waves-green btn-flat">Close</a>
</div>
</div>
{% endif %}
2020-10-26 11:46:46 +00:00
{% endblock main %}
2020-10-23 06:51:46 +00:00
2020-10-28 11:25:36 +00:00
{% block footer_attribs %} class="page-footer footer-color"{% endblock footer_attribs %}
2020-10-26 11:46:46 +00:00
{% block footer %}
<div class="container">
<div class="row">
<div class="col s6 m3">
<a href="https://www.dfg.de/">
<img class="responsive-img" src="{{ url_for('static', filename='images/logo_-_dfg.gif') }}">
</a>
</div>
<div class="col s6 m3 offset-m1 center-align">
<a href="https://www.uni-bielefeld.de/sfb1288/">
<img class="responsive-img" src="{{ url_for('static', filename='images/logo_-_sfb_1288.png') }}">
</a>
</div>
<div class="col s12 m3 offset-m1">
<h5 class="white-text">Legal Notice</h5>
<ul>
<li><a class="grey-text text-lighten-3" href="https://www.uni-bielefeld.de/(en)/impressum/">Legal Notice</a></li>
<li><a class="grey-text text-lighten-3" href="{{ url_for('main.privacy_policy') }}">Privacy statement (GDPR)</a></li>
<li><a class="grey-text text-lighten-3" href="{{ url_for('main.terms_of_use') }}">Terms of use</a></li>
<li></li>
</ul>
2020-10-23 06:51:46 +00:00
</div>
</div>
2020-10-26 11:46:46 +00:00
</div>
<div class="footer-copyright primary-color">
<div class="container">
<div class="row" style="margin-bottom: 0;">
<div class="col s12 m3">
<span>© 2020 Bielefeld University</span>
</div>
<div class="col s12 m9 right-align">
<a class="btn-small blue waves-effect waves-light" href="{{ url_for('main.about_and_faq') }}"><i class="left material-icons">info_outline</i>About and faq</a>
{% if config.NOPAQUE_CONTACT %}
<a class="btn-small pink waves-effect waves-light" href="mailto:{{ config.NOPAQUE_CONTACT }}?subject={{ config.NOPAQUE_MAIL_SUBJECT_PREFIX }} Contact"><i class="left material-icons">rate_review</i>Contact</a>
<a class="btn-small green waves-effect waves-light" href="mailto:{{ config.NOPAQUE_CONTACT }}?subject={{ config.NOPAQUE_MAIL_SUBJECT_PREFIX }} Feedback"><i class="left material-icons">feedback</i>Feedback</a>
2020-10-26 11:46:46 +00:00
{% endif %}
<a class="btn-small orange waves-effect waves-light" href="https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque"><i class="left material-icons">code</i>GitLab</a>
</div>
2020-10-23 06:51:46 +00:00
</div>
</div>
2020-10-26 11:46:46 +00:00
</div>
{% endblock footer %}
2020-10-23 06:51:46 +00:00
{% block scripts %}
{{ super() }}
2020-12-15 13:38:52 +00:00
{% if current_user.setting_dark_mode %}
2020-10-23 06:51:46 +00:00
<script src="{{ url_for('static', filename='js/darkreader.js') }}"></script>
2020-12-15 13:38:52 +00:00
<script>
DarkReader.enable({brightness: 150, contrast: 100, sepia: 0});
</script>
{% endif %}
2020-10-23 06:51:46 +00:00
<script src="{{ url_for('static', filename='js/jsonpatch.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/list.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/socket.io.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/nopaque/main.js') }}"></script>
{% assets output="js/nopaque/RessourceDisplays.compiled.js",
"js/nopaque/RessourceDisplays/RessourceDisplay.js",
"js/nopaque/RessourceDisplays/CorpusDisplay.js",
"js/nopaque/RessourceDisplays/JobDisplay.js" %}
<script src="{{ ASSET_URL }}"></script>
{% endassets %}
{% assets output="js/nopaque/RessourceLists.compiled.js",
"js/nopaque/RessourceLists/RessourceList.js",
"js/nopaque/RessourceLists/CorpusList.js",
"js/nopaque/RessourceLists/CorpusFileList.js",
"js/nopaque/RessourceLists/JobList.js",
"js/nopaque/RessourceLists/JobInputList.js",
"js/nopaque/RessourceLists/JobResultList.js",
"js/nopaque/RessourceLists/QueryResultList.js",
"js/nopaque/RessourceLists/UserList.js" %}
<script src="{{ ASSET_URL }}"></script>
{% endassets %}
2020-10-23 06:51:46 +00:00
<script>
// Disable all option elements with no value
2020-12-15 13:38:52 +00:00
for (let optionElement of document.querySelectorAll('option[value=""]')) {optionElement.disabled = true;}
2020-10-23 06:51:46 +00:00
M.AutoInit();
M.CharacterCounter.init(document.querySelectorAll('input[data-length][type="email"], input[data-length][type="password"], input[data-length][type="text"], textarea[data-length]'));
M.Dropdown.init(document.querySelectorAll('#nav-more-dropdown-trigger'), {alignment: 'right', constrainWidth: false, coverTrigger: false});
nopaque.appClient = new AppClient({% if current_user.is_authenticated %}{{ current_user.id }}{% endif %});
2020-10-23 06:51:46 +00:00
nopaque.Forms.init();
for (let flashedMessage of {{ get_flashed_messages(with_categories=True)|tojson }}) {nopaque.appClient.flash(flashedMessage[1], flashedMessage[0]);}
2020-10-23 06:51:46 +00:00
</script>
{% endblock scripts %}