1
0
Fork 0
mirror of https://codeberg.org/Mo8it/AdvLabDB.git synced 2024-12-04 22:40:30 +00:00

Compare commits

...

6 commits

Author SHA1 Message Date
177927d399 Add repo_url 2022-10-09 03:02:35 +02:00
68335add60 Use base templates 2022-10-09 03:00:51 +02:00
1c8582064a Clean up login_user.html 2022-10-09 03:00:17 +02:00
6fa66912c0 Use render_footer 2022-10-09 02:59:27 +02:00
5d74a7b261 Add render_footer macro 2022-10-09 02:58:58 +02:00
4ba9c3e5bb Add base templates 2022-10-09 02:58:28 +02:00
25 changed files with 91 additions and 104 deletions

View file

@ -1336,7 +1336,7 @@ class ImportView(SecureAdminBaseView):
except Exception as ex:
flash(str(ex), "error")
return self.render("import.jinja.html", form=form)
return self.render("admin_import.jinja.html", form=form)
class ActionsView(SecureAdminBaseView):
@ -1364,7 +1364,7 @@ class ActionsView(SecureAdminBaseView):
return redirect(self.url)
return self.render("actions.jinja.html", form=form)
return self.render("admin_actions.jinja.html", form=form)
class AnalysisView(SecureAdminBaseView):

View file

@ -2,6 +2,7 @@ from flask import Blueprint, redirect, url_for
from flask_login import current_user
from flask_security.decorators import auth_required
from . import settings
from .model_dependent_funs import active_semester_str
bp = Blueprint("main", __name__, root_path="/", template_folder="templates")
@ -10,7 +11,9 @@ bp = Blueprint("main", __name__, root_path="/", template_folder="templates")
@bp.app_context_processor
def util_processor():
author_email = "mobitar@students.uni-mainz.de"
footer = f"<hr><p style='font-size:14px;'>This website is still under development (beta release)! If you have any questions, find any bugs or want some feature, please write a formless email (german/english) to Mo Bitar: <a href='mailto:{author_email}'>{author_email}</a>. Feedback is also welcome :)</p><br>"
repo_url = settings["repo_url"]
footer = f"This website is still under development (beta release)! If you have any questions, find any bugs or want some feature, please write a formless email (german/english) to Mo Bitar: <a href='mailto:{author_email}'>{author_email}</a><br><br>AdvLabDB - <a href={repo_url} target='_blank' rel='noopener noreferrer'>Source code</a>"
return dict(active_semester_str=active_semester_str, current_user=current_user, footer=footer)

View file

@ -1,11 +1,6 @@
{% from "macros.jinja.html" import information %}
{% extends "admin/master.html" %}
{% block body %}
{{ information(current_user, active_semester_str, role="admin") }}
<hr>
{% extends "admin_base.jinja.html" %}
{% block content %}
<form method="POST">
{% for field in form %}
{% if field.widget.input_type == "checkbox" %}
@ -21,6 +16,4 @@
{% endif %}
{% endfor %}
</form>
{{ footer|safe }}
{% endblock body %}
{% endblock %}

View file

@ -0,0 +1,8 @@
{% from "macros.jinja.html" import information %}
{% extends "base.jinja.html" %}
{% block pre_content %}
{{ information(current_user, active_semester_str, role="admin")}}
<hr>
{% endblock %}

View file

@ -1,4 +1,4 @@
{% from "macros.jinja.html" import information %}
{% from "macros.jinja.html" import information, render_footer %}
{% extends "admin/model/create.html" %}
{% block body %}
@ -6,5 +6,5 @@
{{ super() }}
{{ footer|safe }}
{{ render_footer(footer) }}
{% endblock %}

View file

@ -1,4 +1,4 @@
{% from "macros.jinja.html" import information %}
{% from "macros.jinja.html" import information, render_footer %}
{% extends "admin/model/details.html" %}
{% block body %}
@ -6,5 +6,5 @@
{{ super() }}
{{ footer|safe }}
{{ render_footer(footer) }}
{% endblock %}

