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

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():
db_sess = db_session.create_session()
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)
user2 = session.merge(user)
session.add(user2)
@ -436,6 +427,11 @@ def recovery():
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():
db_session.global_init("db/moona_data.db")
app.run()

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

View File

@ -1,52 +1,76 @@
.bad_user {
margin-left: auto;
margin-left: auto;
margin-right: auto;
background-color: #1daff0;
color: #ffffff;
width: 50%;
height: 55%;
-webkit-border-radius:22px;
-moz-border-radius: 22px;
border-radius: 22px;
border:2px solid #FFFFFF;
margin-top: 20px;
background-color: #1daff0;
color: #ffffff;
width: 50%;
height: 55%;
-webkit-border-radius:22px;
-moz-border-radius: 22px;
border-radius: 22px;
border:2px solid #ffffff;
margin-top: 20px;
}
.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 {
width: 70%;
width: 70%;
}
#all_my_post, #all_my_post1 {
margin-left: auto;
margin-left: auto;
margin-right: auto;
}
#my_post, #my_post1 {
text-align: center;
margin-left: auto;
text-align: center;
margin-left: auto;
margin-right: auto;
margin-top: 25px;
background-color: #7fc3ff;
border-radius: 22px;
}
.my_author, .my_post_zag {
text-align: center;
margin-left: auto;
text-align: center;
margin-left: auto;
margin-right: auto;
margin-top: 25px;
}
.pub, .private {
width: 60%;
height: 10%;
margin-left: auto;
width: 60%;
height: 10%;
margin-left: auto;
margin-right: auto;
}
#add_post {
margin-top: 20px;
margin-left: 85%;
margin-top: 20px;
margin-left: 85%;
}
#edit_btn, #edit_btn1 {
background-color: #c5f1ff;
background-color: #c5f1ff;
}
input[type=text], input[type=email], input[type=password], input[type=file], input[type=number]{
padding:10px;
@ -73,32 +97,32 @@ textarea {
margin-left: 20px;
}
#row2, #row1 {
width: 30%;
width: 30%;
}
#row1, #row2, #all_my_question {
display:inline-block;
vertical-align: top;
display:inline-block;
vertical-align: top;
}
#all_my_question {
width: 30%;
height: -100%;
width: 30%;
height: -100%;
}
.question, .my_post {
background-color:#7fc3ff;
border-radius: 22px;
width: 90%;
margin-left: 10px;
background-color:#7fc3ff;
border-radius: 22px;
width: 90%;
margin-left: 10px;
}
.is_ans {
background-color:#ddefff;
border:2px solid #FFFFFF;
border-radius: 25px;
background-color:#ddefff;
border:2px solid #ffffff;
border-radius: 25px;
}
.emot_block {
color: #ffffff;
font-weight: bolder;
color: #ffffff;
font-weight: bolder;
}
table {
margin-left: 5%;
width: 90%;
margin-left: 5%;
width: 90%;
}

View File

@ -1,16 +1,16 @@
.all_div {
margin-left: auto;
margin-left: auto;
margin-right: auto;
width: 50%;
.add_q{
width: 50%;
}
.add_q {
width: 50%;
}
.h_q {
text-align: center;
text-align: center;
}
form {
width: 60%;
margin-left: auto;
width: 60%;
margin-left: auto;
margin-right: auto;
}

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>
</ul>
<ul class="navbar-nav">
<a class="navbar-brand" href="/about">
<a class="navbar-brand" href="/about_us">
<h2 style="color:#56a3ff">О нас</h2>
</a>
</ul>

View File

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