Added route prefix support.

This commit is contained in:
mihasinkec 2022-11-06 13:51:12 +01:00
parent f671c365a3
commit 10e8116d83
12 changed files with 227 additions and 218 deletions

View File

@ -13,6 +13,5 @@ WORKDIR /usr/src/portal-webapp
RUN apt-get update && apt-get -y install wkhtmltopdf && \
rm -rf /var/lib/apt/lists/*
RUN pip3 install --no-cache-dir pdfkit flask==1.1.4 flask-dropzone flask-log-request-id flask-login Flask-SQLAlchemy alembic flask-migrate==2.7.0 Flask-script psycopg2 gunicorn pdfkit Werkzeug==1.0.1 PyJWT
RUN pip3 install --no-cache-dir pdfkit markupsafe==2.0.1 flask==1.1.4 flask-dropzone flask-log-request-id flask-login Flask-SQLAlchemy==2.5.1 alembic flask-migrate==2.7.0 Flask-script psycopg2 gunicorn pdfkit Werkzeug==1.0.1 PyJWT
ENTRYPOINT ["./entrypoint.sh"]

217
app.py
View File

@ -27,6 +27,7 @@ config.read('config.ini')
config = config['DEFAULT']
SERVER_NAME = config['SERVER_NAME']
ROUTE_PREFIX = config['ROUTE_PREFIX']
MAIL_HOST = config['MAIL_HOST']
MAIL_LOGIN = config['MAIL_LOGIN']
MAIL_PASS = config['MAIL_PASS']
@ -50,6 +51,8 @@ if not UPLOADS_DIR.exists:
# Override configs with environment variables, if set
if 'PORTALDS4DS1_SERVER_NAME' in os.environ:
SERVER_NAME = os.environ['PORTALDS4DS1_SERVER_NAME']
if 'PORTALDS4DS1_ROUTE_PREFIX' in os.environ:
ROUTE_PREFIX = os.environ['PORTALDS4DS1_ROUTE_PREFIX']
if 'PORTALDS4DS1_MAIL_HOST' in os.environ:
MAIL_HOST = os.environ['PORTALDS4DS1_MAIL_HOST']
if 'PORTALDS4DS1_MAIL_LOGIN' in os.environ:
@ -80,7 +83,8 @@ if 'PORTALDS4DS1_SQL_CONN_STR' in os.environ:
######################
app = Flask(__name__)
app = Flask(__name__, static_url_path = ROUTE_PREFIX + '/static')
#app = Flask(__name__)
app.config.update(
SERVER_NAME = SERVER_NAME,
@ -129,11 +133,11 @@ def redirect_url(default='/'):
url_for(default)
@app.route('/')
@app.route(ROUTE_PREFIX + '/')
def index():
if current_user.is_authenticated:
return redirect('/oddaja')
return redirect('/login')
return redirect(ROUTE_PREFIX + '/oddaja/')
return redirect(ROUTE_PREFIX + '/login/')
@login_manager.user_loader
@ -142,17 +146,17 @@ def load_user(user_id):
return user
@app.route('/login')
@app.route(ROUTE_PREFIX + '/login')
def solar_login_get():
return render_template('solar-login.html')
return render_template('solar-login.html', ROUTE_PREFIX=ROUTE_PREFIX)
@app.route('/register')
@app.route(ROUTE_PREFIX + '/register')
def solar_register_get():
return render_template('solar-register.html')
return render_template('solar-register.html', ROUTE_PREFIX=ROUTE_PREFIX)
@app.route('/login', methods=['POST'])
@app.route(ROUTE_PREFIX + '/login', methods=['POST'])
def solar_login_post():
email = request.form.get('email')
password = request.form.get('password')
@ -162,19 +166,19 @@ def solar_login_post():
if not user or not check_password_hash(user.pass_hash, password):
flash('Napačni podatki za prijavo. Poskusite ponovno.')
return redirect('/login')
return redirect(ROUTE_PREFIX + '/login/')
if not user.active:
flash('Vaš uporabniški račun še ni bil aktiviran.')
return redirect('/login')
return redirect(ROUTE_PREFIX + '/login/')
#portal.solar.add_user_session(user.id)
login_user(user, remember=remember)
return redirect('/oddaja')
return redirect(ROUTE_PREFIX + '/oddaja/')
@app.route('/register', methods=['POST'])
@app.route(ROUTE_PREFIX + '/register', methods=['POST'])
def solar_register_post():
name = request.form.get('name')
email = request.form.get('email')
@ -187,38 +191,38 @@ def solar_register_post():
if user:
flash('Uporabniški račun s tem emailom je že registriran.')
return redirect('/register')
return redirect(ROUTE_PREFIX + '/register/')
if not name:
flash('Prazno polje za ime.')
return redirect('/register')
return redirect(ROUTE_PREFIX + '/register/')
if len(name) > 100:
flash('Predolgo ime.')
return redirect('/register')
return redirect(ROUTE_PREFIX + '/register/')
if not email:
flash('Prazno polje za elektronsko pošto.')
return redirect('/register')
return redirect(ROUTE_PREFIX + '/register/')
if len(email) > 100:
flash('Predolgi email naslov')
return redirect('/register')
return redirect(ROUTE_PREFIX + '/register/')
elif not re.search(portal.solar.REGEX_EMAIL, email):
flash('Email napačnega formata.')
return redirect('/register')
return redirect(ROUTE_PREFIX + '/register/')
if not password:
flash('Prazno polje za geslo.')
return redirect('/register')
return redirect(ROUTE_PREFIX + '/register/')
if len(password) < 8:
flash('Geslo mora biti vsaj 8 znakov dolgo.')
return redirect('/register')
return redirect(ROUTE_PREFIX + '/register/')
if len(password) > 100:
flash('Predolgo geslo.')
return redirect('/register')
return redirect(ROUTE_PREFIX + '/register/')
if institution_role not in ['coordinator', 'mentor', 'other']:
flash('Neveljavna vloga v instituciji.')
return redirect('/register')
return redirect(ROUTE_PREFIX + '/register/')
if not institution:
institution_id = portal.solar.add_institution(institution_name, "")
@ -234,17 +238,17 @@ def solar_register_post():
portal.solar.send_admins_new_user_notification_mail(user_id, upload_handler_solar.config)
flash('Podatki so bili poslani v potrditev. Ko bo registracija potrjena, boste o tem obveščeni po e-mailu.')
return redirect('/login')
return redirect(ROUTE_PREFIX + '/login/')
@app.route('/logout')
@app.route(ROUTE_PREFIX + '/logout')
@login_required
def logout():
logout_user()
return redirect('/login')
return redirect(ROUTE_PREFIX + '/login/')
@app.route('/<path:text>')
@app.route(ROUTE_PREFIX + '/<path:text>')
@login_required
def solar(text):
is_admin = current_user.role == 'admin'
@ -259,6 +263,7 @@ def solar(text):
if text.startswith('oddaja/') or text == 'oddaja':
return render_template('solar-oddaja.html',
ROUTE_PREFIX=ROUTE_PREFIX,
is_admin=is_admin,
institution=current_user_institution,
institution_contract=institution_contract,
@ -277,7 +282,8 @@ def solar(text):
else:
institution_names.append(institution.name)
return render_template('solar-zgodovina.html', upload_history=upload_items, uploader_names=uploader_names,
institution_names=institution_names, is_admin=is_admin, is_institution_coordinator=current_user_institution_coordinator)
institution_names=institution_names, is_admin=is_admin, is_institution_coordinator=current_user_institution_coordinator,
ROUTE_PREFIX=ROUTE_PREFIX)
elif text.startswith('pogodbe-institucije/') or text.startswith('pogodbe-ucencistarsi/'):
# Check for download contract request.
match = re.match('^pogodbe-(institucije|ucencistarsi)/([a-z0-9_]+\.pdf)$', text)
@ -321,7 +327,9 @@ def solar(text):
else:
contracts_students = portal.solar.get_institution_student_contracts(current_user_institution.id, current_user_obj.id)
return render_template('solar-pogodbe.html', contracts_students=contracts_students,
return render_template('solar-pogodbe.html',
ROUTE_PREFIX=ROUTE_PREFIX,
contracts_students=contracts_students,
contract_school=contract_school,
enable_upload_school_contract=enable_upload_school_contract,
show_upload_form=show_upload_form,
@ -336,7 +344,7 @@ def solar(text):
solar_institutions = portal.solar.get_all_institutions()
uploads = portal.solar.get_all_upload_history(-1)
if is_admin:
return render_template('solar-admin.html', users=users,
return render_template('solar-admin.html', ROUTE_PREFIX=ROUTE_PREFIX, users=users,
institutions=solar_institutions, inactive_users=inactive_users, uploads=uploads)
elif text.startswith('manage-institution/') or text == 'manage-institution':
if portal.solar.is_institution_coordinator(current_user.id, current_user_institution.id):
@ -348,21 +356,22 @@ def solar(text):
role_map[institution_user.id] = portal.solar.get_user_institution_role_str(institution_user.id, current_user_institution.id)
return render_template('solar-manage-institution.html',
ROUTE_PREFIX=ROUTE_PREFIX,
institution=current_user_institution,
users=solar_users,
institution_users=institution_users,
role_map=role_map)
return '', 404
@app.route('/pogodbe', methods=['POST'])
@app.route(ROUTE_PREFIX + '/pogodbe', methods=['POST'])
@login_required
def solar_upload_contract():
msg = upload_handler_solar.handle_contract_upload(request, current_user.get_id())
flash(msg)
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
@app.route('/adduser', methods=['POST'])
@app.route(ROUTE_PREFIX + '/adduser', methods=['POST'])
@login_required
def solar_add_user():
@ -375,41 +384,41 @@ def solar_add_user():
if not name:
flash('Prazno polje za ime.')
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
if len(name) > 100:
flash('Predolgo ime.')
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
if not email:
flash('Prazno polje za elektronsko pošto.')
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
if len(email) > 100:
flash('Predolg email naslov.')
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
elif not re.search(portal.solar.REGEX_EMAIL, email):
flash('Email napačnega formata.')
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
if not password:
flash('Prazno polje za geslo.')
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
if len(password) > 100:
flash('Predolgo geslo.')
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
user = portal.solar.get_user_obj_by_email(email)
if user:
#portal.solar.undo_remove_user(user.id)
flash('Uporabnik s tem emailom je že vnešen v sistem.')
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
portal.solar.register_new_user(name, email, password)
flash('Uporabnik je bil uspešno dodan.')
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
@app.route('/activateuser', methods=['POST'])
@app.route(ROUTE_PREFIX + '/activateuser', methods=['POST'])
@login_required
def solar_activate_user():
if not portal.solar.is_admin(current_user.id):
@ -418,7 +427,7 @@ def solar_activate_user():
user_id = request.form.get('id')
if not user_id:
flash('Prazno polje za ID uporabnika.')
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
rowcount = portal.solar.activate_user(user_id)
if rowcount == 0:
@ -427,35 +436,35 @@ def solar_activate_user():
portal.solar.send_user_activation_mail(user_id, upload_handler_solar.config)
flash('Uporabnik je bil aktiviran.')
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
@app.route('/forgotpass')
@app.route(ROUTE_PREFIX + '/forgotpass')
def solar_forgotpass():
return render_template('solar-forgotpass.html')
return render_template('solar-forgotpass.html', ROUTE_PREFIX=ROUTE_PREFIX)
@app.route('/sendresetpass', methods=['POST'])
@app.route(ROUTE_PREFIX + '/sendresetpass', methods=['POST'])
def solar_sendresetpass():
email = request.form.get('email')
portal.solar.send_resetpass_mail(email, upload_handler_solar.config)
flash('Povezava za ponastavitev gesla je bila poslana na vpisani e-naslov.')
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
@app.route('/resetpass/<token>')
@app.route(ROUTE_PREFIX + '/resetpass/<token>')
def solar_resetpass(token):
user = portal.solar.verify_reset_token(token, upload_handler_solar.config['APP_SECRET_KEY'])
if not user:
return '', 404
return render_template('solar-resetpass.html', user=user, token=token)
return render_template('solar-resetpass.html',ROUTE_PREFIX=ROUTE_PREFIX, user=user, token=token)
@app.route('/resetpass/<token>', methods=['POST'])
@app.route(ROUTE_PREFIX + '/resetpass/<token>', methods=['POST'])
def solar_resetpass_post(token):
new_password = request.form.get('new_password')
user = portal.solar.verify_reset_token(token, upload_handler_solar.config['APP_SECRET_KEY'])
@ -468,28 +477,28 @@ def solar_resetpass_post(token):
return '', 404
flash('Ponastavitev gesla je bila uspešna.')
return redirect('/login')
return redirect(ROUTE_PREFIX + '/login/')
@app.route('/topuploads')
@app.route(ROUTE_PREFIX + '/topuploads')
@login_required
def solar_topuploads():
return jsonify(portal.solar.get_top_uploading_institutions())
@app.route('/topuploads-institution/<institution_id>')
@app.route(ROUTE_PREFIX + '/topuploads-institution/<institution_id>')
@login_required
def solar_topuploads_institution(institution_id):
return jsonify(portal.solar.get_top_uploading_users(institution_id))
@app.route('/uploadstats-institution/<institution_id>')
@app.route(ROUTE_PREFIX + '/uploadstats-institution/<institution_id>')
@login_required
def solar_uploadstats_institution(institution_id):
return jsonify(portal.solar.get_institution_upload_stats(institution_id))
@app.route('/deluser', methods=['POST'])
@app.route(ROUTE_PREFIX + '/deluser', methods=['POST'])
@login_required
def solar_del_user():
if not portal.solar.is_admin(current_user.id):
@ -497,9 +506,9 @@ def solar_del_user():
user_id = request.form.get('user_id')
portal.solar.remove_user(user_id)
flash('Uporabnik je bil odstranjen.')
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
@app.route('/addinstitution', methods=['POST'])
@app.route(ROUTE_PREFIX + '/addinstitution', methods=['POST'])
@login_required
def add_institution():
if not portal.solar.is_admin(current_user.id):
@ -510,21 +519,21 @@ def add_institution():
if not name:
flash('Prazno polje za naziv.')
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
if len(name) > 100:
flash('Predolgo ime.')
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
if not region in portal.solar.VALID_REGIONS:
flash('Neveljavna vrednost za regijo.')
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
institution_id = portal.solar.add_institution(name, region)
portal.solar.grant_institution_corpus_access(institution_id, "solar") # TODO: throw out
flash('Institucija je bila dodana.')
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
@app.route('/mergeinstitutions', methods=['POST'])
@app.route(ROUTE_PREFIX + '/mergeinstitutions', methods=['POST'])
@login_required
def merge_institutions():
if not portal.solar.is_admin(current_user.id):
@ -535,18 +544,18 @@ def merge_institutions():
if not id_from or not id_to:
flash('Prazno polje.')
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
institution_from = portal.solar.get_institution_obj(id_from)
institution_to = portal.solar.get_institution_obj(id_to)
if not institution_from:
flash('Institucija z ID "{}" ne obstaja.'.format(id_from))
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
if not institution_to:
flash('Institucija z ID "{}" ne obstaja.'.format(id_to))
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
portal.solar.transfer_users_institution(institution_from.id, institution_to.id)
@ -555,9 +564,9 @@ def merge_institutions():
portal.solar.remove_institution(institution_from.id)
flash('Instituciji uspešno združeni')
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
#@app.route('/addcooperationhistoryitem', methods=['POST'])
#@app.route(ROUTE_PREFIX + '/addcooperationhistoryitem', methods=['POST'])
#@login_required
#def add_cooperation_history_item():
# if not portal.solar.is_admin(current_user.id):
@ -574,26 +583,26 @@ def merge_institutions():
#
# if not user:
# flash('Uporabnik s tem ID-jem ne obstaja.')
# return redirect(redirect_url())
# return redirect(ROUTE_PREFIX + redirect_url())
#
# if not institution:
# flash('Institucija s tem ID-jem ne obstaja.')
# return redirect(redirect_url())
# return redirect(ROUTE_PREFIX + redirect_url())
#
# if not role in ['coordinator', 'mentor', 'other']:
# flash('Neveljavna vloga "{}".'.format(role))
# return redirect(redirect_url())
# return redirect(ROUTE_PREFIX + redirect_url())
#
# if not school_year or not re.match('[0-9]{4}/[0-9]{2}', school_year):
# flash('Šolsko leto mora biti formata "2021/22".')
# return redirect(redirect_url())
# return redirect(ROUTE_PREFIX + redirect_url())
#
# portal.solar.add_cooperation_history_item(user_id, institution_id, role, school_year, badge_text)
#
# flash('Vnos dodan.')
# return redirect(redirect_url())
# return redirect(ROUTE_PREFIX + redirect_url())
@app.route('/updateuploaditem', methods=['POST'])
@app.route(ROUTE_PREFIX + '/updateuploaditem', methods=['POST'])
@login_required
def update_upload_item():
if not portal.solar.is_admin(current_user.id):
@ -602,7 +611,7 @@ def update_upload_item():
err_msg = portal.solar.UploadHandlerSolar.check_form(request.form)
if err_msg:
flash(err_msg)
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
item_id = request.form.get('item-id')
program = request.form.get('program')
@ -629,10 +638,10 @@ def update_upload_item():
return '', 404
flash('Vnos spremenjen.')
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
#@app.route('/delcooperationhistoryitem', methods=['POST'])
#@app.route(ROUTE_PREFIX + '/delcooperationhistoryitem', methods=['POST'])
#@login_required
#def del_cooperation_history_item():
# if not portal.solar.is_admin(current_user.id):
@ -642,9 +651,9 @@ def update_upload_item():
# portal.solar.del_cooperation_history_item(entry_id)
#
# flash('Vnos odstranjen.')
# return redirect(redirect_url())
# return redirect(ROUTE_PREFIX + redirect_url())
@app.route('/changeinstitutiondata', methods=['POST'])
@app.route(ROUTE_PREFIX + '/changeinstitutiondata', methods=['POST'])
@login_required
def change_institution_data():
if not portal.solar.is_admin(current_user.id):
@ -656,21 +665,21 @@ def change_institution_data():
if not new_name:
flash('Prazno polje za naziv.')
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
if len(new_name) > 100:
flash('Predolgo ime.')
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
if not new_region in portal.solar.VALID_REGIONS:
flash('Neveljavna vrednost za regijo.')
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
portal.solar.update_institution_data(institution_id, new_name, new_region)
flash('Podatki institucije so bili spremenjeni.')
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
@app.route('/changeuseremail', methods=['POST'])
@app.route(ROUTE_PREFIX + '/changeuseremail', methods=['POST'])
@login_required
def change_user_email():
if not portal.solar.is_admin(current_user.id):
@ -681,14 +690,14 @@ def change_user_email():
if not re.search(portal.solar.REGEX_EMAIL, email):
flash('Email napačnega formata.')
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
portal.solar.update_user_email(user_id, email)
flash('Email spremenjen.')
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
@app.route('/changeuserrole-institution', methods=['POST'])
@app.route(ROUTE_PREFIX + '/changeuserrole-institution', methods=['POST'])
@login_required
def change_user_role_institution():
institution = portal.solar.get_user_institution(current_user.id)
@ -705,16 +714,16 @@ def change_user_role_institution():
if role not in ['coordinator', 'mentor', 'other']:
flash('Neveljavna vloga.')
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
portal.solar.update_user_institution_role(user_id, institution.id, role)
portal.solar.add_cooperation_history_item(user_id, institution.id, role)
flash('Vloga v instituciji spremenjena.')
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
@app.route('/changeuserrole', methods=['POST'])
@app.route(ROUTE_PREFIX + '/changeuserrole', methods=['POST'])
@login_required
def change_user_role():
institution = portal.solar.get_user_institution(current_user.id)
@ -726,14 +735,14 @@ def change_user_role():
if not role in ['admin', 'user']:
flash('Neveljavna vloga.')
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
portal.solar.update_user_role(user_id, role)
flash('Vloga spremenjena.')
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
@app.route('/changeusername', methods=['POST'])
@app.route(ROUTE_PREFIX + '/changeusername', methods=['POST'])
@login_required
def change_user_name():
if not portal.solar.is_admin(current_user.id):
@ -745,9 +754,9 @@ def change_user_name():
portal.solar.update_user_name(user_id, name)
flash('Ime in priimek spremenjena.')
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
@app.route('/addusertoinstitution', methods=['POST'])
@app.route(ROUTE_PREFIX + '/addusertoinstitution', methods=['POST'])
@login_required
def add_user_institution_mapping():
institution_id = request.form.get('institution_id')
@ -766,39 +775,39 @@ def add_user_institution_mapping():
if portal.solar.get_user_institution(user_id):
flash('Uporabnik je že dodeljen instituciji.')
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
portal.solar.add_user_to_institution(user_id, institution_id, role)
portal.solar.add_cooperation_history_item(user_id, institution_id, role)
flash('Uporabnik je bil dodeljen instituciji.')
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
@app.route('/deluserfrominstitution', methods=['POST'])
@app.route(ROUTE_PREFIX + '/deluserfrominstitution', methods=['POST'])
@login_required
def del_user_institution_mapping():
user_id = request.form['user_id']
institution = portal.solar.get_user_institution(user_id)
if not institution:
flash('Uporabnik ni član nobene institucije.')
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
if not portal.solar.is_admin(current_user.id) \
and not portal.solar.is_institution_coordinator(current_user.id, institution.id):
flash('Nimate ustreznih pravic za odstranitev uporabnika iz institucije.')
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
portal.solar.del_user_from_institution(user_id, institution.id)
flash('Uporabnik je bil odstranjen iz institucije.')
return redirect(redirect_url())
return redirect(ROUTE_PREFIX + redirect_url())
@app.route('/upload', methods=['POST'])
@app.route(ROUTE_PREFIX + '/upload', methods=['POST'])
def handle_upload():
if not current_user.is_authenticated:
return '', 404
return upload_handler_solar.handle_upload(request, current_user.get_id())
@app.route('/getuploadfile/<upload_id>/<file_hash>', methods=['GET'])
@app.route(ROUTE_PREFIX + '/getuploadfile/<upload_id>/<file_hash>', methods=['GET'])
@login_required
def get_upload_file(upload_id, file_hash):
is_admin = current_user.role == 'admin'

View File

@ -1,5 +1,6 @@
[DEFAULT]
SERVER_NAME=localhost:5000
ROUTE_PREFIX=
SQL_CONN_STR=postgresql://portal:randompass123@localhost/portal
MAIL_HOST=posta.cjvt.si
MAIL_LOGIN=oddaja-besedil@cjvt.si

View File

@ -3,10 +3,10 @@
<head>
<meta charset="UTF-8">
<title>Admin panel - Šolar</title>
<link rel="stylesheet" href="../static/css/header.css" type="text/css">
<link rel="stylesheet" href="../static/css/form.css" type="text/css">
<link rel="stylesheet" href="../static/css/simple-grid.css" type="text/css">
<link rel="stylesheet" href="../static/css/manage-institution.css" type="text/css">
<link rel="stylesheet" href="{{ROUTE_PREFIX}}/static/css/header.css" type="text/css">
<link rel="stylesheet" href="{{ROUTE_PREFIX}}/static/css/form.css" type="text/css">
<link rel="stylesheet" href="{{ROUTE_PREFIX}}/static/css/simple-grid.css" type="text/css">
<link rel="stylesheet" href="{{ROUTE_PREFIX}}/static/css/manage-institution.css" type="text/css">
<style>
.tableFixHead {
overflow-y: scroll;
@ -35,16 +35,16 @@
</head>
<body>
<header>
<div class="logo"><a href="../"><img src="../static/image/logo-white.svg"/></a></div>
<div class="logo"><a href="{{ROUTE_PREFIX}}/"><img src="{{ROUTE_PREFIX}}/static/image/logo-white.svg"/></a></div>
<div class="menu-items">
{% if is_institution_coordinator %}
<a href="../manage-institution">Upravljaj z institucijo</a>
<a href="{{ROUTE_PREFIX}}/manage-institution">Upravljaj z institucijo</a>
{% endif %}
{% if is_admin %}
<a href="../admin">Administracijski meni</a>
<a href="{{ROUTE_PREFIX}}/admin">Administracijski meni</a>
{% endif %}
<a href="https://slovenscina.eu/" target="_blank">Več informacij</a>
<a href="../logout">Odjava</a>
<a href="{{ROUTE_PREFIX}}/logout">Odjava</a>
</div>
</header>
<div class="container" style="margin-top:8rem;">
@ -82,7 +82,7 @@
</table>
</div>
<h3>Dodaj uporabnika</h3>
<form action="../adduser" method="post">
<form action="{{ROUTE_PREFIX}}/adduser" method="post">
<label for="name">Ime in priimek:</label><br>
<input type="text" id="name" name="name"><br>
<label for="email">Email:</label><br>
@ -92,7 +92,7 @@
<input type="submit" value="Dodaj">
</form>
<h3>Spremeni email uporabnika</h3>
<form action="../changeuseremail" method="post">
<form action="{{ROUTE_PREFIX}}/changeuseremail" method="post">
<label for="user-id">ID uporabnika:</label><br>
<input type="text" id="user-id" name="user-id"><br>
<label for="email">Nov email:</label><br>
@ -100,7 +100,7 @@
<input type="submit" value="Spremeni">
</form>
<h3>Spremeni ime in priimek uporabnika</h3>
<form action="../changeusername" method="post">
<form action="{{ROUTE_PREFIX}}/changeusername" method="post">
<label for="user-id">ID uporabnika:</label><br>
<input type="text" id="user-id" name="user-id"><br>
<label for="name">Ime in priimek:</label><br>
@ -108,13 +108,13 @@
<input type="submit" value="Spremeni">
</form>
<h3>Odstrani uporabnika</h3>
<form action="../deluser" method="post">
<form action="{{ROUTE_PREFIX}}/deluser" method="post">
<label for="user_id">ID uporabnika:</label><br>
<input type="text" id="user_id" name="user_id"><br>
<input type="submit" value="Odstrani">
</form>
<h3>Dodeli uporabnika instituciji</h3>
<form action="../addusertoinstitution" method="post">
<form action="{{ROUTE_PREFIX}}/addusertoinstitution" method="post">
<label for="user_id">ID uporabnika:</label>
<input type="text" id="user_id" name="user_id"><br>
<label for="institution_id">ID institucije:</label>
@ -128,13 +128,13 @@
<input type="submit" value="Dodeli">
</form>
<h3>Odstrani uporabnika iz institucije</h3>
<form action="../deluserfrominstitution" method="post">
<form action="{{ROUTE_PREFIX}}/deluserfrominstitution" method="post">
<label for="user_id">ID uporabnika:</label>
<input type="text" id="user_id" name="user_id"><br>
<input type="submit" value="Odstrani">
</form>
<h3>Spremeni vlogo uporabniškega računa</h3>
<form action="../changeuserrole" method="post">
<form action="{{ROUTE_PREFIX}}/changeuserrole" method="post">
<label for="user-id">ID uporabnika:</label>
<input type="text" id="user-id" name="user-id"><br>
<label for="role">Vloga:</label>
@ -166,7 +166,7 @@
<td>{{item[1].institution}}</td>
<td>{{item[1].role}}</td>
<td>
<form action="../activateuser" method="post">
<form action="{{ROUTE_PREFIX}}/activateuser" method="post">
<input type="hidden" id="id" name="id" value="{{item[0].id}}">
<input type="submit" value="Aktiviraj">
</form>
@ -179,7 +179,7 @@
<div> </div>
<h2>Institucije</h2>
<h3>Dodaj institucijo</h3>
<form action="../addinstitution" method="post">
<form action="{{ROUTE_PREFIX}}/addinstitution" method="post">
<label for="name">Naziv:</label>
<input type="text" id="name" name="name"><br>
<label for="region">Regija:</label>
@ -219,7 +219,7 @@
</table>
</div>
<h3>Združi instituciji</h3>
<form action="../mergeinstitutions" method="post">
<form action="{{ROUTE_PREFIX}}/mergeinstitutions" method="post">
<label for="id-from">Institucijo z ID</label>
<input type="text" id="id-from" name="id-from">
<label for="id-to">združi v institucijo z ID</label>
@ -227,7 +227,7 @@
<input type="submit" value="Združi">
</form>
<h3>Spremeni podatke institucije</h3>
<form action="../changeinstitutiondata" method="post">
<form action="{{ROUTE_PREFIX}}/changeinstitutiondata" method="post">
<label for="id">ID institucije</label>
<input type="text" id="id" name="id"><br>
<label for="name">Nov naziv:</label>
@ -249,7 +249,7 @@
<input type="submit" value="Spremeni">
</form>
<h3>Odstrani vnos</h3>
<form action="../delcooperationhistoryitem" method="post">
<form action="{{ROUTE_PREFIX}}/delcooperationhistoryitem" method="post">
<label for="entry-id">ID vnosa</label>
<input type="text" id="entry-id" name="entry-id"><br>
<input type="submit" value="Odstrani">
@ -295,7 +295,7 @@
</table>
</div>
<h3>Posodobi podatke nalaganja</h3>
<form action="../updateuploaditem" method="post">
<form action="{{ROUTE_PREFIX}}/updateuploaditem" method="post">
<label for="item-id">ID nalaganja</label>
<input type="text" id="item-id" name="item-id"/><br>
<label for="program">Program</label>

View File

@ -3,20 +3,20 @@
<head>
<meta charset="UTF-8">
<title>Portal ŠOLAR</title>
<link rel="stylesheet" href="../static/css/login-styles.css" type="text/css">
<link rel="stylesheet" href="../static/css/utils.css" type="text/css">
<link rel="stylesheet" href="{{ROUTE_PREFIX}}/static/css/login-styles.css" type="text/css">
<link rel="stylesheet" href="{{ROUTE_PREFIX}}/static/css/utils.css" type="text/css">
</head>
<body>
<div class="background">
<div class="panel login-panel">
<div class="panel-logo">
<img src="../static/image/logo.svg" alt="logo"/>
<img src="{{ROUTE_PREFIX}}/static/image/logo.svg" alt="logo"/>
</div>
<h1 class="m-b-3">Pozabljeno geslo - ŠOLAR</h1>
<div>
<form method="POST" action="../sendresetpass" class="m-b-2">
<form method="POST" action="{{ROUTE_PREFIX}}/sendresetpass" class="m-b-2">
<div class="input-wrapper">
<img src="../static/image/user.svg" alt="user" class="input-icon"/>
<img src="{{ROUTE_PREFIX}}/static/image/user.svg" alt="user" class="input-icon"/>
<div class="input-floating-label">
<label>E-mail</label>
<input type="text" name="email">
@ -28,15 +28,15 @@
{% with messages = get_flashed_messages() %}
{% if messages %}
<div class="alert alert-success">
<img src="../static/image/success.svg" alt="alert"/>
<img src="{{ROUTE_PREFIX}}/static/image/success.svg" alt="alert"/>
<p>{{ messages[0] }}</p>
</div>
{% endif %}
{% endwith %}
<div class="back-to-login">
<img src="../static/image/chevron-left.svg"/>
<a href="../login">Nazaj na prijavo</a>
<img src="{{ROUTE_PREFIX}}/static/image/chevron-left.svg"/>
<a href="{{ROUTE_PREFIX}}/login">Nazaj na prijavo</a>
</div>
</div>
</div>

View File

@ -3,14 +3,14 @@
<head>
<meta charset="UTF-8">
<title>Portal ŠOLAR</title>
<link rel="stylesheet" href="../static/css/login-styles.css" type="text/css">
<link rel="stylesheet" href="../static/css/utils.css" type="text/css">
<link rel="stylesheet" href="{{ROUTE_PREFIX}}/static/css/login-styles.css" type="text/css">
<link rel="stylesheet" href="{{ROUTE_PREFIX}}/static/css/utils.css" type="text/css">
</head>
<body>
<div class="background">
<div class="panel login-panel">
<div class="panel-logo">
<img src="../static/image/logo.svg" alt="logo"/>
<img src="{{ROUTE_PREFIX}}/static/image/logo.svg" alt="logo"/>
</div>
<h2 class="text-center">Portal za oddajanje besedil</h2>
<div class="line"></div>
@ -23,41 +23,41 @@
{% if messages %}
{% if "potrditev" in messages[0] or "uspešna" in messages[0] %}
<div class="alert alert-success">
<img src="../static/image/success.svg" alt="alert"/>
<img src="{{ROUTE_PREFIX}}/static/image/success.svg" alt="alert"/>
<p>{{ messages[0] }}</p>
</div>
{% else %}
<div class="alert">
<img src="../static/image/alert.svg" alt="alert"/>
<img src="{{ROUTE_PREFIX}}/static/image/alert.svg" alt="alert"/>
<p>{{ messages[0] }}</p>
</div>
{% endif %}
{% endif %}
{% endwith %}
<div>
<form method="POST" action="../login" class="m-b-2">
<form method="POST" action="{{ROUTE_PREFIX}}/login" class="m-b-2">
<div class="input-wrapper">
<img src="../static/image/user.svg" alt="user" class="input-icon"/>
<img src="{{ROUTE_PREFIX}}/static/image/user.svg" alt="user" class="input-icon"/>
<div class="input-floating-label">
<label>E-mail</label>
<input type="text" name="email">
</div>
</div>
<div class="input-wrapper">
<img src="../static/image/password.svg" alt="user" class="input-icon"/>
<img src="{{ROUTE_PREFIX}}/static/image/password.svg" alt="user" class="input-icon"/>
<div class="input-floating-label">
<label>Geslo</label>
<input type="password" name="password">
</div>
</div>
<a href="../forgotpass" class="a-right m-b-1">Pozabljeno geslo</a>
<a href="{{ROUTE_PREFIX}}/forgotpass" class="a-right m-b-1">Pozabljeno geslo</a>
<button class="btn" style="margin-left: 46px;">PRIJAVA</button>
</form>
</div>
<a href="../register" class="register-button">
<img src="../static/image/register.svg" alt="register"/>
<a href="{{ROUTE_PREFIX}}/register" class="register-button">
<img src="{{ROUTE_PREFIX}}/static/image/register.svg" alt="register"/>
<h3>Registracija</h3>
<p>Še nimate uporabniškega računa? Registrirajte se!</p>
</a>

View File

@ -3,26 +3,26 @@
<head>
<meta charset="UTF-8">
<title>Upravljanje institucije - Šolar</title>
<link rel="stylesheet" href="../static/css/header.css" type="text/css">
<link rel="stylesheet" href="../static/css/form.css" type="text/css">
<link rel="stylesheet" href="../static/css/simple-grid.css" type="text/css">
<link rel="stylesheet" href="../static/css/slovenscina-admin.css" type="text/css">
<link rel="stylesheet" href="../static/css/manage-institution.css" type="text/css">
<link rel="stylesheet" href="{{ROUTE_PREFIX}}/static/css/header.css" type="text/css">
<link rel="stylesheet" href="{{ROUTE_PREFIX}}/static/css/form.css" type="text/css">
<link rel="stylesheet" href="{{ROUTE_PREFIX}}/static/css/simple-grid.css" type="text/css">
<link rel="stylesheet" href="{{ROUTE_PREFIX}}/static/css/slovenscina-admin.css" type="text/css">
<link rel="stylesheet" href="{{ROUTE_PREFIX}}/static/css/manage-institution.css" type="text/css">
</head>
<body>
<header>
<div class="logo"><a href="../"><img src="../static/image/logo-white.svg"/></a></div>
<div class="logo"><a href="{{ROUTE_PREFIX}}/"><img src="{{ROUTE_PREFIX}}/static/image/logo-white.svg"/></a></div>
<div class="menu-items">
{% if is_institution_coordinator %}
<a href="../manage-institution">Upravljaj z institucijo</a>
<a href="{{ROUTE_PREFIX}}/manage-institution">Upravljaj z institucijo</a>
{% endif %}
{% if is_admin %}
<a href="../admin">Administracijski meni</a>
<a href="{{ROUTE_PREFIX}}/admin">Administracijski meni</a>
{% endif %}
<a href="https://slovenscina.eu/" target="_blank">Več informacij</a>
<a href="../logout">Odjava</a>
<a href="{{ROUTE_PREFIX}}/logout">Odjava</a>
</div>
</header>
<div class="container" style="margin-top:8rem;">
@ -55,7 +55,7 @@
<a href="javascript:void(0);" onclick="toggleEditForm(this)" class="toggle-edit-role">Spremeni</a>
{{role_map[item.id]}}
</div>
<form action="../changeuserrole-institution" method="post" style="display:none;">
<form action="{{ROUTE_PREFIX}}/changeuserrole-institution" method="post" style="display:none;">
<input type="hidden" id="user-id" name="user-id" value="{{item.id}}"/>
<select class="role" name="role">
<option value="coordinator">Koordinator/-ka</option>
@ -66,7 +66,7 @@
</form>
</td>
<td>
<form action="../deluserfrominstitution" method="post">
<form action="{{ROUTE_PREFIX}}/deluserfrominstitution" method="post">
<input type="hidden" id="user_id" name="user_id" value="{{item.id}}">
<input type="submit" value="Odstrani uporabnika">
</form>

View File

@ -3,23 +3,23 @@
<head>
<meta charset="UTF-8">
<title>Portal za oddajanje besedil</title>
<link rel="stylesheet" href="../static/css/header.css" type="text/css">
<link rel="stylesheet" href="../static/css/form.css" type="text/css">
<link rel="stylesheet" href="../static/css/simple-grid.css" type="text/css">
<link rel="stylesheet" href="../static/css/utils.css" type="text/css">
<link rel="stylesheet" href="{{ROUTE_PREFIX}}/static/css/header.css" type="text/css">
<link rel="stylesheet" href="{{ROUTE_PREFIX}}/static/css/form.css" type="text/css">
<link rel="stylesheet" href="{{ROUTE_PREFIX}}/static/css/simple-grid.css" type="text/css">
<link rel="stylesheet" href="{{ROUTE_PREFIX}}/static/css/utils.css" type="text/css">
</head>
<body>
<header>
<div class="logo"><a href="../"><img src="../static/image/logo-white.svg"/></a></div>
<div class="logo"><a href="{{ROUTE_PREFIX}}/"><img src="{{ROUTE_PREFIX}}/static/image/logo-white.svg"/></a></div>
<div class="menu-items">
{% if is_institution_coordinator %}
<a href="../manage-institution">Upravljaj z institucijo</a>
<a href="{{ROUTE_PREFIX}}/manage-institution">Upravljaj z institucijo</a>
{% endif %}
{% if is_admin %}
<a href="../admin">Administracijski meni</a>
<a href="{{ROUTE_PREFIX}}/admin">Administracijski meni</a>
{% endif %}
<a href="https://slovenscina.eu/" target="_blank">Več informacij</a>
<a href="../logout">Odjava</a>
<a href="{{ROUTE_PREFIX}}/logout">Odjava</a>
</div>
</header>
<div class="container" style="margin-top:8rem;">
@ -30,9 +30,9 @@
<div class="tab-nav">
<a href="../oddaja" class="active">Oddaja besedil</a>
<a href="../zgodovina">Zgodovina sodelovanja</a>
<a href="../pogodbe">Ekipa</a>
<a href="{{ROUTE_PREFIX}}/oddaja" class="active">Oddaja besedil</a>
<a href="{{ROUTE_PREFIX}}/zgodovina">Zgodovina sodelovanja</a>
<a href="{{ROUTE_PREFIX}}/pogodbe">Ekipa</a>
</div>
</div>
</div>
@ -43,21 +43,21 @@
<div class="col-6">
{% if not institution %}
<div class="alert">
<img src="../static/image/alert.svg" alt="alert"/>
<img src="{{ROUTE_PREFIX}}/static/image/alert.svg" alt="alert"/>
<p>Niste član nobene institucije!</p>
</div>
{% elif not institution_contract %}
<!--<div class="alert">
<img src="../static/image/alert.svg" alt="alert"/>
<img src="{{ROUTE_PREFIX}}/static/image/alert.svg" alt="alert"/>
<p>Pogodba s šolo še ni naložena!</p>
</div>-->
{% endif %}
<div class="alert" id="error-message">
<img src="../static/image/alert.svg" alt="alert"/>
<img src="{{ROUTE_PREFIX}}/static/image/alert.svg" alt="alert"/>
<p></p>
</div>
<div class="alert alert-success" id="success-message">
<img src="../static/image/success.svg" alt="alert"/>
<img src="{{ROUTE_PREFIX}}/static/image/success.svg" alt="alert"/>
<p></p>
</div>
</div>
@ -271,7 +271,7 @@
<!--{{ dropzone.load_js() }}-->
<script src="../static/dropzone.js"></script>
<script src="{{ROUTE_PREFIX}}/static/dropzone.js"></script>
<script>
/////////////////////////
// Dropzone //
@ -340,7 +340,7 @@
Dropzone.options.myDropzone = { // The camelized version of the ID of the form element
url: "../upload",
url: "{{ROUTE_PREFIX}}/upload",
autoProcessQueue: false,
uploadMultiple: true,
parallelUploads: 20,

View File

@ -3,23 +3,23 @@
<head>
<meta charset="UTF-8">
<title>Portal za oddajanje besedil</title>
<link rel="stylesheet" href="../static/css/header.css" type="text/css">
<link rel="stylesheet" href="../static/css/form.css" type="text/css">
<link rel="stylesheet" href="../static/css/simple-grid.css" type="text/css">
<link rel="stylesheet" href="../static/css/contracts.css" type="text/css">
<link rel="stylesheet" href="{{ROUTE_PREFIX}}/static/css/header.css" type="text/css">
<link rel="stylesheet" href="{{ROUTE_PREFIX}}/static/css/form.css" type="text/css">
<link rel="stylesheet" href="{{ROUTE_PREFIX}}/static/css/simple-grid.css" type="text/css">
<link rel="stylesheet" href="{{ROUTE_PREFIX}}/static/css/contracts.css" type="text/css">
</head>
<body>
<header>
<div class="logo"><a href="../"><img src="../static/image/logo-white.svg"/></a></div>
<div class="logo"><a href="{{ROUTE_PREFIX}}/"><img src="{{ROUTE_PREFIX}}/static/image/logo-white.svg"/></a></div>
<div class="menu-items">
{% if is_institution_coordinator %}
<a href="../manage-institution">Upravljaj z institucijo</a>
<a href="{{ROUTE_PREFIX}}/manage-institution">Upravljaj z institucijo</a>
{% endif %}
{% if is_admin %}
<a href="../admin">Administracijski meni</a>
<a href="{{ROUTE_PREFIX}}/admin">Administracijski meni</a>
{% endif %}
<a href="https://slovenscina.eu/" target="_blank">Več informacij</a>
<a href="../logout">Odjava</a>
<a href="{{ROUTE_PREFIX}}/logout">Odjava</a>
</div>
</header>
<div class="container" style="margin-top:8rem;">
@ -29,9 +29,9 @@
<p class="subtitle"></p>
<div class="tab-nav">
<a href="../oddaja">Oddaja besedil</a>
<a href="../zgodovina">Zgodovina sodelovanja</a>
<a href="../pogodbe" class="active">Ekipa</a>
<a href="{{ROUTE_PREFIX}}/oddaja">Oddaja besedil</a>
<a href="{{ROUTE_PREFIX}}/zgodovina">Zgodovina sodelovanja</a>
<a href="{{ROUTE_PREFIX}}/pogodbe" class="active">Ekipa</a>
</div>
</div>
</div>

View File

@ -3,15 +3,15 @@
<head>
<meta charset="UTF-8">
<title>Portal ŠOLAR</title>
<link rel="stylesheet" href="../static/css/login-styles.css" type="text/css">
<link rel="stylesheet" href="../static/css/utils.css" type="text/css">
<link rel="stylesheet" href="{{ROUTE_PREFIX}}/static/css/login-styles.css" type="text/css">
<link rel="stylesheet" href="{{ROUTE_PREFIX}}/static/css/utils.css" type="text/css">
</head>
<body>
<div class="background">
<div class="panel login-panel">
<div class="panel-logo">
<img src="../static/image/logo.svg" alt="logo"/>
<img src="{{ROUTE_PREFIX}}/static/image/logo.svg" alt="logo"/>
</div>
<h2 class="text-center">Portal za oddajanje besedil</h2>
<div class="line"></div>
@ -23,29 +23,29 @@
{% with messages = get_flashed_messages() %}
{% if messages %}
<div class="alert">
<img src="../static/image/alert.svg" alt="alert"/>
<img src="{{ROUTE_PREFIX}}/static/image/alert.svg" alt="alert"/>
<p>{{ messages[0] }}</p>
</div>
{% endif %}
{% endwith %}
<div>
<form method="POST" action="../register" class="m-b-2">
<form method="POST" action="{{ROUTE_PREFIX}}/register" class="m-b-2">
<div class="input-wrapper">
<img src="../static/image/user.svg" alt="user" class="input-icon"/>
<img src="{{ROUTE_PREFIX}}/static/image/user.svg" alt="user" class="input-icon"/>
<div class="input-floating-label">
<label>Ime in priimek</label>
<input type="name" name="name" autofocus="">
</div>
</div>
<div class="input-wrapper">
<img src="../static/image/user.svg" alt="user" class="input-icon"/>
<img src="{{ROUTE_PREFIX}}/static/image/user.svg" alt="user" class="input-icon"/>
<div class="input-floating-label">
<label>Email</label>
<input type="email" name="email">
</div>
</div>
<div class="input-wrapper">
<img src="../static/image/password.svg" alt="user" class="input-icon"/>
<img src="{{ROUTE_PREFIX}}/static/image/password.svg" alt="user" class="input-icon"/>
<div class="input-floating-label">
<label>Geslo</label>
<input type="password" name="password">
@ -53,14 +53,14 @@
</div>
</div>
<div class="input-wrapper">
<img src="../static/image/user.svg" alt="user" class="input-icon"/>
<img src="{{ROUTE_PREFIX}}/static/image/user.svg" alt="user" class="input-icon"/>
<div class="input-floating-label">
<label>Naziv institucije</label>
<input type="institution" name="institution">
</div>
</div>
<div class="input-wrapper">
<img src="../static/image/password.svg" alt="user" class="input-icon"/>
<img src="{{ROUTE_PREFIX}}/static/image/password.svg" alt="user" class="input-icon"/>
<div class="input-floating-label">
<label>Vloga v instituciji</label>
<select id="role" name="role" >
@ -75,8 +75,8 @@
</div>
<div class="back-to-login">
<img src="../static/image/chevron-left.svg"/>
<a href="../login">Nazaj na prijavo</a>
<img src="{{ROUTE_PREFIX}}/static/image/chevron-left.svg"/>
<a href="{{ROUTE_PREFIX}}/login">Nazaj na prijavo</a>
</div>

View File

@ -3,20 +3,20 @@
<head>
<meta charset="UTF-8">
<title>Portal ŠOLAR</title>
<link rel="stylesheet" href="../static/css/login-styles.css" type="text/css">
<link rel="stylesheet" href="../static/css/utils.css" type="text/css">
<link rel="stylesheet" href="{{ROUTE_PREFIX}}/static/css/login-styles.css" type="text/css">
<link rel="stylesheet" href="{{ROUTE_PREFIX}}/static/css/utils.css" type="text/css">
</head>
<body>
<div class="background">
<div class="panel login-panel">
<div class="panel-logo">
<img src="../static/image/logo.svg" alt="logo"/>
<img src="{{ROUTE_PREFIX}}/static/image/logo.svg" alt="logo"/>
</div>
<h1 class="m-b-3">Ponastavitev gesla - ŠOLAR</h1>
<div>
<form method="POST" action="" class="m-b-2">
<div class="input-wrapper">
<img src="../static/image/password.svg" alt="user" class="input-icon"/>
<img src="{{ROUTE_PREFIX}}/static/image/password.svg" alt="user" class="input-icon"/>
<div class="input-floating-label">
<label>Novo geslo</label>
<input type="password" name="new_password">
@ -29,7 +29,7 @@
{% with messages = get_flashed_messages() %}
{% if messages %}
<div class="alert">
<img src="../static/image/alert.svg" alt="alert"/>
<img src="{{ROUTE_PREFIX}}/static/image/alert.svg" alt="alert"/>
<p>{{ messages[0] }}</p>
</div>
{% endif %}

View File

@ -3,25 +3,25 @@
<head>
<meta charset="UTF-8">
<title>Portal za oddajanje besedil</title>
<!--<link rel="stylesheet" href="../static/style.css" type="text/css">-->
<script src="../static/chart.js"></script>
<link rel="stylesheet" href="../static/css/header.css" type="text/css">
<link rel="stylesheet" href="../static/css/form.css" type="text/css">
<link rel="stylesheet" href="../static/css/simple-grid.css" type="text/css">
<link rel="stylesheet" href="../static/css/history.css" type="text/css">
<!--<link rel="stylesheet" href="{{ROUTE_PREFIX}}/static/style.css" type="text/css">-->
<script src="{{ROUTE_PREFIX}}/static/chart.js"></script>
<link rel="stylesheet" href="{{ROUTE_PREFIX}}/static/css/header.css" type="text/css">
<link rel="stylesheet" href="{{ROUTE_PREFIX}}/static/css/form.css" type="text/css">
<link rel="stylesheet" href="{{ROUTE_PREFIX}}/static/css/simple-grid.css" type="text/css">
<link rel="stylesheet" href="{{ROUTE_PREFIX}}/static/css/history.css" type="text/css">
</head>
<body>
<header>
<div class="logo"><a href="../"><img src="../static/image/logo-white.svg"/></a></div>
<div class="logo"><a href="{{ROUTE_PREFIX}}/"><img src="{{ROUTE_PREFIX}}/static/image/logo-white.svg"/></a></div>
<div class="menu-items">
{% if is_institution_coordinator %}
<a href="../manage-institution">Upravljaj z institucijo</a>
<a href="{{ROUTE_PREFIX}}/manage-institution">Upravljaj z institucijo</a>
{% endif %}
{% if is_admin %}
<a href="../admin">Administracijski meni</a>
<a href="{{ROUTE_PREFIX}}/admin">Administracijski meni</a>
{% endif %}
<a href="https://slovenscina.eu/" target="_blank">Več informacij</a>
<a href="../logout">Odjava</a>
<a href="{{ROUTE_PREFIX}}/logout">Odjava</a>
</div>
</header>
<div class="container" style="margin-top:8rem;">
@ -32,9 +32,9 @@
<div class="tab-nav">
<a href="../oddaja">Oddaja besedil</a>
<a href="../zgodovina" class="active">Zgodovina sodelovanja</a>
<a href="../pogodbe">Ekipa</a>
<a href="{{ROUTE_PREFIX}}/oddaja">Oddaja besedil</a>
<a href="{{ROUTE_PREFIX}}/zgodovina" class="active">Zgodovina sodelovanja</a>
<a href="{{ROUTE_PREFIX}}/pogodbe">Ekipa</a>
</div>
</div>
</div>
@ -133,7 +133,7 @@
<div class="history-item-date">Dodano {{ item.timestamp.strftime('%d. %m. %Y') }}</div>
<div class="history-item-uploader">{{ uploader_names[loop.index - 1] }}</div>
<div class="history-item-filecount">Št. datotek: {{ item.upload_file_hashes|length }}</div>
<div class="history-item-chevron"><img src="../static/image/chevron-down.svg"/></div>
<div class="history-item-chevron"><img src="{{ROUTE_PREFIX}}/static/image/chevron-down.svg"/></div>
<div class="history-item-desc">
{{ item_values | join(" | ") |truncate(120) }}
</div>
@ -150,7 +150,7 @@
{% if item.upload_file_names != None %}
{% for f_name in item.upload_file_names %}
<div class="file-item">
<div class="file-icon"><img src="../static/image/file.svg"/></div>
<div class="file-icon"><img src="{{ROUTE_PREFIX}}/static/image/file.svg"/></div>
<a href="getuploadfile/{{item.id}}/{{item.upload_file_hashes[loop.index - 1]}}" class="file-name" {% if item.upload_file_codes != None %}download="{{item.upload_file_codes[loop.index - 1]}}.{{f_name.split('.')[1]}}"{%endif%}>
{% if item.upload_file_codes != None %}
{{item.upload_file_codes[loop.index - 1]}}.{{f_name.split('.')[1]}}
@ -167,7 +167,7 @@
{% else %}
{% for f_hash in item.upload_file_hashes %}
<div class="file-item">
<div class="file-icon"><img src="../static/image/file.svg"/></div>
<div class="file-icon"><img src="{{ROUTE_PREFIX}}/static/image/file.svg"/></div>
<a href="getuploadfile/{{item.id}}/{{f_hash}}" class="file-name">{{f_hash}}</a>
</div>
{% endfor %}