mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-06-21 21:40:34 +00:00
Add delete corpora function and function to view an delete foreign jobs and corpora.
This commit is contained in:
@ -2,18 +2,36 @@
|
||||
|
||||
{% block page_content %}
|
||||
<script>
|
||||
var CORPUS_ID = {{ corpus.id }}
|
||||
var corpus_user_id = {{ corpus.user_id|tojson|safe }}
|
||||
socket.emit('inspect_user', {{ corpus_user_id }});
|
||||
</script>
|
||||
<script>
|
||||
var CORPUS_ID = {{ corpus.id|tojson|safe }}
|
||||
var foreignCorpusFlag;
|
||||
{% if current_user.id == corpus.user_id %}
|
||||
foreignCorpusFlag = false;
|
||||
{% else %}
|
||||
foreignCorpusFlag = true;
|
||||
{% endif %}
|
||||
|
||||
class InformationUpdater {
|
||||
constructor(corpusId) {
|
||||
this.corpusId = corpusId;
|
||||
corporaSubscribers.push(this);
|
||||
if (foreignCorpusFlag) {
|
||||
foreignCorpusSubscribers.push(this);
|
||||
} else {
|
||||
corporaSubscribers.push(this);
|
||||
}
|
||||
}
|
||||
|
||||
_init() {
|
||||
var creationDateElement, descriptionElement, titleElement;
|
||||
|
||||
this.corpus = corpora[this.corpusId];
|
||||
if (foreignCorpusFlag) {
|
||||
this.corpus = foreignCorpora[this.corpusId];
|
||||
} else {
|
||||
this.corpus = corpora[this.corpusId];
|
||||
}
|
||||
creationDateElement = document.getElementById("creation-date");
|
||||
creationDateElement.value = (new Date(this.corpus.creation_date * 1000)).toLocaleString();
|
||||
descriptionElement = document.getElementById("description");
|
||||
@ -62,6 +80,21 @@
|
||||
<div class="col s12 m4">
|
||||
<h3 id="title"></h3>
|
||||
<p id="description"></p>
|
||||
<h2>Actions:</h2>
|
||||
<!-- Confirm deletion of job with modal dialogue
|
||||
Modal Trigger-->
|
||||
<a href="#modal-confirm-delete" class="waves-effect waves-light btn red modal-trigger"><i class="material-icons left">delete</i>Delete Corpus</a>
|
||||
<!-- Modal Strucutre -->
|
||||
<div id="modal-confirm-delete" class="modal">
|
||||
<div class="modal-content">
|
||||
<h4>Confirm deletion</h4>
|
||||
<p>Do you really want to delete the Corpus {{corpus.title}}?
|
||||
All files will be permanently deleted.</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a href="{{ url_for('main.delete_corpus', corpus_id=corpus.id) }}" class="modal-close waves-effect waves-green btn red"><i class="material-icons left">delete</i>Delete Corpus</a></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col s12 m8">
|
||||
|
Reference in New Issue
Block a user