mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-24 03:43:42 -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 %}
|
{% endif %}
|
||||||
{% include "community/_community_nav.html" %}
|
{% include "community/_community_nav.html" %}
|
||||||
{% if post_layout == 'masonry' or post_layout == 'masonry_wide' %}
|
{% if post_layout == 'masonry' or post_layout == 'masonry_wide' %}
|
||||||
<div class="post_list_{{ post_layout }}">
|
<div class="masonry" id="masonry">
|
||||||
{% for post in posts.items %}
|
<!-- Masonry columns will be added here -->
|
||||||
{% include 'post/_post_teaser_masonry.html' %}
|
|
||||||
{% else %}
|
|
||||||
<p>{{ _('No posts in this topic yet.') }}</p>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
</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 %}
|
{% else %}
|
||||||
<div class="post_list">
|
<div class="post_list">
|
||||||
{% for post in posts.items %}
|
{% for post in posts.items %}
|
||||||
|
|
Loading…
Add table
Reference in a new issue