mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-25 02:44:18 +00:00
Add prepare button to corpus
This commit is contained in:
parent
787c6e75b3
commit
910a187c04
@ -79,6 +79,18 @@ def corpus_analysis(corpus_id):
|
|||||||
title='Corpus: {}'.format(corpus.title))
|
title='Corpus: {}'.format(corpus.title))
|
||||||
|
|
||||||
|
|
||||||
|
@corpora.route('/<int:corpus_id>/prepare')
|
||||||
|
@login_required
|
||||||
|
def prepare_corpus(corpus_id):
|
||||||
|
corpus = Corpus.query.get_or_404(corpus_id)
|
||||||
|
if not (corpus.creator == current_user or current_user.is_administrator()):
|
||||||
|
abort(403)
|
||||||
|
corpus.status = 'preparable'
|
||||||
|
db.session.commit()
|
||||||
|
flash('Corpus marked for preparation!')
|
||||||
|
return redirect(url_for('corpora.corpus', corpus_id=corpus_id))
|
||||||
|
|
||||||
|
|
||||||
@corpora.route('/<int:corpus_id>/delete')
|
@corpora.route('/<int:corpus_id>/delete')
|
||||||
@login_required
|
@login_required
|
||||||
def delete_corpus(corpus_id):
|
def delete_corpus(corpus_id):
|
||||||
|
@ -21,7 +21,10 @@
|
|||||||
</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"><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 %}
|
||||||
|
<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 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>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user