chat_container.html 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <div class="chat-container" id="chat"
  2. hx-on::after-swap="const content = this.querySelector('#chatContent'); if (content) content.scrollTop = content.scrollHeight;">
  3. <div class="header">
  4. <div class="header-left">
  5. <div class="avatar">
  6. <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none"
  7. stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  8. <path
  9. d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z">
  10. </path>
  11. </svg>
  12. </div>
  13. <div class="course-info">
  14. <div class="course-title">{{ forderungen_details[0].Kunde_Text }} / {{ forderungen_details[0].Beleg_Nr }}</div>
  15. <div class="course-participants">Kommentare zum Beleg</div>
  16. </div>
  17. </div>
  18. </div>
  19. {% include 'forderungen/details/details_kommentare.html' %}
  20. <div class="input-area">
  21. <div class="toolbar">
  22. <form id="comment-form" method="post" action="{{ detail_url }}" hx-post="{{ detail_url }}"
  23. hx-target="#comments-history" hx-swap="outerHTML" hx-push-url="false"
  24. hx-sync="#comments-history:replace"
  25. hx-disabled-elt="#comment-form input, #comment-form button, #comments-history button"
  26. hx-on::after-request="if (event.detail.successful) this.querySelector('[name=Kommentar]').value = ''">
  27. <input type="hidden" name="_csrf" value="{{ request.state.principal.csrf }}" />
  28. <button type="button" class="btn btn-outline-secondary" aria-label="Dateianhang (noch nicht verfügbar)" disabled>
  29. <i class="icon icon-lg cil-paperclip"></i>
  30. </button>
  31. <input type="hidden" name="source" value="comments" />
  32. <input type="text" class="message-input" id="comment" name="Kommentar" placeholder="Kommentieren ..."
  33. aria-label="Kommentar" />
  34. <button type="submit" class="btn btn-primary" aria-label="Kommentar speichern">
  35. <i class="icon icon-lg cil-chevron-right"></i>
  36. </button>
  37. </form>
  38. </div>
  39. </div>
  40. </div>
  41. <script>
  42. window.setTimeout(function() {
  43. const content = document.getElementById("chatContent");
  44. if (content) content.scrollTop = content.scrollHeight;
  45. }, 1000);
  46. </script>