-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0a70301
commit 832b1e8
Showing
4 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
lacommunaute/templates/forum_conversation/topic_simple_list.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{% load i18n %} | ||
<div id="topicsarea"> | ||
{% if topics or not hide_if_empty %} | ||
<hr> | ||
{% for topic in topics %} | ||
<div class="row"> | ||
<div class="col-12"> | ||
<div id="{{ topic.pk }}" class="post mb-3"> | ||
<div class="mb-1 d-flex flex-column flex-md-row align-items-md-center"> | ||
<p class="h4 mb-0 flex-grow-1"> | ||
<a href="{% url 'forum_conversation:topic' topic.forum.slug topic.forum.pk topic.slug topic.pk %}" | ||
class="matomo-event" | ||
data-matomo-category="engagement" | ||
data-matomo-action="view" | ||
data-matomo-option="topic">{{ topic.subject }}</a> | ||
</p> | ||
</div> | ||
<div class="pt-0"> | ||
<div class="row"> | ||
<div class="col-12 post-content-wrapper mb-1"> | ||
{% include "forum_conversation/partials/poster.html" with post=topic.first_post topic=topic is_topic_head=True forum=forum %} | ||
</div> | ||
<div class="col-12 post-content"> | ||
<div id="showmoretopicsarea{{ topic.pk }}"> | ||
{% include 'partials/rendered_md.html' with content=topic.first_post.content truncatechars=1 only %} | ||
{% if topic.first_post.content.rendered|length > 200 %} | ||
<a hx-get="{% url 'forum_conversation_extension:showmore_topic' topic.forum.slug topic.forum.pk topic.slug topic.pk %}" | ||
id="showmoretopic-button{{ topic.pk }}" | ||
hx-target="#showmoretopicsarea{{ topic.pk }}" | ||
hx-swap="outerHTML" | ||
class="btn btn-link p-0 mh-auto matomo-event" | ||
data-matomo-category="engagement" | ||
data-matomo-action="showmore" | ||
data-matomo-option="topic">{% trans "+ show more" %}</a> | ||
{% endif %} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div id="showmorepostsarea{{ topic.pk }}"> | ||
<div id="postinfeedarea{{ topic.pk }}"> | ||
{% include "forum_conversation/partials/post_feed_form_collapsable.html" with post_form=form %} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="row align-items-sm-center mb-3"> | ||
<div class="col-12 col-sm"> | ||
{% include "forum_conversation/partials/topic_detail_actions.html" with posts_count=topic.posts_count %} | ||
</div> | ||
</div> | ||
<hr> | ||
{% endfor %} | ||
{% endif %} | ||
</div> | ||
<script nonce="{{ request.csp_nonce }}"> | ||
var showmorepostsButtons = document.querySelectorAll('.showmoreposts-button') | ||
showmorepostsButtons.forEach((button) => button.addEventListener('click', function() { | ||
button.classList.add('d-none'); | ||
})); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters