mirror of
				https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
				synced 2025-10-31 02:32:45 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			146 lines
		
	
	
		
			4.9 KiB
		
	
	
	
		
			Django/Jinja
		
	
	
	
	
	
			
		
		
	
	
			146 lines
		
	
	
		
			4.9 KiB
		
	
	
	
		
			Django/Jinja
		
	
	
	
	
	
| <script src="{{ url_for('static', filename='external/JSON-Patch/js/fast-json-patch.min.js') }}"></script>
 | |
| <script src="{{ url_for('static', filename='external/list.js/js/list.min.js') }}"></script>
 | |
| <script src="{{ url_for('static', filename='external/pako/js/pako_inflate.min.js') }}"></script>
 | |
| <script src="{{ url_for('static', filename='external/plotly.js/js/plotly.min.js') }}"></script>
 | |
| <script src="{{ url_for('static', filename='external/socket.io/js/socket.io.min.js') }}"></script>
 | |
| 
 | |
| {%- assets
 | |
|   filters='rjsmin',
 | |
|   output='gen/app.%(version)s.js',
 | |
|   'js/index.js',
 | |
|   'js/app.js',
 | |
|   'js/utils.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/corpus-analysis.%(version)s.js',
 | |
|   'js/corpus-analysis/index.js',
 | |
|   'js/corpus-analysis/cqi/index.js',
 | |
|   'js/corpus-analysis/cqi/constants.js',
 | |
|   'js/corpus-analysis/cqi/errors.js',
 | |
|   'js/corpus-analysis/cqi/status.js',
 | |
|   'js/corpus-analysis/cqi/api/index.js',
 | |
|   'js/corpus-analysis/cqi/api/client.js',
 | |
|   'js/corpus-analysis/cqi/models/index.js',
 | |
|   'js/corpus-analysis/cqi/models/resource.js',
 | |
|   'js/corpus-analysis/cqi/models/attributes.js',
 | |
|   'js/corpus-analysis/cqi/models/subcorpora.js',
 | |
|   'js/corpus-analysis/cqi/models/corpora.js',
 | |
|   'js/corpus-analysis/cqi/client.js',
 | |
|   'js/corpus-analysis/query-builder/index.js',
 | |
|   'js/corpus-analysis/query-builder/element-references.js',
 | |
|   'js/corpus-analysis/query-builder/query-builder.js',
 | |
|   'js/corpus-analysis/query-builder/structural-attribute-builder-functions.js',
 | |
|   'js/corpus-analysis/query-builder/token-attribute-builder-functions.js',
 | |
|   'js/corpus-analysis/app.js',
 | |
|   'js/corpus-analysis/concordance-extension.js',
 | |
|   'js/corpus-analysis/reader-extension.js',
 | |
|   'js/corpus-analysis/static-visualization-extension.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>
 | |
| 
 | |
| <script>
 | |
|   let languageModalSwitch = document.querySelector('#terms-of-use-modal-switch');
 | |
|   let termsOfUseModalContent = document.querySelectorAll('.terms-of-use-modal-content');
 | |
|   if (languageModalSwitch) {
 | |
|     languageModalSwitch.addEventListener('change', function() {
 | |
|       termsOfUseModalContent.forEach(content => {
 | |
|         content.classList.toggle('hide');
 | |
|       });
 | |
|     });
 | |
|   }
 | |
| </script>
 |