Moona/templates/publications.html

348 lines
17 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<link rel="stylesheet" href="../static/css/publications.css">
{% extends "base.html" %}
{% block content %}
<table class="but">
<tr>
<td style="width: 110%;">
<h1 class="upp_zag">Публикации</h1>
</td>
{% if current_user.is_authenticated %}
<td>
<a href="/add_post" id="add_post" class="btn btn-primary"
style="background-color:#1daff0;border-radius: 15px;"><strong>Добавить
запись</strong></a>
</td>
{% endif %}
</tr>
</table>
<table>
<td id="row1">
<div id="row1_div">
<h2 class="post_zag">Популярное</h2>
<div class="fresh_block" id="pop">
{% if pop_post != [] %}
{% for item in pop_post %}
<div class="card-body post">
<details>
<summary>
{% if item.name != None %}
<h3 class="card-title post_zag" style="color:#c5f1ff">{{item.name}}</h3>
{% 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>
<summary class="emot_block">
<strong class="emot_block">Позитивные эмоции</strong>
</summary>
<p></p>
{% for item2 in emotion_pop[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_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 %}
</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:
98px;"><img src="../{{ emotion_pop[loop.index0]['author'].photo }}" width="40" height="40"
style="border-radius: 22px">
<strong style="color: #ffffff">{{ emotion_pop[loop.index0]['author'].name }}</strong>
</div>
<strong style="color:#ffffff">{{item.date}}</strong>
{% if current_user.is_authenticated %}
{% if current_user.role == 'admin' %}
<a style="border-radius: 15px;" href="/post_deleted/{{ item.id }}" class="btn btn-danger">
Удалить
</a>
{% endif %}
{% endif %}
</div>
{% endfor %}
</div>
{% else %}
<div class="bad_centre" style="background-color:#1daff0; border-radius: 22px;color:#ffffff">
<p class="hz1">Ничего не нашлось :с</p>
</div>
{% endif %}
</div>
</td>
<td id="row2">
<div id="row2_div">
<h2 class="post_zag">Свежее</h2>
<div class="fresh_block" id="fresh">
{% if fresh_post != [] %}
{% for item in fresh_post %}
<div class="card-body post">
<details>
<summary>
{% if item.name != None %}
<h3 class="card-title post_zag" style="color:#c5f1ff">{{item.name}}</h3>
{% 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>
<summary class="emot_block">
<strong class="emot_block">Позитивные эмоции</strong>
</summary>
<p></p>
{% for item2 in emotion_fresh[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_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 %}
</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:
98px;"><img src="../{{ emotion_fresh[loop.index0]['author'].photo }}" width="40" height="40"
style="border-radius: 22px">
<strong style="color: #ffffff">{{ emotion_fresh[loop.index0]['author'].name }}</strong>
</div>
<strong style="color:#ffffff">{{item.date}}</strong>
{% if current_user.is_authenticated %}
{% if current_user.role == 'admin' %}
<a style="border-radius: 15px;" href="/post_deleted/{{ item.id }}" class="btn btn-danger">
Удалить
</a>
{% endif %}
{% endif %}
</div>
{% endfor %}
</div>
{% else %}
<div class="bad_centre" style="background-color:#1daff0; border-radius: 22px;color:#ffffff">
<p class="hz1">Ничего не нашлось :с</p>
</div>
{% endif %}
</div>
</td>
<td id="row3">
<div id="row3_div">
<h2 class="post_zag">Для вас</h2>
{% if for_me_post != [] %}
{% for item in for_you_post %}
<div class="card-body post">
<details>
<summary>
{% if item.name != None %}
<h3 class="card-title post_zag" style="color:#c5f1ff">{{item.name}}</h3>
{% endif %}
</summary>
{% if item.text != None %}
<strong class="card-text" style="color:#ffffff">{{item.text}}</strong>
{% endif %}
</details>
{% if emotion_for_you[loop.index0]['pos_emot'] != None %}
<div class="pos_emot">
<details>
<summary class="emot_block">
<strong class="emot_block">Позитивные эмоции</strong>
</summary>
<p></p>
{% for item2 in emotion_for_you[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_for_you[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_for_you[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_for_you[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_for_you[loop.index0]['like'] != None %}
<p style="color:#ffffff">{{emotion_for_you[loop.index0]['like']}}</p>
{% endif %}
</div>
{% endif %}
{% if emotion_for_you[loop.index0]['link'] != None %}
<details>
<summary class="emot_block">
<strong class="emot_block">Ссылки</strong>
</summary>
<p></p>
{% for item2 in emotion_for_you[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:
98px;"><img src="../{{ emotion_for_you[loop.index0]['author'].photo }}" width="40" height="40"
style="border-radius: 22px">
<strong style="color: #ffffff">{{ emotion_for_you[loop.index0]['author'].name }}</strong>
</div>
<strong style="color:#ffffff">{{item.date}}</strong>
{% if current_user.is_authenticated %}
{% if current_user.role == 'admin' %}
<a style="border-radius: 15px;" href="/post_deleted/{{ item.id }}" class="btn btn-danger">
Удалить
</a>
{% endif %}
{% endif %}
</div>
{% endfor %}
</div>
{% else %}
<div class="bad_centre" style="background-color:#1daff0; border-radius: 22px;color:#ffffff">
<p class="hz1">Ничего не нашлось :с</p>
</div>
{% endif %}
</div>
</td>
</table>
{% endblock %}