Enhance newsletter HTML generation and UI components

- Introduce helper functions `_outlook_font` and `_outlook_link` for better formatting in Outlook-compatible HTML.
- Update `create_outlook_html` to utilize new font and link functions, improving the overall appearance of the newsletter.
- Modify CSS to add styles for a new copy dialog overlay and related components.
- Refactor JavaScript to improve copy functionality and add a dialog for copying HTML content.
- Update dashboard template to enhance user instructions for copying and downloading HTML content.
This commit is contained in:
smueller
2026-07-03 13:17:11 +02:00
parent 90cdb7e922
commit df4424fdf9
4 changed files with 259 additions and 155 deletions

View File

@@ -98,8 +98,9 @@
<section class="card">
<h3>Newsletter-Vorschau (mit Hyperlinks)</h3>
<p class="hint">Für Outlook „Für Outlook kopieren“ nutzen und mit <strong>Strg+V</strong> einfügen (Rechtsklick → „Format beibehalten“). Falls Kopieren nicht klappt (z. B. per HTTP/IP), „HTML herunterladen“ verwenden und die Datei in Outlook öffnen.</p>
<p class="hint"><strong>Empfohlen für Outlook:</strong> „Im Browser öffnen“ → dort <strong>Strg+A</strong>, <strong>Strg+C</strong> → in Outlook <strong>Strg+V</strong>. Alternativ „Für Outlook kopieren“ und mit Rechtsklick → „Format beibehalten“ einfügen.</p>
<div class="copy-actions">
<button type="button" id="open-outlook-btn" class="btn-secondary">Im Browser öffnen</button>
<button type="button" id="copy-outlook-btn" class="btn-secondary">Für Outlook kopieren</button>
<button type="button" id="copy-html-source-btn" class="btn-secondary">HTML-Quelltext kopieren</button>
<button type="button" id="download-html-btn" class="btn-secondary">HTML herunterladen</button>
@@ -119,7 +120,11 @@
<section class="card">
<h3>Output: HTML-Quelltext</h3>
<p class="hint">Bei Problemen mit „Kopieren“: Textfeld markieren (Strg+A) und manuell kopieren (Strg+C).</p>
<p class="hint">Öffnet ein Fenster mit markiertem Text dort <strong>Strg+C</strong> drücken. Funktioniert auch ohne HTTPS.</p>
<div class="textarea-actions">
<button type="button" id="copy-html-source-btn-2" class="btn-secondary">HTML-Quelltext kopieren</button>
<button type="button" id="download-html-source-btn" class="btn-secondary">HTML-Quelltext herunterladen</button>
</div>
<textarea id="newsletter-html-display" rows="12" readonly>{{ raw_html }}</textarea>
</section>
@@ -195,5 +200,5 @@
{% endblock %}
{% block scripts %}
<script src="/static/js/newsletter.js"></script>
<script src="/static/js/newsletter.js?v=5"></script>
{% endblock %}