правки в верстке, добавлена страница "О нас"

This commit is contained in:
Dinosaur 2022-04-11 20:53:22 +05:00
parent 26f1ab89d6
commit 237dbd031b
8 changed files with 92 additions and 81 deletions

Binary file not shown.

14
main.py
View File

@ -418,15 +418,6 @@ def recovery():
if finish.validate_on_submit(): if finish.validate_on_submit():
db_sess = db_session.create_session() db_sess = db_session.create_session()
user = db_sess.query(User).filter(User.email == user_email).first() user = db_sess.query(User).filter(User.email == user_email).first()
# user2 = User(
# name=user.name,
# surname=user.surname,
# login=user.login,
# age=user.age,
# about=user.about,
# email=user_email,
# photo=user.photo,
# role='user')
user.set_password(finish.password.data) user.set_password(finish.password.data)
user2 = session.merge(user) user2 = session.merge(user)
session.add(user2) session.add(user2)
@ -436,6 +427,11 @@ def recovery():
return render_template('recovery.html', title='Восстановление пароля', form=form, message='', s='1') return render_template('recovery.html', title='Восстановление пароля', form=form, message='', s='1')
@app.route('/about_us')
def about():
return render_template('about.html', title='О нас')
def main(): def main():
db_session.global_init("db/moona_data.db") db_session.global_init("db/moona_data.db")
app.run() app.run()

0
static/css/about.css Normal file
View File

View File

@ -8,12 +8,36 @@ height: 55%;
-webkit-border-radius:22px; -webkit-border-radius:22px;
-moz-border-radius: 22px; -moz-border-radius: 22px;
border-radius: 22px; border-radius: 22px;
border:2px solid #FFFFFF; border:2px solid #ffffff;
margin-top: 20px; margin-top: 20px;
} }
.bad_centre { .bad_centre {
text-align: center; text-align: center;
} }
summary {
margin-bottom: 10px;
}
.pos_emot {
margin-bottom: 10px;
}
.nig_emot {
margin-bottom: 10px;
}
.my_author {
width:148px;
height:44px;
left:255px;
-webkit-border-radius: 22px;
-moz-border-radius: 22px;
border-radius: 22px;
border:2px;
solid #ffffff;
background-color:#1daff0;
top: 98px;
}
.emot {
margin-bottom: 30px;
}
#image { #image {
width: 70%; width: 70%;
} }
@ -91,7 +115,7 @@ margin-left: 10px;
} }
.is_ans { .is_ans {
background-color:#ddefff; background-color:#ddefff;
border:2px solid #FFFFFF; border:2px solid #ffffff;
border-radius: 25px; border-radius: 25px;
} }
.emot_block { .emot_block {

View File

@ -2,10 +2,10 @@
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
width: 50%; width: 50%;
}
.add_q { .add_q {
width: 50%; width: 50%;
} }
}
.h_q { .h_q {
text-align: center; text-align: center;
} }

6
templates/about.html Normal file
View File

@ -0,0 +1,6 @@
<link rel="stylesheet" href="../static/css/about.css">
{% extends "base.html" %}
{% block content %}
{% endblock %}

View File

@ -34,7 +34,7 @@
</a> </a>
</ul> </ul>
<ul class="navbar-nav"> <ul class="navbar-nav">
<a class="navbar-brand" href="/about"> <a class="navbar-brand" href="/about_us">
<h2 style="color:#56a3ff">О нас</h2> <h2 style="color:#56a3ff">О нас</h2>
</a> </a>
</ul> </ul>

View File

