246 lines
12 KiB
HTML
246 lines
12 KiB
HTML
<link rel="stylesheet" href="../static/css/diary.css">
|
||
{% extends "base.html" %}
|
||
|
||
{% 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>
|
||
<table>
|
||
<td id="row1">
|
||
<h1 class="my_post_zag">Публикации</h1>
|
||
<div id="all_my_post1">
|
||
{% if my_post != [] %}
|
||
{% for item in pub_post %}
|
||
<div class="card-body" id="my_post1">
|
||
<details>
|
||
<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 %}
|
||
</details>
|
||
{% if emotion_pub[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_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">
|
||
<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>
|
||
<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">Запись
|
||
опубликована
|
||
</div>
|
||
{% else %}
|
||
<div style="border-radius: 22px;" class="alert alert-danger private" role="alert">Запись
|
||
приватная
|
||
</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">
|
||
<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>
|
||
{% 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="row2">
|
||
<h1 class="my_post_zag">Мои мысли</h1>
|
||
<div id="all_my_post">
|
||
{% if my_post != [] %}
|
||
{% for item in my_post %}
|
||
<div class="card-body" id="my_post">
|
||
<details>
|
||
<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 %}
|
||
</details>
|
||
{% if emotion[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[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[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[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 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">Запись
|
||
опубликована
|
||
</div>
|
||
{% else %}
|
||
<div style="border-radius: 22px;" class="alert alert-danger private" role="alert">Запись
|
||
приватная
|
||
</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">
|
||
<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 %}
|
||
{% else %}
|
||
<div class="bad_centre" style="background-color:#1daff0; border-radius: 22px;color:#ffffff">
|
||
<h1 class="hz1">Ничего не нашлось :с</h1>
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
</td>
|
||
<td id="all_my_question">
|
||
<h1 class="my_post_zag">Вопросы дня</h1>
|
||
<div class="my_post">
|
||
<div class="question">
|
||
{% for item in question %}
|
||
<a href="/answer_quest/{{item.id}}" class="btn">
|
||
{% if item.id in ans %}
|
||
<div class="is_ans">
|
||
<strong>{{item.quest}}</strong>
|
||
<div class="alert alert-success" role="alert" style="border-radius: 25px;">Ответ есть</div>
|
||
<strong>{{ans[item.id].answer}}</strong>
|
||
</div>
|
||
{% else %}
|
||
<div class="is_ans">
|
||
<strong>{{item.quest}}</strong>
|
||
<div class="alert alert-danger" role="alert" style="border-radius: 25px;">Ответа нет</div>
|
||
</div>
|
||
{% endif %}
|
||
</a>
|
||
{% endfor %}
|
||
</div>
|
||
</div>
|
||
</td>
|
||
</table>
|
||
{% else %}
|
||
<div class="bad_user">
|
||
<div class="bad_centre">
|
||
<h1 id="hz1">Вы не авторизованы в системе</h1>
|
||
<h2 id="hz2">Поэтому вам не доступна страница личного дневника</h2><strong id="sz1">Но вы можете посмотреть
|
||
публикации других пользователей в разделе <a href="/" style="color:#a9e4ff">Главная</a> или <a
|
||
href="/publications" style="color:#a9e4ff">Публикации</a></strong>
|
||
<p></p>
|
||
<img id="image" src="../static/img/Надпись Moona без фона.png"></div>
|
||
</div>
|
||
{% endif %}
|
||
{% endblock %} |