Skip to content
Snippets Groups Projects
Commit 7757c12d authored by Patrick Jentsch's avatar Patrick Jentsch
Browse files

Merge branch 'development' of gitlab.ub.uni-bielefeld.de:sfb1288inf/opaque into development

parents 958779ec 64dce7ed
No related branches found
No related tags found
No related merge requests found
......@@ -422,6 +422,7 @@ class CorpusFile(db.Model):
except:
logger.warning('[ERROR] CorpusFile.delete')
return
self.corpus.status = 'unprepared'
db.session.delete(self)
db.session.commit()
......@@ -435,6 +436,8 @@ class CorpusFile(db.Model):
text_node.set('publishing_year', str(self.publishing_year))
text_node.set('title', self.title)
element_tree.write(file)
self.corpus.status = 'unprepared'
db.session.commit()
class Corpus(db.Model):
......
......@@ -61,6 +61,12 @@
statusElement.classList.remove(...Object.values(CorpusList.STATUS_COLORS));
statusElement.classList.add(CorpusList.STATUS_COLORS[status] || CorpusList.STATUS_COLORS['default']);
statusElement.innerText = status;
if (status === 'prepared') {
var analyseBtn = document.getElementById('analyse');
analyseBtn.classList.remove('hide');
var prepareBtn = document.getElementById('prepare');
prepareBtn.classList.add('hide')
}
}
}
......@@ -87,11 +93,9 @@
</div>
</div>
<div class="card-action right-align">
{% if corpus.status == 'prepared' %}
<a href="{{ url_for('corpora.corpus_analysis', corpus_id=corpus.id) }}" class="waves-effect waves-light btn"><i class="material-icons left">help</i>Analyse</a>
{% endif %}
<a href="{{ url_for('corpora.corpus_analysis', corpus_id=corpus.id) }}" class="waves-effect waves-light btn hide" id="analyse"><i class="material-icons left">help</i>Analyse</a>
{% if corpus.files[0] is defined %}
<a href="{{ url_for('corpora.prepare_corpus', corpus_id=corpus.id) }}" class="waves-effect waves-light btn"><i class="material-icons left">whatshot</i>Prepare</a>
<a href="{{ url_for('corpora.prepare_corpus', corpus_id=corpus.id) }}" class="waves-effect waves-light btn" id="prepare"><i class="material-icons left">whatshot</i>Prepare</a>
{% endif %}
<a data-target="delete-corpus-modal" class="waves-effect waves-light btn red modal-trigger"><i class="material-icons left">delete</i>Delete Corpus</a>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment