From ed88142524fb3f64d57871f041cff461bf3d8080 Mon Sep 17 00:00:00 2001 From: Andrei Date: Mon, 27 Feb 2023 23:54:42 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B1=D1=80=D0=B0=D0=BB=20=D0=B2=D0=BE?= =?UTF-8?q?=D0=B7=D0=BC=D0=BE=D0=B6=D0=BD=D0=BE=D1=81=D1=82=D1=8C=20=D1=83?= =?UTF-8?q?=D1=87=D0=B0=D1=81=D1=82=D0=BD=D0=B8=D0=BA=D0=B0=D0=BC=20=D0=BF?= =?UTF-8?q?=D1=80=D0=BE=D0=B5=D0=BA=D1=82=D0=B0=20=D1=80=D0=B5=D0=B4=D0=B0?= =?UTF-8?q?=D0=BA=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D1=82=D1=8C=20=D0=B8?= =?UTF-8?q?=D0=BD=D1=84=D0=BE=D1=80=D0=BC=D0=B0=D1=86=D0=B8=D1=8E=20=D0=BE?= =?UTF-8?q?=20=D0=BD=D0=B5=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 6 +-- static/css/base.css | 1 + templates/base.html | 83 ++++++++++++++++++++++-------------------- templates/profile.html | 2 +- templates/project.html | 4 ++ 5 files changed, 52 insertions(+), 44 deletions(-) diff --git a/main.py b/main.py index d9adbf0..884ae47 100644 --- a/main.py +++ b/main.py @@ -97,11 +97,11 @@ def task_project(id_project, id_task): form = AnswerTask() current_answer = data_session.query(Answer).filter(Answer.quest == current_task.id).first() list_files = None - if form.validate_on_submit(): + if form.submit.data and request.method == 'POST': if form.deadline_date.data and form.deadline_time.data: deadline = datetime.datetime.combine(form.deadline_date.data, form.deadline_time.data) else: - deadline = None + deadline = current_task.deadline current_task.deadline = deadline if current_answer: current_answer.text = form.text.data @@ -201,7 +201,7 @@ def edit_project(id_project): current_project = data_session.query(Projects).filter(Projects.id == id_project).first() if current_project: staff = data_session.query(StaffProjects).filter(StaffProjects.project == current_project.id).all() - if current_user.id == current_project.creator or current_user.id in list(map(lambda x: x.user, staff)): + if current_user.id == current_project.creator: list_users = list( map(lambda x: get_user_data(x), data_session.query(User).filter(User.id != current_user.id).all())) staff = list(map(lambda x: get_user_data(x), data_session.query(User).filter( diff --git a/static/css/base.css b/static/css/base.css index bbce475..ee41eb1 100644 --- a/static/css/base.css +++ b/static/css/base.css @@ -6,6 +6,7 @@ body { min-height: 100%; } .navbar { + margin-top: -1.1vw; background-color: #dcb495; display: inline-flex; height: 8vw; diff --git a/templates/base.html b/templates/base.html index 9fcfaac..cab0da0 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,58 +1,61 @@ - - - + + + - + {{title}} - - - - {% if current_user.is_authenticated %} - +{% endif %} + +
{% block content %}{% endblock %}
+ - + + + diff --git a/templates/profile.html b/templates/profile.html index a57cbe4..bde308f 100644 --- a/templates/profile.html +++ b/templates/profile.html @@ -8,7 +8,7 @@ diff --git a/templates/project.html b/templates/project.html index aef4cdc..1bbe8d3 100644 --- a/templates/project.html +++ b/templates/project.html @@ -8,9 +8,13 @@