Начал делать витрину
This commit is contained in:
parent
1a6c69cdc4
commit
c56e0a196e
11
main.py
11
main.py
@ -1,7 +1,6 @@
|
||||
import datetime
|
||||
import os
|
||||
import logging
|
||||
import shutil
|
||||
|
||||
from flask import Flask, render_template, request, url_for
|
||||
from flask_login import login_user, current_user, LoginManager, logout_user, login_required
|
||||
@ -56,6 +55,14 @@ def base():
|
||||
return redirect('/projects')
|
||||
|
||||
|
||||
@app.route('/showcase', methods=['GET', 'POST'])
|
||||
def showcase():
|
||||
if current_user.is_authenticated:
|
||||
return render_template('showcase.html', title='Витрина')
|
||||
else:
|
||||
return redirect('/login')
|
||||
|
||||
|
||||
@app.route('/project/<int:id_project>/quest/<int:id_task>/edit', methods=['GET', 'POST'])
|
||||
def edit_quest(id_project, id_task):
|
||||
if current_user.is_authenticated:
|
||||
@ -232,7 +239,7 @@ def edit_project(id_project):
|
||||
staff = data_session.query(StaffProjects).filter(StaffProjects.project == current_project.id).all()
|
||||
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()))
|
||||
map(lambda x: get_user_data(x), data_session.query(User).filter(User.id != current_user.id, User.activated == 1).all()))
|
||||
staff = list(map(lambda x: get_user_data(x), data_session.query(User).filter(
|
||||
User.id.in_(list(map(lambda x: x.user, staff)))).all())) if staff else []
|
||||
form = ProjectForm()
|
||||
|
||||
4
static/css/showcase.css
Normal file
4
static/css/showcase.css
Normal file
@ -0,0 +1,4 @@
|
||||
.showscale_page {
|
||||
height: 120vw;
|
||||
background-color: #dcb495;
|
||||
}
|
||||
@ -14,13 +14,8 @@
|
||||
</head>
|
||||
<body>
|
||||
<div class="alert alert-danger mess_block" role="alert">
|
||||
<h4 style="text-align:center;">Это деманстрационная версия сайта, пока что мы не рекомендуем сохранять здесь важные данные</h4>
|
||||
<h4 style="text-align:center;">Это демонстрационная версия сайта, пока что мы не рекомендуем сохранять здесь важные данные</h4>
|
||||
</div>
|
||||
<script
|
||||
src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/js/bootstrap.bundle.min.js"
|
||||
integrity="sha384-u1OknCvxWvY5kfmNBILK2hRnQC3Pr17a+RTT6rIHI7NnikvbZlHgTPOOmMi466C8"
|
||||
crossorigin="anonymous"
|
||||
></script>
|
||||
{% if current_user.is_authenticated %}
|
||||
<nav class="navbar">
|
||||
<div class="nav_panel">
|
||||
@ -57,5 +52,10 @@
|
||||
<strong class="footer_rights">© All rights reserved</strong>
|
||||
</div>
|
||||
</footer>
|
||||
<script
|
||||
src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/js/bootstrap.bundle.min.js"
|
||||
integrity="sha384-u1OknCvxWvY5kfmNBILK2hRnQC3Pr17a+RTT6rIHI7NnikvbZlHgTPOOmMi466C8"
|
||||
crossorigin="anonymous"
|
||||
></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
6
templates/showcase.html
Normal file
6
templates/showcase.html
Normal file
@ -0,0 +1,6 @@
|
||||
<link rel="stylesheet" href="../static/css/showcase.css"/>
|
||||
{% extends "base.html" %} {% block content %}
|
||||
<div class="showscale_page">
|
||||
s
|
||||
</div>
|
||||
{% endblock %}
|
||||
Loading…
x
Reference in New Issue
Block a user