mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-24 02:24:20 +00:00
Merge branch 'development' of gitlab.ub.uni-bielefeld.de:sfb1288inf/opaque into development
This commit is contained in:
commit
409d94d0ae
@ -6,6 +6,7 @@ from . import main
|
||||
from .forms import CreateCorpusForm
|
||||
from .. import db
|
||||
from ..models import Corpus, CorpusFile, Job
|
||||
from werkzeug.utils import secure_filename
|
||||
import os
|
||||
import threading
|
||||
|
||||
@ -38,7 +39,7 @@ def corpus(corpus_id):
|
||||
return render_template('main/corpora/corpus.html.j2',
|
||||
corpus=corpus,
|
||||
files=files,
|
||||
title='Corpus')
|
||||
title='Corpus: ' + corpus.title)
|
||||
|
||||
|
||||
@main.route('/corpora/<int:corpus_id>/download')
|
||||
@ -61,6 +62,15 @@ def corpus_download(corpus_id):
|
||||
filename=file)
|
||||
|
||||
|
||||
@main.route('/corpora/<int:corpus_id>/analysis')
|
||||
@login_required
|
||||
def corpus_analysis(corpus_id):
|
||||
corpus = Corpus.query.get_or_404(corpus_id)
|
||||
return render_template('main/corpora/corpus_analysis.html.j2',
|
||||
corpus=corpus,
|
||||
title='Corpus: ' + corpus.title)
|
||||
|
||||
|
||||
@main.route('/dashboard', methods=['GET', 'POST'])
|
||||
@login_required
|
||||
def dashboard():
|
||||
@ -85,15 +95,16 @@ def dashboard():
|
||||
flash('OSError!')
|
||||
else:
|
||||
for file in create_corpus_form.files.data:
|
||||
file.save(os.path.join(dir, file.filename))
|
||||
dir = os.path.join(str(corpus.user_id),
|
||||
'corpora',
|
||||
str(corpus.id))
|
||||
corpus_file = CorpusFile(filename=file.filename,
|
||||
filename = secure_filename(file.filename)
|
||||
file.save(os.path.join(dir, filename))
|
||||
file_dir = os.path.join(str(corpus.user_id),
|
||||
'corpora',
|
||||
str(corpus.id))
|
||||
corpus_file = CorpusFile(filename=filename,
|
||||
corpus_id=corpus.id,
|
||||
dir=dir)
|
||||
dir=file_dir)
|
||||
db.session.add(corpus_file)
|
||||
db.session.commit()
|
||||
db.session.commit()
|
||||
flash('Corpus created!')
|
||||
return redirect(url_for('main.dashboard'))
|
||||
|
||||
|
@ -53,7 +53,6 @@ def service(service_handle):
|
||||
db.session.commit()
|
||||
else:
|
||||
for file in new_job_form.files.data:
|
||||
''' TODO: Use secure filename '''
|
||||
filename = secure_filename(file.filename)
|
||||
file.save(os.path.join(dir, filename))
|
||||
job_input = JobInput(
|
||||
|
@ -73,3 +73,11 @@ indicator will show up how the column is sorted right now.; */
|
||||
top:-10px;
|
||||
right:-5px;
|
||||
}
|
||||
|
||||
/* Sticy side elements */
|
||||
.sticky {
|
||||
position: -webkit-sticky;
|
||||
position: sticky;
|
||||
top: 80px;
|
||||
padding: 50px;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends "base.html.j2" %}
|
||||
{% extends "limited_width.html.j2" %}
|
||||
|
||||
{% block page_content %}
|
||||
<div class="page-header">
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends "base.html.j2" %}
|
||||
{% extends "limited_width.html.j2" %}
|
||||
|
||||
{% block page_content %}
|
||||
<div class="page-header">
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends "base.html.j2" %}
|
||||
{% extends "limited_width.html.j2" %}
|
||||
|
||||
{% block page_content %}
|
||||
<div class="page-header">
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends "base.html.j2" %}
|
||||
{% extends "full_width.html.j2" %}
|
||||
|
||||
{% block page_content %}
|
||||
<div class="col s12">
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends "base.html.j2" %}
|
||||
{% extends "limited_width.html.j2" %}
|
||||
|
||||
{% block page_content %}
|
||||
<div class="col s12 m6">
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends "base.html.j2" %}
|
||||
{% extends "limited_width.html.j2" %}
|
||||
|
||||
{% block page_content %}
|
||||
<div class="col s12 m8">
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends "base.html.j2" %}
|
||||
{% extends "limited_width.html.j2" %}
|
||||
|
||||
{% block page_content %}
|
||||
<div class="col s12 m4">
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends "base.html.j2" %}
|
||||
{% extends "limited_width.html.j2" %}
|
||||
|
||||
{% block page_content %}
|
||||
<div class="col s12 m4">
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends "base.html.j2" %}
|
||||
{% extends "limited_width.html.j2" %}
|
||||
|
||||
{% block page_content %}
|
||||
<div class="col s12 m4">
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends "base.html.j2" %}
|
||||
{% extends "limited_width.html.j2" %}
|
||||
|
||||
{% block page_content %}
|
||||
<div class="col s12 m4">
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends "base.html.j2" %}
|
||||
{% extends "limited_width.html.j2" %}
|
||||
|
||||
{% block title %}Opaque - Confirm your account{% endblock %}
|
||||
|
||||
|
@ -24,8 +24,8 @@
|
||||
{% if current_user.is_dark == True %}
|
||||
DarkReader.enable({
|
||||
brightness: 100,
|
||||
contrast: 90,
|
||||
sepia: 10
|
||||
contrast: 100,
|
||||
sepia: 0
|
||||
});
|
||||
{% else %}
|
||||
DarkReader.disable();
|
||||
@ -182,15 +182,9 @@
|
||||
</header>
|
||||
|
||||
<main class="grey lighten-5">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col s12">
|
||||
<h2>{% if title %}{{ title }}{% else %}Unnamed page{% endif %}</h2>
|
||||
</div>
|
||||
{% block page_content %}
|
||||
{% block main_block %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</main>
|
||||
|
||||
<footer class="page-footer">
|
||||
|
11
app/templates/full_width.html.j2
Normal file
11
app/templates/full_width.html.j2
Normal file
@ -0,0 +1,11 @@
|
||||
{% extends "base.html.j2" %}
|
||||
|
||||
{% block main_block %}
|
||||
<div class="row">
|
||||
<div class="col s12">
|
||||
<h2>{% if title %}{{ title }}{% else %}Unnamed page{% endif %}</h2>
|
||||
</div>
|
||||
{% block page_content %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
{% endblock %}
|
13
app/templates/limited_width.html.j2
Normal file
13
app/templates/limited_width.html.j2
Normal file
@ -0,0 +1,13 @@
|
||||
{% extends "base.html.j2" %}
|
||||
|
||||
{% block main_block %}
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col s12">
|
||||
<h2>{% if title %}{{ title }}{% else %}Unnamed page{% endif %}</h2>
|
||||
</div>
|
||||
{% block page_content %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
@ -1,4 +1,4 @@
|
||||
{% extends "base.html.j2" %}
|
||||
{% extends "limited_width.html.j2" %}
|
||||
|
||||
{% block page_content %}
|
||||
<script>
|
||||
@ -84,6 +84,7 @@
|
||||
<!-- 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>
|
||||
<a href="{{ url_for('main.corpus_analysis', corpus_id=corpus.id) }}" class="waves-effect waves-light btn "><i class="material-icons left">help</i>Analyse</a>
|
||||
<!-- Modal Strucutre -->
|
||||
<div id="modal-confirm-delete" class="modal">
|
||||
<div class="modal-content">
|
||||
|
54
app/templates/main/corpora/corpus_analysis.html.j2
Normal file
54
app/templates/main/corpora/corpus_analysis.html.j2
Normal file
@ -0,0 +1,54 @@
|
||||
{% extends "full_width.html.j2" %}
|
||||
|
||||
{% block page_content %}
|
||||
<div class="col s12 m9 l9">
|
||||
<div class="card">
|
||||
<div class="card-content">
|
||||
<span class="card-title">Query Results</span>
|
||||
<table class="responsive highlight">
|
||||
<tr>
|
||||
<th>Firstname</th>
|
||||
<th>Lastname</th>
|
||||
<th>Age</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jill</td>
|
||||
<td>Smith</td>
|
||||
<td>50</td>
|
||||
</tr>
|
||||
{% for i in range(0,51) %}
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col s12 m3 l3 sticky">
|
||||
<div class="card">
|
||||
<div class="card-content">
|
||||
<span class="card-title">Card Title</span>
|
||||
<table class="responsive highlight">
|
||||
<tr>
|
||||
<th>Firstname</th>
|
||||
<th>Lastname</th>
|
||||
<th>Age</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jill</td>
|
||||
<td>Smith</td>
|
||||
<td>50</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
@ -1,4 +1,4 @@
|
||||
{% extends "base.html.j2" %}
|
||||
{% extends "limited_width.html.j2" %}
|
||||
|
||||
{% block page_content %}
|
||||
<div class="col s12 m4">
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends "base.html.j2" %}
|
||||
{% extends "limited_width.html.j2" %}
|
||||
|
||||
{% block page_content %}
|
||||
<div class="col s12 m4">
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends "base.html.j2" %}
|
||||
{% extends "limited_width.html.j2" %}
|
||||
|
||||
{% block page_content %}
|
||||
<script>
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends "base.html.j2" %}
|
||||
{% extends "limited_width.html.j2" %}
|
||||
|
||||
{% block page_content %}
|
||||
<div class="col s12 m4">
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends "base.html.j2" %}
|
||||
{% extends "limited_width.html.j2" %}
|
||||
|
||||
{% block page_content %}
|
||||
<div class="col s12 m4">
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends "base.html.j2" %}
|
||||
{% extends "limited_width.html.j2" %}
|
||||
|
||||
{% block page_content %}
|
||||
<div class="col s12 m4">
|
||||
|
Loading…
Reference in New Issue
Block a user