@ -31,13 +31,11 @@
<summary class="emot_block"> <summary class="emot_block">
<strong class="emot_block">Позитивные эмоции</strong> <strong class="emot_block">Позитивные эмоции</strong>
</summary> </summary>
<p></p>
{% for item2 in emotion_pub[loop.index0]['pos_emot'] %} {% for item2 in emotion_pub[loop.index0]['pos_emot'] %}
<strong class="alert alert-success" role="alert" style="border-radius: 22px;">{{item2}}</strong> <strong class="alert alert-success" role="alert" style="border-radius: 22px;">{{item2}}</strong>
{% endfor %} {% endfor %}
</details> </details>
</div> </div>
<p></p>
{% endif %} {% endif %}
{% if emotion_pub[loop.index0]['nig_emot'] != None %} {% if emotion_pub[loop.index0]['nig_emot'] != None %}
<div class="nig_emot"> <div class="nig_emot">
@ -51,31 +49,25 @@
{% endfor %} {% endfor %}
</details> </details>
</div> </div>
<p></p>
{% endif %} {% endif %}
{% if item.photo != None %} {% if item.photo != None %}
<p></p>
<div class="photo"> <div class="photo">
<img width="90%" src="{{ item.photo }}" <img width="90%" src="{{ item.photo }}"
style="border-radius: 22px;"> style="border-radius: 22px;">
</div> </div>
<p></p>
{% endif %} {% endif %}
{% if emotion_pub[loop.index0]['link'] != None %} {% if emotion_pub[loop.index0]['link'] != None %}
<details> <details>
<summary class="emot_block"> <summary class="emot_block">
<strong class="emot_block">Ссылки</strong> <strong class="emot_block">Ссылки</strong>
</summary> </summary>
<p></p>
{% for item2 in emotion_pub[loop.index0]['link'] %} {% for item2 in emotion_pub[loop.index0]['link'] %}
<div class="link"> <div class="link">
<a class="alert alert-light" role="alert" href="{{ item2 }}" style="border-radius: 22px;">Ссылка <a class="alert alert-light" role="alert" href="{{ item2 }}" style="border-radius: 22px;">Ссылка
{{ loop.index }}</a> {{ loop.index }}</a>
</div> </div>
<p></p>
{% endfor %} {% endfor %}
</details> </details>
<p></p>
{% endif %} {% endif %}
{% if item.public == 1 or item.public == 'True' %} {% if item.public == 1 or item.public == 'True' %}
<div style="border-radius: 22px;" class="alert alert-success pub" role="alert">Запись <div style="border-radius: 22px;" class="alert alert-success pub" role="alert">Запись
@ -86,9 +78,7 @@
приватная приватная
</div> </div>
{% endif %} {% endif %}
<div class="my_author" style="style=position:absolute; width:148px; height:44px; left:255px; -webkit-border-radius: <div class="my_author"><img src="../{{ current_user.photo }}" width="40" height="40" style="border-radius: 22px">
22px;-moz-border-radius: 22px;border-radius: 22px; border:2px solid #FFFFFF; background-color:#1daff0; top:
98px;"><img src="../{{ current_user.photo }}" width="40" height="40" style="border-radius: 22px">
<strong style="color: #ffffff">{{ current_user.name }}</strong> <strong style="color: #ffffff">{{ current_user.name }}</strong>
</div> </div>
<strong style="color:#ffffff">{{item.date}}</strong> <strong style="color:#ffffff">{{item.date}}</strong>
@ -130,13 +120,13 @@
<summary class="emot_block"> <summary class="emot_block">
<strong class="emot_block">Позитивные эмоции</strong> <strong class="emot_block">Позитивные эмоции</strong>
</summary> </summary>
<p></p> <ul style="list-style-type: none">
{% for item2 in emotion[loop.index0]['pos_emot'] %} {% for item2 in emotion[loop.index0]['pos_emot'] %}
<strong class="alert alert-success" role="alert" style="border-radius: 22px;">{{item2}}</strong> <li><div class="emot"><strong class="alert alert-success" role="alert" style="border-radius: 22px;">{{item2}}</strong></div></li>
{% endfor %} {% endfor %}
</ul>
</details> </details>
</div> </div>
<p></p>
{% endif %} {% endif %}
{% if emotion[loop.index0]['nig_emot'] != None %} {% if emotion[loop.index0]['nig_emot'] != None %}
<div class="nig_emot"> <div class="nig_emot">
@ -144,37 +134,32 @@
<summary class="emot_block"> <summary class="emot_block">
<strong class="emot_block">Негативные эмоции</strong> <strong class="emot_block">Негативные эмоции</strong>
</summary> </summary>
<p></p> <ul style="list-style-type: none">
{% for item2 in emotion[loop.index0]['nig_emot'] %} {% for item2 in emotion[loop.index0]['nig_emot'] %}
<strong class="alert alert-danger" role="alert" style="border-radius: 22px;">{{item2}}</strong> <li><div class="emot"><strong class="alert alert-danger" role="alert" style="border-radius: 22px;">{{item2}}</strong></div></li>
{% endfor %} {% endfor %}
</ul>
</details> </details>
</div> </div>
<p></p>
{% endif %} {% endif %}
{% if item.photo != None %} {% if item.photo != None %}
<p></p>
<div class="photo"> <div class="photo">
<img width="90%" src="{{ item.photo }}" <img width="90%" src="{{ item.photo }}"
style="border-radius: 22px;"> style="border-radius: 22px;">
</div> </div>
<p></p>
{% endif %} {% endif %}
{% if emotion[loop.index0]['link'] != None %} {% if emotion[loop.index0]['link'] != None %}
<details> <details>
<summary class="emot_block"> <summary class="emot_block">
<strong class="emot_block">Ссылки</strong> <strong class="emot_block">Ссылки</strong>
</summary> </summary>
<p></p>
{% for item2 in emotion[loop.index0]['link'] %} {% for item2 in emotion[loop.index0]['link'] %}
<div class="link"> <div class="link">
<a class="alert alert-light" role="alert" href="{{ item2 }}" style="border-radius: 22px;">Ссылка <a class="alert alert-light" role="alert" href="{{ item2 }}" style="border-radius: 22px;">Ссылка
{{ loop.index }}</a> {{ loop.index }}</a>
</div> </div>
<p></p>
{% endfor %} {% endfor %}
</details> </details>
<p></p>
{% endif %} {% endif %}
{% if item.public == 1 or item.public == 'True' %} {% if item.public == 1 or item.public == 'True' %}
<div style="border-radius: 22px;" class="alert alert-success pub" role="alert">Запись <div style="border-radius: 22px;" class="alert alert-success pub" role="alert">Запись