mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-06-13 01:20:41 +00:00
Renaming: opaque->nopaque
This commit is contained in:
@ -48,7 +48,7 @@ def register():
|
||||
username=registration_form.username.data)
|
||||
db.session.add(user)
|
||||
db.session.commit()
|
||||
dir = os.path.join(current_app.config['OPAQUE_STORAGE_DIRECTORY'],
|
||||
dir = os.path.join(current_app.config['NOPAQUE_STORAGE'],
|
||||
str(user.id))
|
||||
try:
|
||||
os.makedirs(dir)
|
||||
|
@ -23,7 +23,7 @@ def add_corpus():
|
||||
status='unprepared', title=add_corpus_form.title.data)
|
||||
db.session.add(corpus)
|
||||
db.session.commit()
|
||||
dir = os.path.join(current_app.config['OPAQUE_STORAGE_DIRECTORY'],
|
||||
dir = os.path.join(current_app.config['NOPAQUE_STORAGE'],
|
||||
str(corpus.user_id), 'corpora', str(corpus.id))
|
||||
try:
|
||||
os.makedirs(dir)
|
||||
@ -95,7 +95,7 @@ def add_corpus_file(corpus_id):
|
||||
corpus_id=corpus_id))
|
||||
# Save the file
|
||||
dir = os.path.join(str(corpus.user_id), 'corpora', str(corpus.id))
|
||||
file.save(os.path.join(current_app.config['OPAQUE_STORAGE_DIRECTORY'],
|
||||
file.save(os.path.join(current_app.config['NOPAQUE_STORAGE'],
|
||||
dir, filename))
|
||||
corpus_file = CorpusFile(author=add_corpus_file_form.author.data,
|
||||
corpus=corpus, dir=dir, filename=filename,
|
||||
@ -139,7 +139,7 @@ def download_corpus_file(corpus_id, corpus_file_id):
|
||||
if not (corpus_file.corpus.creator == current_user
|
||||
or current_user.is_administrator()):
|
||||
abort(403)
|
||||
dir = os.path.join(current_app.config['OPAQUE_STORAGE_DIRECTORY'],
|
||||
dir = os.path.join(current_app.config['NOPAQUE_STORAGE'],
|
||||
corpus_file.dir)
|
||||
return send_from_directory(as_attachment=True, directory=dir,
|
||||
filename=corpus_file.filename)
|
||||
|
@ -39,7 +39,7 @@ def download_job_input(job_id, job_input_id):
|
||||
if not (job_input.job.creator == current_user
|
||||
or current_user.is_administrator()):
|
||||
abort(403)
|
||||
dir = os.path.join(current_app.config['OPAQUE_STORAGE_DIRECTORY'],
|
||||
dir = os.path.join(current_app.config['NOPAQUE_STORAGE'],
|
||||
job_input.dir)
|
||||
return send_from_directory(as_attachment=True, directory=dir,
|
||||
filename=job_input.filename)
|
||||
@ -54,7 +54,7 @@ def download_job_result(job_id, job_result_id):
|
||||
if not (job_result.job.creator == current_user
|
||||
or current_user.is_administrator()):
|
||||
abort(403)
|
||||
dir = os.path.join(current_app.config['OPAQUE_STORAGE_DIRECTORY'],
|
||||
dir = os.path.join(current_app.config['NOPAQUE_STORAGE'],
|
||||
job_result.dir)
|
||||
return send_from_directory(as_attachment=True, directory=dir,
|
||||
filename=job_result.filename)
|
||||
|
@ -5,7 +5,7 @@ from . import main
|
||||
|
||||
@main.route('/')
|
||||
def index():
|
||||
return render_template('main/index.html.j2', title='Opaque')
|
||||
return render_template('main/index.html.j2', title='nopaque')
|
||||
|
||||
|
||||
@main.route('/dashboard')
|
||||
|
@ -128,7 +128,7 @@ class User(UserMixin, db.Model):
|
||||
def __init__(self, **kwargs):
|
||||
super(User, self).__init__(**kwargs)
|
||||
if self.role is None:
|
||||
if self.email == current_app.config['OPAQUE_ADMIN']:
|
||||
if self.email == current_app.config['NOPAQUE_ADMIN']:
|
||||
self.role = Role.query.filter_by(name='Administrator').first()
|
||||
if self.role is None:
|
||||
self.role = Role.query.filter_by(default=True).first()
|
||||
@ -213,7 +213,7 @@ class User(UserMixin, db.Model):
|
||||
job.delete()
|
||||
for corpus in self.corpora:
|
||||
corpus.delete()
|
||||
path = os.path.join(current_app.config['OPAQUE_STORAGE_DIRECTORY'],
|
||||
path = os.path.join(current_app.config['NOPAQUE_STORAGE'],
|
||||
str(self.id))
|
||||
try:
|
||||
shutil.rmtree(path)
|
||||
@ -333,7 +333,7 @@ class Job(db.Model):
|
||||
while self.status != 'deleted':
|
||||
sleep(1)
|
||||
db.session.refresh(self)
|
||||
path = os.path.join(current_app.config['OPAQUE_STORAGE_DIRECTORY'],
|
||||
path = os.path.join(current_app.config['NOPAQUE_STORAGE'],
|
||||
str(self.user_id), 'jobs', str(self.id))
|
||||
try:
|
||||
shutil.rmtree(path)
|
||||
@ -377,7 +377,7 @@ class CorpusFile(db.Model):
|
||||
corpus_id = db.Column(db.Integer, db.ForeignKey('corpora.id'))
|
||||
|
||||
def delete(self):
|
||||
path = os.path.join(current_app.config['OPAQUE_STORAGE_DIRECTORY'],
|
||||
path = os.path.join(current_app.config['NOPAQUE_STORAGE'],
|
||||
self.dir, self.filename)
|
||||
try:
|
||||
os.remove(path)
|
||||
@ -390,7 +390,7 @@ class CorpusFile(db.Model):
|
||||
db.session.commit()
|
||||
|
||||
def insert_metadata(self):
|
||||
file = os.path.join(current_app.config['OPAQUE_STORAGE_DIRECTORY'],
|
||||
file = os.path.join(current_app.config['NOPAQUE_STORAGE'],
|
||||
self.dir, self.filename)
|
||||
element_tree = ET.parse(file)
|
||||
text_node = element_tree.find('text')
|
||||
@ -437,7 +437,7 @@ class Corpus(db.Model):
|
||||
def delete(self):
|
||||
for corpus_file in self.files:
|
||||
corpus_file.delete()
|
||||
path = os.path.join(current_app.config['OPAQUE_STORAGE_DIRECTORY'],
|
||||
path = os.path.join(current_app.config['NOPAQUE_STORAGE'],
|
||||
str(self.user_id), 'corpora', str(self.id))
|
||||
try:
|
||||
shutil.rmtree(path)
|
||||
|
@ -45,7 +45,7 @@ def service(service):
|
||||
db.session.commit()
|
||||
relative_dir = os.path.join(str(job.user_id), 'jobs', str(job.id))
|
||||
absolut_dir = os.path.join(
|
||||
current_app.config['OPAQUE_STORAGE_DIRECTORY'], relative_dir)
|
||||
current_app.config['NOPAQUE_STORAGE'], relative_dir)
|
||||
try:
|
||||
os.makedirs(absolut_dir)
|
||||
except OSError:
|
||||
|
@ -3,14 +3,14 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
{% if title %}
|
||||
<title>Opaque – {{ title }}</title>
|
||||
<title>nopaque – {{ title }}</title>
|
||||
{% else %}
|
||||
<title>Opaque</title>
|
||||
<title>nopaque</title>
|
||||
{% endif %}
|
||||
<link href="{{ url_for('static', filename='images/favicon.png') }}" rel="icon" type="image/png">
|
||||
<link type="text/css" rel="stylesheet" href="{{ url_for('static', filename='fonts/material-icons/material-icons.css') }}">
|
||||
<link type="text/css" rel="stylesheet" href="{{ url_for('static', filename='css/materialize.min.css') }}" media="screen,projection"/>
|
||||
<link type="text/css" rel="stylesheet" href="{{ url_for('static', filename='css/opaque.css') }}" media="screen,projection"/>
|
||||
<link type="text/css" rel="stylesheet" href="{{ url_for('static', filename='css/nopaque.css') }}" media="screen,projection"/>
|
||||
<script src="{{ url_for('static', filename='js/add_job.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/jsonpatch.min.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/socket.io.js') }}"></script>
|
||||
@ -111,7 +111,7 @@
|
||||
<div class="navbar-fixed">
|
||||
<nav>
|
||||
<div class="nav-wrapper">
|
||||
<a href="{{ url_for('main.index') }}" class="brand-logo center"><i class="material-icons">opacity</i>Opaque</a>
|
||||
<a href="{{ url_for('main.index') }}" class="brand-logo center"><i class="material-icons">opacity</i>nopaque</a>
|
||||
<a href="#" data-target="slide-out" class="sidenav-trigger"><i class="material-icons">menu</i></a>
|
||||
<ul class="right hide-on-med-and-down">
|
||||
<li><a id="nav-notifications" class="dropdown-trigger no-autoinit" href="#!" data-target="nav-notifications-dropdown"><i class="material-icons">notifications</i></a></li>
|
||||
@ -130,7 +130,7 @@
|
||||
</div>
|
||||
|
||||
<ul id="slide-out" class="sidenav sidenav-fixed">
|
||||
<li><a href="{{ url_for('main.index') }}"><i class="material-icons">opacity</i>Opaque</a></li>
|
||||
<li><a href="{{ url_for('main.index') }}"><i class="material-icons">opacity</i>nopaque</a></li>
|
||||
<li><a href="#"><i class="material-icons">linear_scale</i>Workflow</a></li>
|
||||
<li><a href="{{ url_for('main.dashboard') }}"><i class="material-icons">dashboard</i>Dashboard</a></li>
|
||||
<li><div class="divider"></div></li>
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
{% block page_content %}
|
||||
<div class="col s12 m4">
|
||||
<h3>Opaque?</h3>
|
||||
<h3>nopaque?</h3>
|
||||
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,</p>
|
||||
</div>
|
||||
|
||||
|
Reference in New Issue
Block a user