chat_container.html 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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_post_url|default(detail_url) }}" hx-post="{{ detail_post_url|default(detail_url) }}"
  9. hx-target="#comments-history" hx-swap="outerHTML" hx-push-url="false"
  10. hx-sync="#comments-history:replace"
  11. hx-disabled-elt="#comments-history button" enctype="multipart/form-data" hx-encoding="multipart/form-data"
  12. data-max-file-size="{{ upload_max_bytes|default(50 * 1024 * 1024) }}" data-max-file-size-mb="{{ upload_max_mb|default(50) }}">
  13. <input type="hidden" name="_csrf" value="{{ request.state.principal.csrf }}" />
  14. <input type="file" name="attachments" id="comment-attachments" multiple hidden>
  15. <input type="hidden" name="attachment_ids" value="[]">
  16. <div class="gc-comment-compose">
  17. <button type="button" class="btn btn-outline-secondary" data-gc-attach aria-label="Dateien anhängen" title="Dateien anhängen">
  18. <i class="icon icon-lg cil-paperclip"></i>
  19. </button>
  20. <input type="hidden" name="source" value="comments" />
  21. <input type="text" class="message-input" id="comment" name="Kommentar" placeholder="Kommentieren ..."
  22. aria-label="Kommentar" aria-describedby="attachment-hint" />
  23. <button type="submit" class="btn btn-primary" disabled>Abschicken
  24. </button>
  25. </div>
  26. <p class="gc-upload-hint" id="attachment-hint">Dateien hier ablegen oder über die Büroklammer auswählen. Max. {{ upload_max_mb|default(50) }} MB je Datei.</p>
  27. <ul class="gc-upload-queue" aria-label="Ausgewählte Dateien"></ul>
  28. <p class="gc-upload-status" role="status" aria-live="polite"></p>
  29. </form>
  30. </div>
  31. </div>
  32. </div>
  33. <script>
  34. window.setTimeout(function() {
  35. const content = document.getElementById("chatContent");
  36. if (content) content.scrollTop = content.scrollHeight;
  37. }, 1000);
  38. </script>