mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
masonry - on topics too #106
This commit is contained in:
parent
4f79d3a349
commit
5c1da0a0be
1 changed files with 13 additions and 6 deletions
|
@ -29,13 +29,20 @@
|
|||
{% endif %}
|
||||
{% include "community/_community_nav.html" %}
|
||||
{% if post_layout == 'masonry' or post_layout == 'masonry_wide' %}
|
||||
<div class="post_list_{{ post_layout }}">
|
||||
{% for post in posts.items %}
|
||||
{% include 'post/_post_teaser_masonry.html' %}
|
||||
{% else %}
|
||||
<p>{{ _('No posts in this topic yet.') }}</p>
|
||||
{% endfor %}
|
||||
<div class="masonry" id="masonry">
|
||||
<!-- Masonry columns will be added here -->
|
||||
</div>
|
||||
<script nonce="{{ session['nonce'] }}">
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
const masonry = document.getElementById('masonry');
|
||||
const htmlSnippets = [
|
||||
{% for post in posts.items %}
|
||||
{% raw %}`{% endraw %}{% include 'post/_post_teaser_masonry.html' %}{% raw %}`{% endraw %},
|
||||
{% endfor %}
|
||||
];
|
||||
renderMasonry(masonry, htmlSnippets);
|
||||
});
|
||||
</script>
|
||||
{% else %}
|
||||
<div class="post_list">
|
||||
{% for post in posts.items %}
|
||||
|
|
Loading…
Add table
Reference in a new issue