mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-15 01:05:42 +00:00
148 lines
5.4 KiB
Django/Jinja
148 lines
5.4 KiB
Django/Jinja
<script src="https://cdnjs.cloudflare.com/ajax/libs/fast-json-patch/3.1.1/fast-json-patch.min.js" integrity="sha512-5uDdefwnzyq4N+SkmMBmekZLZNmc6dLixvVxCdlHBfqpyz0N3bzLdrJ55OLm7QrZmgZuhLGgHLDtJwU6RZoFCA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/list.js/2.3.1/list.min.js" integrity="sha512-93wYgwrIFL+b+P3RvYxi/WUFRXXUDSLCT2JQk9zhVGXuS2mHl2axj6d+R6pP+gcU5isMHRj1u0oYE/mWyt/RjA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.7.1/socket.io.min.js" integrity="sha512-+NaO7d6gQ1YPxvc/qHIqZEchjGm207SszoNeMgppoqD/67fEqmc1edS8zrbxPD+4RQI3gDgT/83ihpFW61TG/Q==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/plotly.js/2.24.2/plotly.min.js" integrity="sha512-dAXqGCq94D0kgLSPnfvd/pZpCMoJQpGj2S2XQmFQ9Ay1+96kbjss02ISEh+TBNXMggGg/1qoMcOHcxg+Op/Jmw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/pako/2.1.0/pako_inflate.min.js" integrity="sha512-mlnC6JeOvg9V4vBpWMxGKscsCdScB6yvGVCeFF2plnQMRmwH69s9F8SHPbC0oirqfePmRBhqx2s3Bx7WIvHfWg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
|
|
|
{%- assets
|
|
filters='rjsmin',
|
|
output='gen/app.%(version)s.js',
|
|
'js/nopaque/index.js',
|
|
'js/nopaque/app.js'
|
|
%}
|
|
<script src="{{ ASSET_URL }}"></script>
|
|
{%- endassets %}
|
|
|
|
{%- assets
|
|
filters='rjsmin',
|
|
output='gen/utils.%(version)s.js',
|
|
'js/utils/index.js',
|
|
'js/utils/utils.js'
|
|
%}
|
|
<script src="{{ ASSET_URL }}"></script>
|
|
{%- endassets %}
|
|
|
|
{%- assets
|
|
filters='rjsmin',
|
|
output='gen/cqi.%(version)s.js',
|
|
'js/cqi/index.js',
|
|
'js/cqi/constants.js',
|
|
'js/cqi/errors.js',
|
|
'js/cqi/status.js',
|
|
'js/cqi/api/index.js',
|
|
'js/cqi/api/client.js',
|
|
'js/cqi/models/index.js',
|
|
'js/cqi/models/resource.js',
|
|
'js/cqi/models/attributes.js',
|
|
'js/cqi/models/subcorpora.js',
|
|
'js/cqi/models/corpora.js',
|
|
'js/cqi/client.js'
|
|
%}
|
|
<script src="{{ ASSET_URL }}"></script>
|
|
{%- endassets %}
|
|
|
|
{%- assets
|
|
filters='rjsmin',
|
|
output='gen/Forms.%(version)s.js',
|
|
'js/forms/index.js',
|
|
'js/forms/base-form.js',
|
|
'js/forms/create-contribution-form.js',
|
|
'js/forms/create-corpus-file-form.js',
|
|
'js/forms/create-job-form.js'
|
|
%}
|
|
<script src="{{ ASSET_URL }}"></script>
|
|
{%- endassets %}
|
|
|
|
{%- assets
|
|
filters='rjsmin',
|
|
output='gen/resource-displays.%(version)s.js',
|
|
'js/resource-displays/index.js',
|
|
'js/resource-displays/resource-display.js',
|
|
'js/resource-displays/corpus-display.js',
|
|
'js/resource-displays/job-display.js'
|
|
%}
|
|
<script src="{{ ASSET_URL }}"></script>
|
|
{%- endassets %}
|
|
|
|
{%- assets
|
|
filters='rjsmin',
|
|
output='gen/resource-lists.%(version)s.js',
|
|
'js/resource-lists/index.js',
|
|
'js/resource-lists/resource-list.js',
|
|
'js/resource-lists/admin-user-list.js',
|
|
'js/resource-lists/corpus-file-list.js',
|
|
'js/resource-lists/corpus-follower-list.js',
|
|
'js/resource-lists/corpus-list.js',
|
|
'js/resource-lists/corpus-text-info-list.js',
|
|
'js/resource-lists/corpus-token-list.js',
|
|
'js/resource-lists/detailed-public-corpus-list.js',
|
|
'js/resource-lists/job-input-list.js',
|
|
'js/resource-lists/job-list.js',
|
|
'js/resource-lists/job-result-list.js',
|
|
'js/resource-lists/public-corpus-list.js',
|
|
'js/resource-lists/public-user-list.js',
|
|
'js/resource-lists/spacy-nlp-pipeline-model-list.js',
|
|
'js/resource-lists/tesseract-ocr-pipeline-model-list.js'
|
|
%}
|
|
<script src="{{ ASSET_URL }}"></script>
|
|
{%- endassets %}
|
|
|
|
{%- assets
|
|
filters='rjsmin',
|
|
output='gen/requests.%(version)s.js',
|
|
'js/requests/index.js',
|
|
'js/requests/admin.js',
|
|
'js/requests/contributions.js',
|
|
'js/requests/corpora.js',
|
|
'js/requests/jobs.js',
|
|
'js/requests/users.js'
|
|
%}
|
|
<script src="{{ ASSET_URL }}"></script>
|
|
{%- endassets %}
|
|
|
|
{%- assets
|
|
filters='rjsmin',
|
|
output='gen/CorpusAnalysis.%(version)s.js',
|
|
'js/CorpusAnalysis/query-builder/index.js',
|
|
'js/CorpusAnalysis/query-builder/element-references.js',
|
|
'js/CorpusAnalysis/query-builder/general-query-builder-functions.js',
|
|
'js/CorpusAnalysis/query-builder/structural-attribute-builder-functions.js',
|
|
'js/CorpusAnalysis/query-builder/token-attribute-builder-functions.js',
|
|
'js/CorpusAnalysis/CorpusAnalysisApp.js',
|
|
'js/CorpusAnalysis/CorpusAnalysisConcordance.js',
|
|
'js/CorpusAnalysis/CorpusAnalysisReader.js',
|
|
'js/CorpusAnalysis/CorpusAnalysisStaticVisualization.js'
|
|
%}
|
|
<script src="{{ ASSET_URL }}"></script>
|
|
{%- endassets %}
|
|
|
|
<script>
|
|
// TODO: Implement an app.run method and use this for all of the following
|
|
const app = new nopaque.App();
|
|
app.init();
|
|
|
|
// Check if the current user is authenticated
|
|
{%- if current_user.is_authenticated %}
|
|
// TODO: Set this as a property of the app object
|
|
const currentUserId = {{ current_user.hashid|tojson }};
|
|
|
|
// Subscribe to the current user's data events
|
|
app.subscribeUser(currentUserId)
|
|
.catch((error) => {throw JSON.stringify(error);});
|
|
|
|
// Get the current user's data
|
|
app.getUser(currentUserId, true, true)
|
|
.catch((error) => {throw JSON.stringify(error);});
|
|
|
|
// Check if the current user hasn't accepted the terms of use yet
|
|
{%- if not current_user.terms_of_use_accepted %}
|
|
M.Modal.getInstance(document.querySelector('#terms-of-use-modal')).open();
|
|
{%- endif %}
|
|
{%- endif %}
|
|
|
|
// Display flashed messages
|
|
for (let [category, message] of {{ get_flashed_messages(with_categories=True)|tojson }}) {
|
|
app.flash(message, message);
|
|
}
|
|
</script>
|