flask-htmx-board1/templates/i-posts.html

87 lines
5.6 KiB
HTML
Raw Normal View History

2023-07-13 19:59:56 +10:00
{% if postos | length > 0 %}
2023-07-14 13:19:50 +10:00
{% for posto in postos %}
<div class="row">
{% if posto.root_post %}
2023-07-19 01:30:56 +10:00
<div class="card s5 deep-orange accent-4 darken-1">
2023-07-14 13:19:50 +10:00
{% else %}
2023-07-19 01:30:56 +10:00
<div class="card s5 blue-grey darken-1">
2023-07-14 13:19:50 +10:00
{% endif %}
2024-01-30 00:14:31 +10:00
<div class="card-content white-text">
2024-01-30 00:22:50 +10:00
<span class="new badge yellow" data-badge-caption="">
<a class="purple-text" href="#post-{{ posto._key }}"> #{{ posto._key }} </a>
2024-01-30 00:18:17 +10:00
</span>
2024-01-30 00:14:31 +10:00
<span class="new badge blue" data-badge-caption="">Ответов: {{ posto.answers_num }}</span>
<span class="new badge red" data-badge-caption="">Длина треда: {{ posto.children_num }}</span>
</div>
2023-07-14 13:19:50 +10:00
<div class="row" id="post-{{ posto._key }}">
2024-01-29 23:59:38 +10:00
2024-01-31 23:56:43 +10:00
{% if posto.images | length > 0 %}
2024-01-30 00:02:38 +10:00
<div class="col s4">
2024-01-31 23:58:05 +10:00
<div class="card-image" style=" margin:10px; ">
2024-01-29 23:51:59 +10:00
<!-- <div class="hex-main">
2023-07-14 13:19:50 +10:00
<div class="hex-container">
<a href="https://loremflickr.com/g/320/240/paris" target="_blank" ">
<img src="https://loremflickr.com/g/320/240/paris">
</a>
</div>
2024-01-29 23:51:59 +10:00
</div> -->
2024-01-31 23:58:05 +10:00
2024-01-31 23:53:00 +10:00
<a href="https://static.guaranteedstruggle.host/thread-pics/photo_2023-05-16_00-49-34.jpg" target="_blank" ">
<img src="https://static.guaranteedstruggle.host/thread-pics/photo_2023-05-16_00-49-34.jpg">
</a>
2024-01-30 00:04:10 +10:00
<span class="card-title"><a class="link" href="#post-{{ posto.parent_post }}"> >>{{ posto.parent_post }} </a> </span>
2024-01-31 23:58:05 +10:00
2023-07-14 13:19:50 +10:00
</div>
2023-07-14 13:16:05 +10:00
</div>
2024-01-30 00:02:38 +10:00
{% endif %}
2024-01-30 00:19:43 +10:00
<!-- <div class="col s8">
2023-07-14 13:19:50 +10:00
<div class="card-content white-text">
<span class="card-title">#{{ posto._key }}
<span class="new badge blue" data-badge-caption="">Ответов: {{ posto.answers_num }}</span>
<span class="new badge red" data-badge-caption="">Длина треда: {{ posto.children_num }}</span>
</span>
{% if posto.parent_post %}
2024-01-30 00:13:23 +10:00
<a class="link orange-text purple" href="#post-{{ posto.parent_post }}"> >>{{ posto.parent_post }} </a>
2023-07-14 13:19:50 +10:00
{% endif %}
2024-01-30 00:19:43 +10:00
<p>{{ posto.texto }}</p>
2023-07-14 13:19:50 +10:00
</div>
2024-01-30 00:19:43 +10:00
</div> -->
2024-01-30 00:24:54 +10:00
<div class="col s12 card-content white-text">
2024-01-30 00:25:24 +10:00
{% if posto.parent_post %}
<a class="link orange-text purple" href="#post-{{ posto.parent_post }}"> >>{{ posto.parent_post }} </a>
{% endif %}
2024-01-30 00:22:50 +10:00
<p>{{ posto.texto }}</p>
2024-01-30 00:26:45 +10:00
</div>
2024-01-30 00:27:50 +10:00
<div class="col s12 card-action white-text">
<div class="right">
2024-01-29 02:11:01 +10:00
<!-- <a href="#" hx-post="/post_my_post/{{ posto._key }}" hx-target="#neu-posts" >Answer me!</a> -->
<a href="#answer-post" hx-post="/answer_post/{{ posto._key }}" hx-target="#answer-post" >Ответить этому.</a>
</div>
</div>
2024-01-30 00:24:54 +10:00
<div class="col s12 card-content white-text">
2023-07-19 01:48:55 +10:00
<!-- TODO !подгрузка следующего поста в конец треда без перезагрузки всего треда! -->
2024-01-30 00:09:03 +10:00
<div class="left">
2024-01-29 02:08:44 +10:00
<!-- <a href="#" hx-post="/post_my_post/{{ posto._key }}" hx-target="#neu-posts" >Answer me!</a> -->
{% if posto.answers_list[0] | length > 0 %}
<p>Ответы:</p>
{% for ans in posto.answers_list[0] %}
{% if (posto.answers_list[1])[loop.index-1] > 0 %}
{% if (posto.answers_list[2])[loop.index-1] > 0 %}
2024-01-30 00:08:46 +10:00
<a href="#post-{{ (posto.answers_list[0])[loop.index-1] }}" class="lime-text red collection-item" style="padding: 2px 2px;">>>{{ (posto.answers_list[0])[loop.index-1] }} (ответов {{ (posto.answers_list[1])[loop.index-1] }}, длина {{ (posto.answers_list[2])[loop.index-1] }})</a>
2024-01-29 02:08:44 +10:00
{% else %}
2024-01-30 00:08:46 +10:00
<a href="#post-{{ (posto.answers_list[0])[loop.index-1] }}" class="lime-text red collection-item" style="padding: 2px 2px;">>>{{ (posto.answers_list[0])[loop.index-1] }} (ответов {{ (posto.answers_list[1])[loop.index-1] }})</a>
2024-01-29 02:08:44 +10:00
{% endif %}
{% else %}
2024-01-30 00:08:46 +10:00
<a href="#post-{{ (posto.answers_list[0])[loop.index-1] }}" class="lime-text red collection-item" style="padding: 2px 2px;">>>{{ (posto.answers_list[0])[loop.index-1] }}</a>
2024-01-29 02:08:44 +10:00
{% endif %}
{% endfor %}
{% endif %}
</div>
2023-07-14 13:16:05 +10:00
</div>
2023-07-13 20:23:27 +10:00
</div>
2023-07-13 21:34:06 +10:00
</div>
2023-07-14 13:19:50 +10:00
</div>
2023-07-14 13:16:32 +10:00
{% endfor %}
2023-07-13 19:50:45 +10:00
{% endif %}