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

This commit is contained in:
Patrick Jentsch 2019-11-06 10:07:40 +01:00
commit 7757c12dc4
2 changed files with 11 additions and 4 deletions

View File

@ -422,6 +422,7 @@ class CorpusFile(db.Model):
except: except:
logger.warning('[ERROR] CorpusFile.delete') logger.warning('[ERROR] CorpusFile.delete')
return return
self.corpus.status = 'unprepared'
db.session.delete(self) db.session.delete(self)
db.session.commit() db.session.commit()
@ -435,6 +436,8 @@ class CorpusFile(db.Model):
text_node.set('publishing_year', str(self.publishing_year)) text_node.set('publishing_year', str(self.publishing_year))
text_node.set('title', self.title) text_node.set('title', self.title)
element_tree.write(file) element_tree.write(file)
self.corpus.status = 'unprepared'
db.session.commit()
class Corpus(db.Model): class Corpus(db.Model):

View File

@ -61,6 +61,12 @@
statusElement.classList.remove(...Object.values(CorpusList.STATUS_COLORS)); statusElement.classList.remove(...Object.values(CorpusList.STATUS_COLORS));
statusElement.classList.add(CorpusList.STATUS_COLORS[status] || CorpusList.STATUS_COLORS['default']); statusElement.classList.add(CorpusList.STATUS_COLORS[status] || CorpusList.STATUS_COLORS['default']);
statusElement.innerText = status; 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> </div>
<div class="card-action right-align"> <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 hide" id="analyse"><i class="material-icons left">help</i>Analyse</a>
<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 %}
{% if corpus.files[0] is defined %} {% 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 %} {% 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> <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> </div>