chat_container.html 1.9 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <div class="chat-container" id="chat"
  2. hx-on::after-swap="const content = this.querySelector('#chatContent'); if (content) content.scrollTop = content.scrollHeight;">
  3. <h2 class="gc-section-title" id="comments-title"><i class="icon cil-chat-bubble" aria-hidden="true"></i> Kommentare</h2>
  4. <p class="gc-section-description">{{ forderungen_details[0].Kunde_Text }} / {{ forderungen_details[0].Beleg_Nr }}</p>
  5. {% include 'forderungen/details/details_kommentare.html' %}
  6. <div class="input-area">
  7. <div class="toolbar">
  8. <form id="comment-form" method="post" action="{{ detail_url }}" hx-post="{{ detail_url }}"
  9. hx-target="#comments-history" hx-swap="outerHTML" hx-push-url="false"
  10. hx-sync="#comments-history:replace"
  11. hx-disabled-elt="#comment-form input, #comment-form button, #comments-history button"
  12. hx-on::after-request="if (event.detail.successful) this.querySelector('[name=Kommentar]').value = ''">
  13. <input type="hidden" name="_csrf" value="{{ request.state.principal.csrf }}" />
  14. <button type="button" class="btn btn-outline-secondary" aria-label="Dateianhang (noch nicht verfügbar)" disabled>
  15. <i class="icon icon-lg cil-paperclip"></i>
  16. </button>
  17. <input type="hidden" name="source" value="comments" />
  18. <input type="text" class="message-input" id="comment" name="Kommentar" placeholder="Kommentieren ..."
  19. aria-label="Kommentar" />
  20. <button type="submit" class="btn btn-primary" aria-label="Kommentar speichern">
  21. <i class="icon icon-lg cil-chevron-right"></i>
  22. </button>
  23. </form>
  24. </div>
  25. </div>
  26. </div>
  27. <script>
  28. window.setTimeout(function() {
  29. const content = document.getElementById("chatContent");
  30. if (content) content.scrollTop = content.scrollHeight;
  31. }, 1000);
  32. </script>