View file

@ -1,4 +1,4 @@
{% from "macros.jinja.html" import information %}
{% from "macros.jinja.html" import information, render_footer %}
{% extends "admin/model/edit.html" %}
{% block body %}
@ -6,5 +6,5 @@
{{ super() }}
{{ footer|safe }}
{{ render_footer(footer) }}
{% endblock %}

View file

@ -1,11 +1,6 @@
{% from "macros.jinja.html" import information %}
{% extends "admin/master.html" %}
{% block body %}
{{ information(current_user, active_semester_str, role="admin") }}
<hr>
{% extends "admin_base.jinja.html" %}
{% block content %}
{% for error in form.file.errors %}
<div class="alert alert-danger">
<strong>Error!</strong> {{ error }}
@ -243,6 +238,4 @@
<code>assistant_email</code>
</li>
</ul>
{{ footer|safe }}
{% endblock body %}
{% endblock %}

View file

@ -1,11 +1,6 @@
{% from "macros.jinja.html" import information %}
{% extends "admin/index.html" %}
{% block body %}
{{ information(current_user, active_semester_str, role="admin") }}
<hr>
{% extends "admin_base.jinja.html" %}
{% block content %}
<div class="d-inline-flex">
<div class="table">
<table class="table table-bordered">
@ -35,8 +30,4 @@
</table>
</div>
</div>
{{ super() }}
{{ footer|safe }}
{% endblock %}

View file

@ -1,4 +1,4 @@
{% from "macros.jinja.html" import information %}
{% from "macros.jinja.html" import information, render_footer %}
{% extends "admin/model/list.html" %}
{% block body %}
@ -6,5 +6,5 @@
{{ super() }}
{{ footer|safe }}
{{ render_footer(footer) }}
{% endblock %}

View file

@ -1,11 +1,6 @@
{% from "macros.jinja.html" import information %}
{% extends "admin/master.html" %}
{% block body %}
{{ information(current_user, active_semester_str, role="admin")}}
<hr>
{% extends "admin_base.jinja.html" %}
{% block content %}
<form method="POST">
{% for field in form %}
{% if field.widget.input_type == "submit" %}
@ -17,4 +12,4 @@
{% endif %}
{% endfor %}
</form>
{% endblock body %}
{% endblock %}

View file

@ -1,11 +1,6 @@
{% from "macros.jinja.html" import information %}
{% extends "admin/master.html" %}
{% block body %}
{{ information(current_user, active_semester_str, role="admin")}}
<hr>
{% extends "admin_base.jinja.html" %}
{% block content %}
<h2>Assistant's marks analysis</h2>
<p>
@ -38,4 +33,4 @@
<hr>
{% endfor %}
{% endblock body %}
{% endblock %}

View file

@ -1,11 +1,6 @@
{% from "macros.jinja.html" import information %}
{% extends "admin/master.html" %}
{% block body %}
{{ information(current_user, active_semester_str, role="admin")}}
<hr>
{% extends "admin_base.jinja.html" %}
{% block content %}
<h2>Final part marks analysis</h2>
<p>
@ -34,4 +29,4 @@
</div>
<br>
{% endblock body %}
{% endblock %}

View file

@ -0,0 +1,8 @@
{% from "macros.jinja.html" import information %}
{% extends "base.jinja.html" %}
{% block pre_content %}
{{ information(current_user, active_semester_str, role="assistant")}}
<hr>
{% endblock %}

View file

@ -1,4 +1,4 @@
{% from "macros.jinja.html" import information %}
{% from "macros.jinja.html" import information, render_footer %}
{% extends "admin/model/create.html" %}
{% block body %}
@ -6,5 +6,5 @@
{{ super() }}
{{ footer|safe }}
{{ render_footer(footer) }}
{% endblock %}

View file

