flask-htmx-board1/templates/i-posts.html
Simple_Not 48ec4c9c59
All checks were successful
continuous-integration/drone/push Build is passing
we can chat now?
2023-07-19 01:22:07 +10:00

54 lines
2.9 KiB
HTML

{% if postos | length > 0 %}
{% for posto in postos %}
<div class="row">
{% if posto.root_post %}
<div class="card s4 deep-orange accent-4 darken-1">
{% else %}
<div class="card s4 blue-grey darken-1">
{% endif %}
<div class="row" id="post-{{ posto._key }}">
<div class="col s4">
<div class="card-image">
<div class="hex-main">
<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>
</div>
</div>
</div>
<div class="col s8">
<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 %}
<a class="card-action" href="#post-{{ posto.parent_post }}"> >>{{ posto.parent_post }} </a>
{% endif %}
<p>{{ posto.texto }}</p>
{% if posto.answers_list[0] | length > 0 %}
<br>
<p>Ответы:</p>
<div class="collection">
{% for ans in posto.answers_list[0] %}
<a href="#post-{{ (posto.answers_list[0])[loop.index] }}" class="collection-item">>>{{ (posto.answers_list[0])[loop.index] }} (ответов {{ (posto.answers_list[1])[loop.index] }})</a>
{% endfor %}
</div>
{% endif %}
</div>
</div>
<div class="col s12">
<div class="card-action right">
<!-- <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>
</div>
</div>
</div>
{% endfor %}
{% endif %}