ОТКАТ КОММИТА
This commit is contained in:
parent
32a9bfaac8
commit
5a82a47532
BIN
db/moona_data.db
BIN
db/moona_data.db
Binary file not shown.
101
main.py
101
main.py
@ -100,55 +100,62 @@ def main_page():
|
|||||||
if session.query(Like).filter(Like.post == i.id, Like.user == current_user.id).first():
|
if session.query(Like).filter(Like.post == i.id, Like.user == current_user.id).first():
|
||||||
emotion['is_like'] = 1
|
emotion['is_like'] = 1
|
||||||
emotion_for_you.append(emotion)
|
emotion_for_you.append(emotion)
|
||||||
you_like_that = sorted(list(map(lambda x: session.query(DiaryPost).filter(DiaryPost.id == x).first(),
|
if current_user.is_authenticated:
|
||||||
map(lambda x: x.post,
|
you_like_that = sorted(list(map(lambda x: session.query(DiaryPost).filter(DiaryPost.id == x).first(),
|
||||||
session.query(Like).filter(Like.user == current_user.id).all()))),
|
map(lambda x: x.post,
|
||||||
key=lambda x: (len(x.text), 1 if x.photo else 0, -(x.date - datetime.datetime.now()).days))
|
session.query(Like).filter(Like.user == current_user.id).all()))),
|
||||||
emotion_you_like_that = []
|
key=lambda x: (
|
||||||
for i in you_like_that:
|
len(x.text), 1 if x.photo else 0, -(x.date - datetime.datetime.now()).days))
|
||||||
emotion = {id: i.id, 'pos_emot': [], 'nig_emot': [], 'link': [],
|
emotion_you_like_that = []
|
||||||
'author': session.query(User).filter(User.id == i.author).first(), 'like': None, 'is_like': 0}
|
for i in you_like_that:
|
||||||
if i.pos_emot:
|
emotion = {id: i.id, 'pos_emot': [], 'nig_emot': [], 'link': [],
|
||||||
emotion['pos_emot'] = i.pos_emot.split()
|
'author': session.query(User).filter(User.id == i.author).first(), 'like': None, 'is_like': 0}
|
||||||
|
if i.pos_emot:
|
||||||
|
emotion['pos_emot'] = i.pos_emot.split()
|
||||||
|
else:
|
||||||
|
emotion['pos_emot'] = None
|
||||||
|
if i.nig_emot:
|
||||||
|
emotion['nig_emot'] = i.nig_emot.split()
|
||||||
|
else:
|
||||||
|
emotion['nig_emot'] = None
|
||||||
|
if i.link:
|
||||||
|
emotion['link'] = i.link.split()
|
||||||
|
else:
|
||||||
|
emotion['link'] = None
|
||||||
|
like = session.query(Like).filter(Like.post == i.id).all()
|
||||||
|
if like:
|
||||||
|
emotion['like'] = len(like)
|
||||||
|
if current_user.is_authenticated:
|
||||||
|
if session.query(Like).filter(Like.post == i.id, Like.user == current_user.id).first():
|
||||||
|
emotion['is_like'] = 1
|
||||||
|
emotion_you_like_that.append(emotion)
|
||||||
|
quest = session.query(Answer).filter(Answer.user == current_user.id).all()
|
||||||
|
days_reg = current_user.data_reg - datetime.date.today()
|
||||||
|
days_reg = abs(days_reg.days) + 1
|
||||||
|
if quest:
|
||||||
|
post_quest = session.query(Quest).filter(Quest.id.in_([i.id_question for i in quest])).all()
|
||||||
else:
|
else:
|
||||||
emotion['pos_emot'] = None
|
post_quest = []
|
||||||
if i.nig_emot:
|
while len(post_quest) < days_reg:
|
||||||
emotion['nig_emot'] = i.nig_emot.split()
|
post_quest.append(
|
||||||
else:
|
session.query(Quest).filter(Quest.id.notin_([i.id for i in post_quest])).first())
|
||||||
emotion['nig_emot'] = None
|
ans = []
|
||||||
if i.link:
|
for i in post_quest:
|
||||||
emotion['link'] = i.link.split()
|
if i is not None:
|
||||||
else:
|
ans_id = session.query(Answer).filter(
|
||||||
emotion['link'] = None
|
Answer.id_question == i.id and Answer.user.id == current_user.id).first()
|
||||||
like = session.query(Like).filter(Like.post == i.id).all()
|
if ans_id is not None:
|
||||||
if like:
|
ans.append(ans_id)
|
||||||
emotion['like'] = len(like)
|
post_quest = post_quest[::-1]
|
||||||
if current_user.is_authenticated:
|
ans = ans[::-1]
|
||||||
if session.query(Like).filter(Like.post == i.id, Like.user == current_user.id).first():
|
ans2 = {}
|
||||||
emotion['is_like'] = 1
|
for i in ans:
|
||||||
emotion_you_like_that.append(emotion)
|
ans2[i.id_question] = i
|
||||||
quest = session.query(Answer).filter(Answer.user == current_user.id).all()
|
|
||||||
days_reg = current_user.data_reg - datetime.date.today()
|
|
||||||
days_reg = abs(days_reg.days) + 1
|
|
||||||
if quest:
|
|
||||||
post_quest = session.query(Quest).filter(Quest.id.in_([i.id_question for i in quest])).all()
|
|
||||||
else:
|
else:
|
||||||
post_quest = []
|
you_like_that = []
|
||||||
while len(post_quest) < days_reg:
|
emotion_you_like_that = None
|
||||||
post_quest.append(
|
post_quest = None
|
||||||
session.query(Quest).filter(Quest.id.notin_([i.id for i in post_quest])).first())
|
ans2 = None
|
||||||
ans = []
|
|
||||||
for i in post_quest:
|
|
||||||
if i is not None:
|
|
||||||
ans_id = session.query(Answer).filter(
|
|
||||||
Answer.id_question == i.id and Answer.user.id == current_user.id).first()
|
|
||||||
if ans_id is not None:
|
|
||||||
ans.append(ans_id)
|
|
||||||
post_quest = post_quest[::-1]
|
|
||||||
ans = ans[::-1]
|
|
||||||
ans2 = {}
|
|
||||||
for i in ans:
|
|
||||||
ans2[i.id_question] = i
|
|
||||||
return render_template('main.html', title='moona', for_me_post=for_you_post, emotion_for_you=emotion_for_you,
|
return render_template('main.html', title='moona', for_me_post=for_you_post, emotion_for_you=emotion_for_you,
|
||||||
you_like_that=you_like_that, emotion_you_like_that=emotion_you_like_that,
|
you_like_that=you_like_that, emotion_you_like_that=emotion_you_like_that,
|
||||||
question=post_quest,
|
question=post_quest,
|
||||||
|
|||||||
@ -26,9 +26,8 @@ summary {
|
|||||||
.my_author {
|
.my_author {
|
||||||
width:40%;
|
width:40%;
|
||||||
height:5%;
|
height:5%;
|
||||||
left:10%;
|
margin-left:30%;
|
||||||
-webkit-border-radius: 22px;
|
margin-right:30%;
|
||||||
-moz-border-radius: 22px;
|
|
||||||
border-radius: 22px;
|
border-radius: 22px;
|
||||||
border:2px solid #ffffff;
|
border:2px solid #ffffff;
|
||||||
background-color:#1daff0;
|
background-color:#1daff0;
|
||||||
@ -43,12 +42,11 @@ summary {
|
|||||||
.card-body {
|
.card-body {
|
||||||
background-color: #7fc3ff;
|
background-color: #7fc3ff;
|
||||||
}
|
}
|
||||||
#all_my_post, #all_my_post1 {
|
.all_my_post {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
}
|
}
|
||||||
#my_post, #my_post1 {
|
.card {
|
||||||
text-align: center;
|
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
background-color: #7fc3ff;
|
background-color: #7fc3ff;
|
||||||
@ -56,15 +54,14 @@ summary {
|
|||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
.my_author, .my_post_zag {
|
.my_author, .my_post_zag {
|
||||||
margin-left: 50%;
|
text-align: center;
|
||||||
margin-right: auto;
|
|
||||||
margin-top: -20%;
|
|
||||||
}
|
}
|
||||||
.pub, .private {
|
.pub, .private {
|
||||||
width: 60%;
|
width: 55%;
|
||||||
height: 10%;
|
height: 10%;
|
||||||
margin-left: auto;
|
margin-left:25%;
|
||||||
margin-right: auto;
|
margin-right: 25%;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
#add_post {
|
#add_post {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
@ -72,6 +69,9 @@ summary {
|
|||||||
}
|
}
|
||||||
#edit_btn, #edit_btn1 {
|
#edit_btn, #edit_btn1 {
|
||||||
background-color: #c5f1ff;
|
background-color: #c5f1ff;
|
||||||
|
margin-left: 10%;
|
||||||
|
margin-right: auto;
|
||||||
|
margin-top: 15px;
|
||||||
}
|
}
|
||||||
input[type=text], input[type=email], input[type=password], input[type=file], input[type=number]{
|
input[type=text], input[type=email], input[type=password], input[type=file], input[type=number]{
|
||||||
padding:10px;
|
padding:10px;
|
||||||
@ -98,7 +98,7 @@ textarea {
|
|||||||
margin-left: 20px;
|
margin-left: 20px;
|
||||||
}
|
}
|
||||||
#row2, #row1 {
|
#row2, #row1 {
|
||||||
width: 30%;
|
width: 32%;
|
||||||
}
|
}
|
||||||
#row1, #row2, #all_my_question {
|
#row1, #row2, #all_my_question {
|
||||||
display:inline-block;
|
display:inline-block;
|
||||||
@ -114,9 +114,8 @@ textarea {
|
|||||||
}
|
}
|
||||||
.question, .my_post {
|
.question, .my_post {
|
||||||
background-color:#7fc3ff;
|
background-color:#7fc3ff;
|
||||||
border-radius: 22px;
|
|
||||||
width: 100%;
|
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
.is_ans {
|
.is_ans {
|
||||||
background-color:#ddefff;
|
background-color:#ddefff;
|
||||||
@ -138,7 +137,7 @@ table {
|
|||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
}
|
}
|
||||||
#row1_div, #row2_div {
|
#row1_div, #row2_div {
|
||||||
width: 98%;
|
width: 98%;
|
||||||
}
|
}
|
||||||
td {
|
td {
|
||||||
margin: 20px;
|
margin: 20px;
|
||||||
@ -149,3 +148,7 @@ width: 25%;
|
|||||||
.is_ans {
|
.is_ans {
|
||||||
width: 95%;
|
width: 95%;
|
||||||
}
|
}
|
||||||
|
.card-text {
|
||||||
|
color:#ffffff;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
@ -19,95 +19,100 @@
|
|||||||
<td id="row1">
|
<td id="row1">
|
||||||
<div id="row1_div">
|
<div id="row1_div">
|
||||||
<h2 class="my_post_zag" style="margin-bottom: 10%; margin-left:15%">Публикации</h2>
|
<h2 class="my_post_zag" style="margin-bottom: 10%; margin-left:15%">Публикации</h2>
|
||||||
<div id="all_my_post1">
|
<div class="all_my_post">
|
||||||
{% if my_post != [] %}
|
{% if my_post != [] %}
|
||||||
{% for item in pub_post %}
|
{% for item in pub_post %}
|
||||||
|
<div class="card">
|
||||||
<div class="card" style="width: 25rem;">
|
|
||||||
{% if item.photo != None %}
|
{% if item.photo != None %}
|
||||||
<img src="{{ item.photo }}" class="card-img-top" alt="...">
|
<img src="{{ item.photo }}" class="card-img-top" alt="...">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
{% if item.name != None %}
|
{% if item.name != None %}
|
||||||
<h4 class="card-title" style="color: #c5f1ff">{{item.name}}</h4>
|
<h4 class="card-title" style="color: #c5f1ff">{{item.name}}</h4>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<p><small>{{item.date}}</small></p>
|
<p><small>{{item.date}}</small></p>
|
||||||
{% if item.text != None %}
|
{% if item.text != None %}
|
||||||
<p class="card-text">{{item.text}}</p>
|
<p class="card-text">{{item.text}}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<ul class="list-group list-group-flush">
|
<ul class="list-group list-group-flush">
|
||||||
<li class="list-group-item">
|
{% if emotion_pub[loop.index0]['pos_emot'] != None %}
|
||||||
{% if emotion_pub[loop.index0]['pos_emot'] != None %}
|
<li class="list-group-item">
|
||||||
<ul style="list-style-type: none; margin-left:-15%; margin-top:5%;">
|
<ul style="list-style-type: none; margin-left:-15%; margin-top:5%;">
|
||||||
{% for item2 in emotion[loop.index0]['pos_emot'] %}
|
{% for item2 in emotion_pub[loop.index0]['pos_emot'] %}
|
||||||
<li>
|
<li>
|
||||||
<div class="emot"><strong class="alert alert-success" role="alert"
|
<div class="emot"><strong class="alert alert-success" role="alert"
|
||||||
style="border-radius: 22px;">{{item2}}</strong></div>
|
style="border-radius: 22px;">{{item2}}</strong></div>
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
{% endif %}
|
</li>
|
||||||
</li>
|
{% endif %}
|
||||||
<li class="list-group-item">
|
|
||||||
{% if emotion_pub[loop.index0]['nig_emot'] != None %}
|
{% if emotion_pub[loop.index0]['nig_emot'] != None %}
|
||||||
<ul style="list-style-type: none; margin-left:-15%; margin-top:5%">
|
<li class="list-group-item">
|
||||||
|
<ul style="list-style-type: none; margin-left:-15%; margin-top:5%">
|
||||||
{% for item2 in emotion_pub[loop.index0]['nig_emot'] %}
|
{% for item2 in emotion_pub[loop.index0]['nig_emot'] %}
|
||||||
<li>
|
<li>
|
||||||
<div class="emot"><strong class="alert alert-danger" role="alert"
|
<div class="emot"><strong class="alert alert-danger" role="alert"
|
||||||
style="border-radius: 22px;">{{item2}}</strong></div>
|
style="border-radius: 22px;">{{item2}}</strong></div>
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</li>
|
|
||||||
<li class="list-group-item">
|
|
||||||
{% if emotion_pub[loop.index0]['link'] != None %}
|
{% if emotion_pub[loop.index0]['link'] != None %}
|
||||||
<ul style="list-style-type: none; margin-left:-15%; margin-top:5%; margin-bottom:5%">
|
<li class="list-group-item">
|
||||||
|
<ul style="list-style-type: none; margin-left:-15%; margin-top:5%; margin-bottom:5%">
|
||||||
{% for item2 in emotion_pub[loop.index0]['link'] %}
|
{% for item2 in emotion_pub[loop.index0]['link'] %}
|
||||||
<li>
|
<li>
|
||||||
<div class="emot"><a class="alert alert-light" role="alert" href="{{ item2 }}" style="border-radius: 22px;">Ссылка
|
<div class="emot"><a class="alert alert-light" role="alert" href="{{ item2 }}"
|
||||||
|
style="border-radius: 22px;">Ссылка
|
||||||
{{ loop.index }}</a></div>
|
{{ loop.index }}</a></div>
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</li>
|
</ul>
|
||||||
</ul>
|
<div class="card-body">
|
||||||
<div class="card-body">
|
{% 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"
|
||||||
<div style="border-radius: 22px; margin-left:-5%; width: 50%" class="alert alert-success pub" role="alert">Запись
|
role="alert">Запись
|
||||||
опубликована
|
опубликована
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div style="border-radius: 22px; margin-left:-5% width: 50%" class="alert alert-danger private" role="alert">Запись
|
<div style="border-radius: 22px;" class="alert alert-danger private"
|
||||||
приватная
|
role="alert">Запись
|
||||||
</div>
|
приватная
|
||||||
{% endif %}
|
</div>
|
||||||
<div class="my_author"><img src="../{{ current_user.photo }}" width="40" height="40"
|
{% endif %}
|
||||||
style="border-radius: 22px">
|
<div class="my_author"><img src="../{{ current_user.photo }}" width="40" height="40"
|
||||||
<strong style="color: #ffffff">{{ current_user.name }}</strong>
|
style="border-radius: 22px">
|
||||||
</div>
|
<strong style="color: #ffffff">{{ current_user.name }}</strong>
|
||||||
<div class="like" style="margin-top:5%; margin-left:1%">
|
</div>
|
||||||
<a type="button"
|
<div class="like" style="margin-top:5%; margin-left:1%">
|
||||||
href="/new_like/{{current_user.id}}/{{item.id}}/diary">
|
<a type="button"
|
||||||
{% if emotion_pub[loop.index0]['is_like'] %}
|
href="/new_like/{{current_user.id}}/{{item.id}}/diary">
|
||||||
<img src="../static/img/like_add.png" width="117" height="100">
|
{% if emotion_pub[loop.index0]['is_like'] %}
|
||||||
{% else %}
|
<img src="../static/img/like_add.png" width="117" height="100">
|
||||||
<img src="../static/img/like.png" width="94" height="80">
|
{% else %}
|
||||||
|
<img src="../static/img/like.png" width="94" height="80">
|
||||||
|
{% endif %}
|
||||||
|
</a>
|
||||||
|
{% if emotion_pub[loop.index0]['like'] != None %}
|
||||||
|
<p style="color:#ffffff; margin-left:30%">{{emotion_pub[loop.index0]['like']}}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</a>
|
</div>
|
||||||
{% if emotion_pub[loop.index0]['like'] != None %}
|
<div class="edit">
|
||||||
<p style="color:#ffffff; margin-left:30%">{{emotion_pub[loop.index0]['like']}}</p>
|
<a style="border-radius: 15px;" href="/post/{{ item.id }}"
|
||||||
{% endif %}
|
class="btn" id="edit_btn">
|
||||||
</div>
|
Изменить
|
||||||
<div>
|
</a>
|
||||||
<a style="border-radius: 15px; margin-top:10%; margin-left:1%" href="/post/{{ item.id }}" class="btn" id="edit_btn">
|
<a style="border-radius: 15px;" href="/post_deleted/{{ item.id }}"
|
||||||
Изменить
|
class="btn btn-danger">
|
||||||
</a>
|
Удалить
|
||||||
<a style="border-radius: 15px; margin-top:10%" href="/post_deleted/{{ item.id }}" class="btn btn-danger">
|
</a>
|
||||||
Удалить
|
</div>
|
||||||
</a>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@ -121,26 +126,26 @@
|
|||||||
</td>
|
</td>
|
||||||
<td id="row2">
|
<td id="row2">
|
||||||
<div id="row2_div">
|
<div id="row2_div">
|
||||||
<h2 class="my_post_zag" style="margin-bottom: 10%; margin-left:15%">Мои мысли</h2>
|
<h2 class="my_post_zag">Мои мысли</h2>
|
||||||
<div id="all_my_post">
|
<div class="all_my_post">
|
||||||
{% if my_post != [] %}
|
{% if my_post != [] %}
|
||||||
{% for item in my_post %}
|
{% for item in my_post %}
|
||||||
<div class="card" style="width: 25rem;">
|
<div class="card">
|
||||||
{% if item.photo != None %}
|
{% if item.photo != None %}
|
||||||
<img src="{{ item.photo }}" class="card-img-top" alt="...">
|
<img src="{{ item.photo }}" class="card-img-top" alt="...">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
{% if item.name != None %}
|
{% if item.name != None %}
|
||||||
<h4 class="card-title" style="color: #c5f1ff">{{item.name}}</h4>
|
<h4 class="card-title" style="color: #c5f1ff">{{item.name}}</h4>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<p><small>{{item.date}}</small></p>
|
<p><small>{{item.date}}</small></p>
|
||||||
{% if item.text != None %}
|
{% if item.text != None %}
|
||||||
<p class="card-text">{{item.text}}</p>
|
<p class="card-text">{{item.text}}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<ul class="list-group list-group-flush">
|
<ul class="list-group list-group-flush">
|
||||||
<li class="list-group-item">
|
{% if emotion[loop.index0]['pos_emot'] != None %}
|
||||||
{% if emotion_pub[loop.index0]['pos_emot'] != None %}
|
<li class="list-group-item">
|
||||||
<ul style="list-style-type: none; margin-left:-15%; margin-top:5%;">
|
<ul style="list-style-type: none; margin-left:-15%; margin-top:5%;">
|
||||||
{% for item2 in emotion[loop.index0]['pos_emot'] %}
|
{% for item2 in emotion[loop.index0]['pos_emot'] %}
|
||||||
<li>
|
<li>
|
||||||
@ -149,54 +154,60 @@
|
|||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</li>
|
{% if emotion[loop.index0]['nig_emot'] != None %}
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
{% if emotion_pub[loop.index0]['nig_emot'] != None %}
|
<ul style="list-style-type: none; margin-left:-15%; margin-top:5%">
|
||||||
<ul style="list-style-type: none; margin-left:-15%; margin-top:5%">
|
{% for item2 in emotion[loop.index0]['nig_emot'] %}
|
||||||
{% for item2 in emotion_pub[loop.index0]['nig_emot'] %}
|
|
||||||
<li>
|
<li>
|
||||||
<div class="emot"><strong class="alert alert-danger" role="alert"
|
<div class="emot"><strong class="alert alert-danger" role="alert"
|
||||||
style="border-radius: 22px;">{{item2}}</strong></div>
|
style="border-radius: 22px;">{{item2}}</strong></div>
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</li>
|
{% if emotion[loop.index0]['link'] != None %}
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
{% if emotion_pub[loop.index0]['link'] != None %}
|
<ul style="list-style-type: none; margin-left:-15%; margin-top:5%; margin-bottom:5%">
|
||||||
<ul style="list-style-type: none; margin-left:-15%; margin-top:5%; margin-bottom:5%">
|
{% for item2 in emotion[loop.index0]['link'] %}
|
||||||
{% for item2 in emotion_pub[loop.index0]['link'] %}
|
|
||||||
<li>
|
<li>
|
||||||
<div class="emot"><a class="alert alert-light" role="alert" href="{{ item2 }}" style="border-radius: 22px;">Ссылка
|
<div class="emot"><a class="alert alert-light" role="alert" href="{{ item2 }}"
|
||||||
|
style="border-radius: 22px;">Ссылка
|
||||||
{{ loop.index }}</a></div>
|
{{ loop.index }}</a></div>
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</li>
|
</ul>
|
||||||
</ul>
|
<div class="card-body">
|
||||||
<div class="card-body">
|
{% 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"
|
||||||
<div style="border-radius: 22px; margin-left:-5%; width: 50%" class="alert alert-success pub" role="alert">Запись
|
role="alert">Запись
|
||||||
опубликована
|
опубликована
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div style="border-radius: 22px; margin-left:-5% width: 50%" class="alert alert-danger private" role="alert">Запись
|
<div style="border-radius: 22px;" class="alert alert-danger private"
|
||||||
приватная
|
role="alert">Запись
|
||||||
</div>
|
приватная
|
||||||
{% endif %}
|
</div>
|
||||||
<div class="my_author"><img src="../{{ current_user.photo }}" width="40" height="40"
|
{% endif %}
|
||||||
style="border-radius: 22px">
|
<div class="my_author"><img src="../{{ current_user.photo }}" width="40" height="40"
|
||||||
<strong style="color: #ffffff">{{ current_user.name }}</strong>
|
style="border-radius: 22px">
|
||||||
</div>
|
<strong style="color: #ffffff">{{ current_user.name }}</strong>
|
||||||
<div>
|
</div>
|
||||||
<a style="border-radius: 15px; margin-top:10%; margin-left:1%" href="/post/{{ item.id }}" class="btn" id="edit_btn">
|
<div>
|
||||||
Изменить
|
<a style="border-radius: 15px;" href="/post/{{ item.id }}"
|
||||||
</a>
|
class="btn" id="edit_btn1">
|
||||||
<a style="border-radius: 15px; margin-top:10%" href="/post_deleted/{{ item.id }}" class="btn btn-danger">
|
Изменить
|
||||||
Удалить
|
</a>
|
||||||
</a>
|
<a style="border-radius: 15px;" href="/post_deleted/{{ item.id }}"
|
||||||
|
class="btn btn-danger">
|
||||||
|
Удалить
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@ -17,6 +17,7 @@
|
|||||||
<table id="main_table">
|
<table id="main_table">
|
||||||
<td class="row1">
|
<td class="row1">
|
||||||
<div class="rowdiv1">
|
<div class="rowdiv1">
|
||||||
|
{% if current_user.is_authenticated %}
|
||||||
<h2 class="my_post_zag" style="margin-left:15%">Вопросы дня</h2>
|
<h2 class="my_post_zag" style="margin-left:15%">Вопросы дня</h2>
|
||||||
<div class="my_post">
|
<div class="my_post">
|
||||||
<div class="question">
|
<div class="question">
|
||||||
@ -38,6 +39,9 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% else %}
|
||||||
|
<p>Чтобы увидеть вопросы дня войдите в аккаунт</p>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="row2">
|
<td class="row2">
|
||||||
@ -225,7 +229,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<a style="border-radius: 15px; margin-top:10%; margin-left:1%" href="/post/{{ item.id }}" class="btn" id="edit_btn">
|
<a style="border-radius: 15px; margin-top:10%; margin-left:1%" href="/post/{{ item.id }}" class="btn" id="edit_btn1">
|
||||||
Изменить
|
Изменить
|
||||||
</a>
|
</a>
|
||||||
<a style="border-radius: 15px; margin-top:10%" href="/post_deleted/{{ item.id }}" class="btn btn-danger">
|
<a style="border-radius: 15px; margin-top:10%" href="/post_deleted/{{ item.id }}" class="btn btn-danger">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user