@ -1,4 +1,4 @@
{% from "macros.jinja.html" import information %}
{% from "macros.jinja.html" import information, render_footer %}
{% extends "admin/model/details.html" %}
{% block body %}
@ -6,5 +6,5 @@
{{ super() }}
{{ footer|safe }}
{{ render_footer(footer) }}
{% endblock %}

View file

@ -1,4 +1,4 @@
{% from "macros.jinja.html" import information %}
{% from "macros.jinja.html" import information, render_footer %}
{% extends "admin/model/edit.html" %}
{% block body %}
@ -6,5 +6,5 @@
{{ super() }}
{{ footer|safe }}
{{ render_footer(footer) }}
{% endblock %}

View file

@ -1,11 +1,6 @@
{% from "macros.jinja.html" import information %}
{% extends "admin/master.html" %}
{% block body %}
{{ information(current_user, active_semester_str, role="assistant") }}
<hr>
{% extends "assistant_base.jinja.html" %}
{% block content %}
<div class="d-inline-flex">
<table class="table table-bordered">
<tbody>
@ -177,6 +172,4 @@
It is for information related to the experiment and group.
Examples: Protocol received, submission until ..., etc.</p>
</font>
{{ footer|safe }}
{% endblock body %}
{% endblock %}

View file

@ -1,16 +1,7 @@
{% from "macros.jinja.html" import information %}
{% extends "admin/index.html" %}
{% block body %}
{{ information(current_user, active_semester_str, role="assistant") }}
<hr>
{% extends "assistant_base.jinja.html" %}
{% block content %}
<p>
Number of <strong>missing</strong> final experiment marks: {{ number_of_missing_final_experiment_marks }}
</p>
{{ super() }}
{{ footer|safe }}
{% endblock %}

View file

@ -1,4 +1,4 @@
{% from "macros.jinja.html" import information %}
{% from "macros.jinja.html" import information, render_footer %}
{% extends "admin/model/list.html" %}
{% block body %}
@ -6,5 +6,5 @@
{{ super() }}
{{ footer|safe }}
{{ render_footer(footer) }}
{% endblock %}

View file

@ -0,0 +1,10 @@
{% from "macros.jinja.html" import render_footer %}
{% extends "admin/master.html" %}
{% block body %}
{% block pre_content %}{% endblock %}
{% block content required %}{% endblock %}
{{ render_footer(footer) }}
{% endblock %}

View file

@ -1,12 +1,12 @@
{% from "macros.jinja.html" import information %}
{% extends "admin/master.html" %}
{% extends "base.jinja.html" %}
{% block body %}
{% block pre_content %}
{{ information(current_user, active_semester_str, role=role) }}
<hr>
{% endblock %}
{% block content %}
{% include "docs/" + role + ".jinja.html" %}
{{ footer|safe }}
{% endblock body %}
{% endblock %}

View file

@ -24,3 +24,13 @@
{% endif %}
</div>
{% endmacro %}
{% macro render_footer(footer) %}
<footer class='container text-center'>
<hr>
<p style='font-size:14px;'>
{{ footer|safe }}
</p>
<br>
</footer>
{% endmacro %}

View file

@ -1,13 +1,13 @@
{% extends "security/base.html" %}
{% from "security/_macros.html" import render_field_with_errors, render_field, render_field_errors, render_form_errors %}
{% from "security/_macros.html" import render_field, render_field_errors, render_form_errors %}
{% block title %}AdvLabDB - Login{% endblock title %}
{% block title %}AdvLabDB - Login{% endblock %}
{% block body_attribs %}
style="
background-image: radial-gradient(#35393b, #181a1b);
"
{% endblock body_attribs %}
{% endblock %}
{% block body %}
<style>
@ -100,4 +100,4 @@
</div>
</div>
</font>
{% endblock body %}
{% endblock %}

View file

@ -1,3 +1,5 @@
[Settings]
repo_url = https://codeberg.org/Mo8it/AdvLabDB
CHECK_EMAIL_DELIVERABILITY = True
SECURITY_PASSWORD_LENGTH_MIN = 15