Подправлено отображение блоков с постами

This commit is contained in:
mrmur 2022-04-19 18:18:12 +05:00
parent 4c536e528a
commit 7ded2a130d
5 changed files with 413 additions and 374 deletions

Binary file not shown.

View File

@ -123,10 +123,12 @@ textarea {
} }
table { table {
margin-left: 5%; margin-left: 5%;
width: 90%;
} }
.like { .like {
width: 50%; width: 50%;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
}
#row1_div, #row2_div, #row3_div {
width: 90%;
} }

View File

@ -1,10 +1,15 @@
table { table {
width: 90%;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
} }
#row1, #row2, #row3 { #row1, #row2, #row3 {
width: 30%; width: 32%;
display:inline-block;
vertical-align: top;
margin-top: 39px;
}
#row1_div, #row2_div, #row3_div {
width: 90%;
} }
.post_zag, .card-text, .card-body, .post_zag, .author { .post_zag, .card-text, .card-body, .post_zag, .author {
width: 90%; width: 90%;
@ -21,4 +26,8 @@ margin-bottom: 20px;
} }
details { details {
color: #ffffff; color: #ffffff;
}
#add_post {
margin-top: 20px;
margin-left: 83%;
} }

View File

@ -11,227 +11,235 @@
</div> </div>
<table> <table>
<td id="row1"> <td id="row1">
<h1 class="my_post_zag">Публикации</h1> <div id="row1_div">
<div id="all_my_post1"> <h1 class="my_post_zag">Публикации</h1>
{% if my_post != [] %} <div id="all_my_post1">
{% for item in pub_post %} {% if my_post != [] %}
<div class="card-body" id="my_post1"> {% for item in pub_post %}
<details> <div class="card-body" id="my_post1">
<summary style="color:#ffffff">{% if item.name != None %} <details>
<h2 class="card-title" id="my_post_zag1" style="color:#c5f1ff">{{item.name}}</h2> <summary style="color:#ffffff">{% if item.name != None %}
<h2 class="card-title" id="my_post_zag1" style="color:#c5f1ff">{{item.name}}</h2>
{% endif %}
</summary>
{% if item.text != None %}
<strong class="card-text" id="my_text1" style="color:#ffffff">{{item.text}}</strong>
{% endif %} {% endif %}
</summary>
{% if item.text != None %}
<strong class="card-text" id="my_text1" style="color:#ffffff">{{item.text}}</strong>
{% endif %}
</details>
{% if emotion_pub[loop.index0]['pos_emot'] != None %}
<div class="pos_emot">
<details>
<summary class="emot_block">
<strong class="emot_block">Позитивные эмоции</strong>
</summary>
{% for item2 in emotion_pub[loop.index0]['pos_emot'] %}
<strong class="alert alert-success" role="alert" style="border-radius: 22px;">{{item2}}</strong>
{% endfor %}
</details> </details>
</div> {% if emotion_pub[loop.index0]['pos_emot'] != None %}
{% endif %} <div class="pos_emot">
{% if emotion_pub[loop.index0]['nig_emot'] != None %} <details>
<div class="nig_emot"> <summary class="emot_block">
<details> <strong class="emot_block">Позитивные эмоции</strong>
<summary class="emot_block"> </summary>
<strong class="emot_block">Негативные эмоции</strong> {% for item2 in emotion_pub[loop.index0]['pos_emot'] %}
</summary> <strong class="alert alert-success" role="alert"
<p></p> style="border-radius: 22px;">{{item2}}</strong>
{% for item2 in emotion_pub[loop.index0]['nig_emot'] %} {% endfor %}
<strong class="alert alert-danger" role="alert" style="border-radius: 22px;">{{item2}}</strong> </details>
{% endfor %}
</details>
</div>
{% endif %}
{% if item.photo != None %}
<div class="photo">
<img width="90%" src="{{ item.photo }}"
style="border-radius: 22px;">
</div>
{% endif %}
{% if emotion_pub[loop.index0]['link'] != None %}
<details>
<summary class="emot_block">
<strong class="emot_block">Ссылки</strong>
</summary>
{% 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> </div>
{% endfor %}
</details>
{% endif %}
{% if item.public == 1 or item.public == 'True' %}
<div style="border-radius: 22px;" class="alert alert-success pub" role="alert">Запись
опубликована
</div>
{% else %}
<div style="border-radius: 22px;" class="alert alert-danger private" role="alert">Запись
приватная
</div>
{% endif %}
<div class="like">
<a type="button"
href="/new_like/{{current_user.id}}/{{item.id}}/diary">
{% if emotion_pub[loop.index0]['is_like'] %}
<img src="../static/img/like_add.png" width="117" height="100">
{% else %}
<img src="../static/img/like.png" width="94" height="80">
{% endif %}
</a>
{% if emotion_pub[loop.index0]['like'] != None %}
<p style="color:#ffffff">{{emotion_pub[loop.index0]['like']}}</p>
{% endif %} {% endif %}
{% if emotion_pub[loop.index0]['nig_emot'] != None %}
<div class="nig_emot">
<details>
<summary class="emot_block">
<strong class="emot_block">Негативные эмоции</strong>
</summary>
<p></p>
{% for item2 in emotion_pub[loop.index0]['nig_emot'] %}
<strong class="alert alert-danger" role="alert"
style="border-radius: 22px;">{{item2}}</strong>
{% endfor %}
</details>
</div>
{% endif %}
{% if item.photo != None %}
<div class="photo">
<img width="90%" src="{{ item.photo }}"
style="border-radius: 22px;">
</div>
{% endif %}
{% if emotion_pub[loop.index0]['link'] != None %}
<details>
<summary class="emot_block">
<strong class="emot_block">Ссылки</strong>
</summary>
{% 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>
{% endfor %}
</details>
{% endif %}
{% if item.public == 1 or item.public == 'True' %}
<div style="border-radius: 22px;" class="alert alert-success pub" role="alert">Запись
опубликована
</div>
{% else %}
<div style="border-radius: 22px;" class="alert alert-danger private" role="alert">Запись
приватная
</div>
{% endif %}
<div class="like">
<a type="button"
href="/new_like/{{current_user.id}}/{{item.id}}/diary">
{% if emotion_pub[loop.index0]['is_like'] %}
<img src="../static/img/like_add.png" width="117" height="100">
{% else %}
<img src="../static/img/like.png" width="94" height="80">
{% endif %}
</a>
{% if emotion_pub[loop.index0]['like'] != None %}
<p style="color:#ffffff">{{emotion_pub[loop.index0]['like']}}</p>
{% endif %}
</div>
<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>
<div>
<a style="border-radius: 15px;" href="/post/{{ item.id }}" class="btn" , id="edit_btn">
Изменить
</a>
<a style="border-radius: 15px;" href="/post_deleted/{{ item.id }}" class="btn btn-danger">
Удалить
</a>
</div>
</div> </div>
<div class="my_author"><img src="../{{ current_user.photo }}" width="40" height="40" {% endfor %}
style="border-radius: 22px"> {% else %}
<strong style="color: #ffffff">{{ current_user.name }}</strong> <div class="bad_centre" style="background-color:#1daff0; border-radius: 22px;color:#ffffff">
</div> <h1 class="hz1">Ничего не нашлось :с</h1>
<strong style="color:#ffffff">{{item.date}}</strong>
<div>
<a style="border-radius: 15px;" href="/post/{{ item.id }}" class="btn" , id="edit_btn">
Изменить
</a>
<a style="border-radius: 15px;" href="/post_deleted/{{ item.id }}" class="btn btn-danger">
Удалить
</a>
</div> </div>
{% endif %}
</div> </div>
{% endfor %}
{% else %}
<div class="bad_centre" style="background-color:#1daff0; border-radius: 22px;color:#ffffff">
<h1 class="hz1">Ничего не нашлось :с</h1>
</div>
{% endif %}
</div> </div>
</td> </td>
<td id="row2"> <td id="row2">
<h1 class="my_post_zag">Мои мысли</h1> <div id="row2_div">
<div id="all_my_post"> <h1 class="my_post_zag">Мои мысли</h1>
{% if my_post != [] %} <div id="all_my_post">
{% for item in my_post %} {% if my_post != [] %}
<div class="card-body" id="my_post"> {% for item in my_post %}
<details> <div class="card-body" id="my_post">
<summary style="color:#ffffff">{% if item.name != None %} <details>
<h2 class="card-title" id="my_post_zag" style="color:#c5f1ff">{{item.name}}</h2> <summary style="color:#ffffff">{% if item.name != None %}
<h2 class="card-title" id="my_post_zag" style="color:#c5f1ff">{{item.name}}</h2>
{% endif %}
</summary>
{% if item.text != None %}
<strong class="card-text" id="my_text" style="color:#ffffff">{{item.text}}</strong>
{% endif %} {% endif %}
</summary>
{% if item.text != None %}
<strong class="card-text" id="my_text" style="color:#ffffff">{{item.text}}</strong>
{% endif %}
</details>
{% if emotion[loop.index0]['pos_emot'] != None %}
<div class="pos_emot">
<details>
<summary class="emot_block">
<strong class="emot_block">Позитивные эмоции</strong>
</summary>
<ul style="list-style-type: none">
{% for item2 in emotion[loop.index0]['pos_emot'] %}
<li>
<div class="emot"><strong class="alert alert-success" role="alert"
style="border-radius: 22px;">{{item2}}</strong></div>
</li>
{% endfor %}
</ul>
</details> </details>
</div> {% if emotion[loop.index0]['pos_emot'] != None %}
{% endif %} <div class="pos_emot">
{% if emotion[loop.index0]['nig_emot'] != None %} <details>
<div class="nig_emot"> <summary class="emot_block">
<details> <strong class="emot_block">Позитивные эмоции</strong>
<summary class="emot_block"> </summary>
<strong class="emot_block">Негативные эмоции</strong> <ul style="list-style-type: none">
</summary> {% for item2 in emotion[loop.index0]['pos_emot'] %}
<ul style="list-style-type: none"> <li>
{% for item2 in emotion[loop.index0]['nig_emot'] %} <div class="emot"><strong class="alert alert-success" role="alert"
<li> style="border-radius: 22px;">{{item2}}</strong></div>
<div class="emot"><strong class="alert alert-danger" role="alert" </li>
style="border-radius: 22px;">{{item2}}</strong></div> {% endfor %}
</li> </ul>
{% endfor %} </details>
</ul> </div>
</details> {% endif %}
</div> {% if emotion[loop.index0]['nig_emot'] != None %}
{% endif %} <div class="nig_emot">
{% if item.photo != None %} <details>
<div class="photo"> <summary class="emot_block">
<img width="90%" src="{{ item.photo }}" <strong class="emot_block">Негативные эмоции</strong>
style="border-radius: 22px;"> </summary>
</div> <ul style="list-style-type: none">
{% endif %} {% for item2 in emotion[loop.index0]['nig_emot'] %}
{% if emotion[loop.index0]['link'] != None %} <li>
<details> <div class="emot"><strong class="alert alert-danger" role="alert"
<summary class="emot_block"> style="border-radius: 22px;">{{item2}}</strong></div>
<strong class="emot_block">Ссылки</strong> </li>
</summary> {% endfor %}
{% for item2 in emotion[loop.index0]['link'] %} </ul>
<div class="link"> </details>
<a class="alert alert-light" role="alert" href="{{ item2 }}" style="border-radius: 22px;">Ссылка </div>
{{ loop.index }}</a> {% endif %}
{% if item.photo != None %}
<div class="photo">
<img width="90%" src="{{ item.photo }}"
style="border-radius: 22px;">
</div>
{% endif %}
{% if emotion[loop.index0]['link'] != None %}
<details>
<summary class="emot_block">
<strong class="emot_block">Ссылки</strong>
</summary>
{% 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>
{% endfor %}
</details>
{% endif %}
{% if item.public == 1 or item.public == 'True' %}
<div style="border-radius: 22px;" class="alert alert-success pub" role="alert">Запись
опубликована
</div>
{% else %}
<div style="border-radius: 22px;" class="alert alert-danger private" role="alert">Запись
приватная
</div>
{% endif %}
<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>
<div>
<a style="border-radius: 15px;" href="/post/{{ item.id }}" class="btn" id="edit_btn1">
Изменить
</a>
<a style="border-radius: 15px;" href="/post_deleted/{{ item.id }}" class="btn btn-danger">
Удалить
</a>
</div> </div>
{% endfor %}
</details>
{% endif %}
{% if item.public == 1 or item.public == 'True' %}
<div style="border-radius: 22px;" class="alert alert-success pub" role="alert">Запись
опубликована
</div> </div>
{% endfor %}
{% else %} {% else %}
<div style="border-radius: 22px;" class="alert alert-danger private" role="alert">Запись <div class="bad_centre" style="background-color:#1daff0; border-radius: 22px;color:#ffffff">
приватная <h1 class="hz1">Ничего не нашлось :с</h1>
</div> </div>
{% endif %} {% endif %}
<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>
<div>
<a style="border-radius: 15px;" href="/post/{{ item.id }}" class="btn" id="edit_btn1">
Изменить
</a>
<a style="border-radius: 15px;" href="/post_deleted/{{ item.id }}" class="btn btn-danger">
Удалить
</a>
</div>
</div> </div>
{% endfor %}
{% else %}
<div class="bad_centre" style="background-color:#1daff0; border-radius: 22px;color:#ffffff">
<h1 class="hz1">Ничего не нашлось :с</h1>
</div>
{% endif %}
</div> </div>
</td> </td>
<td id="all_my_question"> <td id="all_my_question">
<h1 class="my_post_zag">Вопросы дня</h1> <div id="row3_div">
<div class="my_post"> <h1 class="my_post_zag">Вопросы дня</h1>
<div class="question"> <div class="my_post">
{% for item in question %} <div class="question">
<a href="/answer_quest/{{item.id}}" class="btn"> {% for item in question %}
{% if item.id in ans %} <a href="/answer_quest/{{item.id}}" class="btn">
<div class="is_ans"> {% if item.id in ans %}
<strong>{{item.quest}}</strong> <div class="is_ans">
<div class="alert alert-success" role="alert" style="border-radius: 25px;">Ответ есть</div> <strong>{{item.quest}}</strong>
<strong>{{ans[item.id].answer}}</strong> <div class="alert alert-success" role="alert" style="border-radius: 25px;">Ответ есть</div>
</div> <strong>{{ans[item.id].answer}}</strong>
{% else %} </div>
<div class="is_ans"> {% else %}
<strong>{{item.quest}}</strong> <div class="is_ans">
<div class="alert alert-danger" role="alert" style="border-radius: 25px;">Ответа нет</div> <strong>{{item.quest}}</strong>
</div> <div class="alert alert-danger" role="alert" style="border-radius: 25px;">Ответа нет</div>
{% endif %} </div>
</a> {% endif %}
{% endfor %} </a>
{% endfor %}
</div>
</div> </div>
</div> </div>
</td> </td>

View File

@ -2,203 +2,223 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block content %} {% block content %}
{% if current_user.is_authenticated %}
<div>
<a href="/add_post" id="add_post" class="btn btn-primary"
style="background-color:#1daff0;border-radius: 15px;"><strong>Добавить
запись</strong></a>
</div>
{% endif %}
<table> <table>
<td id="row1"> <td id="row1">
<h1 class="post_zag">Популярное</h1> <div id="row1_div">
<div class="fresh_block" id="pop"> <h1 class="post_zag">Популярное</h1>
{% if pop_post != [] %} <div class="fresh_block" id="pop">
{% for item in pop_post %} {% if pop_post != [] %}
<div class="card-body post"> {% for item in pop_post %}
<details> <div class="card-body post">
<summary>
{% if item.name != None %}
<h2 class="card-title post_zag" style="color:#c5f1ff">{{item.name}}</h2>
{% endif %}
</summary>
{% if item.text != None %}
<strong class="card-text" style="color:#ffffff">{{item.text}}</strong>
{% endif %}
</details>
{% if emotion_pop[loop.index0]['pos_emot'] != None %}
<div class="pos_emot">
<details> <details>
<summary class="emot_block"> <summary>
<strong class="emot_block">Позитивные эмоции</strong> {% if item.name != None %}
<h2 class="card-title post_zag" style="color:#c5f1ff">{{item.name}}</h2>
{% endif %}
</summary> </summary>
<p></p> {% if item.text != None %}
{% for item2 in emotion_pop[loop.index0]['pos_emot'] %} <strong class="card-text" style="color:#ffffff">{{item.text}}</strong>
<strong class="alert alert-success" role="alert" style="border-radius: 22px;">{{item2}}</strong>
{% endfor %}
</details>
</div>
<p></p>
{% endif %}
{% if emotion_pop[loop.index0]['nig_emot'] != None %}
<div class="nig_emot">
<details>
<summary class="emot_block">
<strong class="emot_block">Негативные эмоции</strong>
</summary>
<p></p>
{% for item2 in emotion_pop[loop.index0]['nig_emot'] %}
<strong class="alert alert-danger" role="alert" style="border-radius: 22px;">{{item2}}</strong>
{% 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 current_user.is_authenticated %}
<div class="like">
<a type="button"
href="/new_like/{{current_user.id}}/{{item.id}}/publications">
{% if emotion_pop[loop.index0]['is_like'] %}
<img src="../static/img/like_add.png" width="117" height="100">
{% else %}
<img src="../static/img/like.png" width="94" height="80">
{% endif %} {% endif %}
</a> </details>
{% if emotion_pop[loop.index0]['like'] != None %} {% if emotion_pop[loop.index0]['pos_emot'] != None %}
<p style="color:#ffffff">{{emotion_pop[loop.index0]['like']}}</p> <div class="pos_emot">
{% endif %} <details>
</div> <summary class="emot_block">
{% endif %} <strong class="emot_block">Позитивные эмоции</strong>
{% if emotion_pop[loop.index0]['link'] != None %} </summary>
<details> <p></p>
<summary class="emot_block"> {% for item2 in emotion_pop[loop.index0]['pos_emot'] %}
<strong class="emot_block">Ссылки</strong> <strong class="alert alert-success" role="alert"
</summary> style="border-radius: 22px;">{{item2}}</strong>
<p></p> {% endfor %}
{% for item2 in emotion_pop[loop.index0]['link'] %} </details>
<div class="link">
<a class="alert alert-light" role="alert" href="{{ item2 }}" style="border-radius: 22px;">Ссылка
{{ loop.index }}</a>
</div> </div>
<p></p> <p></p>
{% endfor %} {% endif %}
</details> {% if emotion_pop[loop.index0]['nig_emot'] != None %}
{% endif %} <div class="nig_emot">
<div class="author" style="style=position:absolute; width:148px; height:44px; left:255px; -webkit-border-radius: <details>
<summary class="emot_block">
<strong class="emot_block">Негативные эмоции</strong>
</summary>
<p></p>
{% for item2 in emotion_pop[loop.index0]['nig_emot'] %}
<strong class="alert alert-danger" role="alert"
style="border-radius: 22px;">{{item2}}</strong>
{% 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 current_user.is_authenticated %}
<div class="like">
<a type="button"
href="/new_like/{{current_user.id}}/{{item.id}}/publications">
{% if emotion_pop[loop.index0]['is_like'] %}
<img src="../static/img/like_add.png" width="117" height="100">
{% else %}
<img src="../static/img/like.png" width="94" height="80">
{% endif %}
</a>
{% if emotion_pop[loop.index0]['like'] != None %}
<p style="color:#ffffff">{{emotion_pop[loop.index0]['like']}}</p>
{% endif %}
</div>
{% endif %}
{% if emotion_pop[loop.index0]['link'] != None %}
<details>
<summary class="emot_block">
<strong class="emot_block">Ссылки</strong>
</summary>
<p></p>
{% for item2 in emotion_pop[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>
{% endif %}
<div class="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: 22px;-moz-border-radius: 22px;border-radius: 22px; border:2px solid #FFFFFF; background-color:#1daff0; top:
98px;"><img src="../{{ emotion_pop[loop.index0]['author'].photo }}" width="40" height="40" 98px;"><img src="../{{ emotion_pop[loop.index0]['author'].photo }}" width="40" height="40"
style="border-radius: 22px"> style="border-radius: 22px">
<strong style="color: #ffffff">{{ emotion_pop[loop.index0]['author'].name }}</strong> <strong style="color: #ffffff">{{ emotion_pop[loop.index0]['author'].name }}</strong>
</div>
<strong style="color:#ffffff">{{item.date}}</strong>
</div> </div>
<strong style="color:#ffffff">{{item.date}}</strong> {% endfor %}
</div> </div>
{% endfor %} {% else %}
<div class="bad_centre" style="background-color:#1daff0; border-radius: 22px;color:#ffffff">
<h1 class="hz1">Ничего не нашлось :с</h1>
</div>
{% endif %}
</div> </div>
{% else %}
<div class="bad_centre" style="background-color:#1daff0; border-radius: 22px;color:#ffffff">
<h1 class="hz1">Ничего не нашлось :с</h1>
</div>
{% endif %}
</td> </td>
<td id="row2"> <td id="row2">
<h1 class="post_zag">Свежее</h1> <div id="row2_div">
<div class="fresh_block" id="fresh"> <h1 class="post_zag">Свежее</h1>
{% if fresh_post != [] %} <div class="fresh_block" id="fresh">
{% for item in fresh_post %} {% if fresh_post != [] %}
<div class="card-body post"> {% for item in fresh_post %}
<details> <div class="card-body post">
<summary>
{% if item.name != None %}
<h2 class="card-title post_zag" style="color:#c5f1ff">{{item.name}}</h2>
{% endif %}
</summary>
{% if item.text != None %}
<strong class="card-text" style="color:#ffffff">{{item.text}}</strong>
{% endif %}
</details>
{% if emotion_fresh[loop.index0]['pos_emot'] != None %}
<div class="pos_emot">
<details> <details>
<summary class="emot_block"> <summary>
<strong class="emot_block">Позитивные эмоции</strong> {% if item.name != None %}
<h2 class="card-title post_zag" style="color:#c5f1ff">{{item.name}}</h2>
{% endif %}
</summary> </summary>
<p></p> {% if item.text != None %}
{% for item2 in emotion_fresh[loop.index0]['pos_emot'] %} <strong class="card-text" style="color:#ffffff">{{item.text}}</strong>
<strong class="alert alert-success" role="alert" style="border-radius: 22px;">{{item2}}</strong>
{% endfor %}
</details>
</div>
<p></p>
{% endif %}
{% if emotion_fresh[loop.index0]['nig_emot'] != None %}
<div class="nig_emot">
<details>
<summary class="emot_block">
<strong class="emot_block">Негативные эмоции</strong>
</summary>
<p></p>
{% for item2 in emotion_fresh[loop.index0]['nig_emot'] %}
<strong class="alert alert-danger" role="alert" style="border-radius: 22px;">{{item2}}</strong>
{% 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 current_user.is_authenticated %}
<div class="like">
<a type="button"
href="/new_like/{{current_user.id}}/{{item.id}}/publications">
{% if emotion_fresh[loop.index0]['is_like'] %}
<img src="../static/img/like_add.png" width="117" height="100">
{% else %}
<img src="../static/img/like.png" width="94" height="80">
{% endif %} {% endif %}
</a> </details>
{% if emotion_fresh[loop.index0]['like'] != None %} {% if emotion_fresh[loop.index0]['pos_emot'] != None %}
<p style="color:#ffffff">{{emotion_fresh[loop.index0]['like']}}</p> <div class="pos_emot">
{% endif %} <details>
</div> <summary class="emot_block">
{% endif %} <strong class="emot_block">Позитивные эмоции</strong>
{% if emotion_fresh[loop.index0]['link'] != None %} </summary>
<details> <p></p>
<summary class="emot_block"> {% for item2 in emotion_fresh[loop.index0]['pos_emot'] %}
<strong class="emot_block">Ссылки</strong> <strong class="alert alert-success" role="alert"
</summary> style="border-radius: 22px;">{{item2}}</strong>
<p></p> {% endfor %}
{% for item2 in emotion_fresh[loop.index0]['link'] %} </details>
<div class="link">
<a class="alert alert-light" role="alert" href="{{ item2 }}" style="border-radius: 22px;">Ссылка
{{ loop.index }}</a>
</div> </div>
<p></p> <p></p>
{% endfor %} {% endif %}
</details> {% if emotion_fresh[loop.index0]['nig_emot'] != None %}
{% endif %} <div class="nig_emot">
<div class="author" style="style=position:absolute; width:148px; height:44px; left:255px; -webkit-border-radius: <details>
<summary class="emot_block">
<strong class="emot_block">Негативные эмоции</strong>
</summary>
<p></p>
{% for item2 in emotion_fresh[loop.index0]['nig_emot'] %}
<strong class="alert alert-danger" role="alert"
style="border-radius: 22px;">{{item2}}</strong>
{% 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 current_user.is_authenticated %}
<div class="like">
<a type="button"
href="/new_like/{{current_user.id}}/{{item.id}}/publications">
{% if emotion_fresh[loop.index0]['is_like'] %}
<img src="../static/img/like_add.png" width="117" height="100">
{% else %}
<img src="../static/img/like.png" width="94" height="80">
{% endif %}
</a>
{% if emotion_fresh[loop.index0]['like'] != None %}
<p style="color:#ffffff">{{emotion_fresh[loop.index0]['like']}}</p>
{% endif %}
</div>
{% endif %}
{% if emotion_fresh[loop.index0]['link'] != None %}
<details>
<summary class="emot_block">
<strong class="emot_block">Ссылки</strong>
</summary>
<p></p>
{% for item2 in emotion_fresh[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>
{% endif %}
<div class="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: 22px;-moz-border-radius: 22px;border-radius: 22px; border:2px solid #FFFFFF; background-color:#1daff0; top:
98px;"><img src="../{{ emotion_fresh[loop.index0]['author'].photo }}" width="40" height="40" 98px;"><img src="../{{ emotion_fresh[loop.index0]['author'].photo }}" width="40" height="40"
style="border-radius: 22px"> style="border-radius: 22px">
<strong style="color: #ffffff">{{ emotion_fresh[loop.index0]['author'].name }}</strong> <strong style="color: #ffffff">{{ emotion_fresh[loop.index0]['author'].name }}</strong>
</div>
<strong style="color:#ffffff">{{item.date}}</strong>
</div> </div>
<strong style="color:#ffffff">{{item.date}}</strong> {% endfor %}
</div> </div>
{% endfor %} {% else %}
<div class="bad_centre" style="background-color:#1daff0; border-radius: 22px;color:#ffffff">
<h1 class="hz1">Ничего не нашлось :с</h1>
</div>
{% endif %}
</div>
</td>
<td id="row3">
<div id="row3_div">
<h1 class="post_zag">Для вас</h1>
</div> </div>
{% else %}
<div class="bad_centre" style="background-color:#1daff0; border-radius: 22px;color:#ffffff">
<h1 class="hz1">Ничего не нашлось :с</h1>
</div>
{% endif %}
</td> </td>
<td id="row3"></td>
</table> </table>
{% endblock %} {% endblock %}