Update configuration and enhance newsletter generation features
- Change WIKI_API_URL in .env.example and config to point to the new API endpoint. - Set COOKIE_SECURE to false for local development in .env.example and config. - Improve the newsletter generation logic to handle new and edited articles separately. - Add display options for showing date, user, and category in the newsletter output. - Enhance error handling for Wiki API requests and update templates for better user feedback. - Update CSS for new UI elements and improve overall layout in dashboard and login pages.
This commit is contained in:
@@ -14,6 +14,21 @@
|
||||
<input type="checkbox" name="only_edited" value="true" {% if filters.only_edited %}checked{% endif %}>
|
||||
Nur bearbeitete Artikel (keine neu erstellten)
|
||||
</label>
|
||||
<fieldset class="display-options">
|
||||
<legend>Anzeige im Output</legend>
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="show_date" value="true" {% if filters.display.show_date %}checked{% endif %}>
|
||||
Datum anzeigen
|
||||
</label>
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="show_user" value="true" {% if filters.display.show_user %}checked{% endif %}>
|
||||
Benutzer anzeigen
|
||||
</label>
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="show_category" value="true" {% if filters.display.show_category %}checked{% endif %}>
|
||||
Kategorie anzeigen
|
||||
</label>
|
||||
</fieldset>
|
||||
{% if user.role in ["admin", "editor"] %}
|
||||
<button type="submit">Newsletter generieren</button>
|
||||
{% endif %}
|
||||
@@ -21,6 +36,9 @@
|
||||
{% if user.role == "admin" %}
|
||||
<p><a href="/admin/users">Zur Benutzerverwaltung</a></p>
|
||||
{% endif %}
|
||||
{% if wiki_error %}
|
||||
<p class="error">{{ wiki_error }}</p>
|
||||
{% endif %}
|
||||
</section>
|
||||
|
||||
{% if user.role in ["admin", "editor"] %}
|
||||
@@ -31,6 +49,9 @@
|
||||
<input type="hidden" name="days" value="{{ filters.days }}">
|
||||
<input type="hidden" name="category" value="{{ filters.category }}">
|
||||
<input type="hidden" name="only_edited" value="{{ 'true' if filters.only_edited else 'false' }}">
|
||||
<input type="hidden" name="show_date" value="{{ 'true' if filters.display.show_date else 'false' }}">
|
||||
<input type="hidden" name="show_user" value="{{ 'true' if filters.display.show_user else 'false' }}">
|
||||
<input type="hidden" name="show_category" value="{{ 'true' if filters.display.show_category else 'false' }}">
|
||||
<button type="submit">Newsletter jetzt senden</button>
|
||||
</form>
|
||||
</section>
|
||||
@@ -76,29 +97,76 @@
|
||||
{% endif %}
|
||||
|
||||
<section class="card">
|
||||
<h3>Output: Outlook Text</h3>
|
||||
<textarea rows="14" readonly>{{ plain_text }}</textarea>
|
||||
<h3>Newsletter-Vorschau (mit Hyperlinks)</h3>
|
||||
<p class="hint">Für Outlook den Button „Für Outlook kopieren“ nutzen – dann bleiben Links als klickbare Hyperlinks erhalten.</p>
|
||||
<div class="copy-actions">
|
||||
<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>
|
||||
<span id="copy-status" class="copy-status" aria-live="polite"></span>
|
||||
</div>
|
||||
<iframe id="newsletter-preview-frame" class="newsletter-preview-frame" title="Newsletter Vorschau"></iframe>
|
||||
<textarea id="newsletter-html-source" class="hidden-source" hidden readonly>{{ raw_html }}</textarea>
|
||||
<textarea id="newsletter-plain-source" class="hidden-source" hidden readonly>{{ plain_text }}</textarea>
|
||||
</section>
|
||||
|
||||
<section class="card">
|
||||
<h3>Output: Raw HTML</h3>
|
||||
<textarea rows="14" readonly>{{ raw_html }}</textarea>
|
||||
<h3>Output: Nur-Text (Fallback)</h3>
|
||||
<p class="hint">Enthält URLs als Text. Für klickbare Links bitte die Vorschau bzw. „Für Outlook kopieren“ verwenden.</p>
|
||||
<textarea rows="16" readonly>{{ plain_text }}</textarea>
|
||||
</section>
|
||||
|
||||
<section class="card">
|
||||
<h3>Gefundene Artikel ({{ articles|length }})</h3>
|
||||
<h3>Output: HTML-Quelltext</h3>
|
||||
<textarea rows="12" readonly>{{ raw_html }}</textarea>
|
||||
</section>
|
||||
|
||||
<section class="card">
|
||||
<h3>Neue Artikel ({{ articles_new|length }})</h3>
|
||||
<table>
|
||||
<thead>
|
||||
<tr><th>Titel</th><th>Zeit</th><th>Benutzer</th><th>Kategorien</th></tr>
|
||||
<tr>
|
||||
<th>Titel</th>
|
||||
{% if filters.display.show_date %}<th>Zeit</th>{% endif %}
|
||||
{% if filters.display.show_user %}<th>Benutzer</th>{% endif %}
|
||||
{% if filters.display.show_category %}<th>Kategorien</th>{% endif %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for item in articles %}
|
||||
{% for item in articles_new %}
|
||||
<tr>
|
||||
<td>{{ item.title }}</td>
|
||||
<td>{{ item.timestamp }}</td>
|
||||
<td>{{ item.user }}</td>
|
||||
<td>{{ item.categories|join(", ") }}</td>
|
||||
<td><a href="{{ wiki_article_url(item.title) }}" target="_blank" rel="noopener">{{ item.title }}</a></td>
|
||||
{% if filters.display.show_date %}<td>{{ item.timestamp }}</td>{% endif %}
|
||||
{% if filters.display.show_user %}<td>{{ item.user }}</td>{% endif %}
|
||||
{% if filters.display.show_category %}<td>{{ item.categories|join(", ") }}</td>{% endif %}
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr><td colspan="4">Keine neuen Artikel im gewählten Zeitraum.</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
<section class="card">
|
||||
<h3>Bearbeitete Artikel ({{ articles_edited|length }})</h3>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Titel</th>
|
||||
{% if filters.display.show_date %}<th>Zeit</th>{% endif %}
|
||||
{% if filters.display.show_user %}<th>Benutzer</th>{% endif %}
|
||||
{% if filters.display.show_category %}<th>Kategorien</th>{% endif %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for item in articles_edited %}
|
||||
<tr>
|
||||
<td><a href="{{ wiki_article_url(item.title) }}" target="_blank" rel="noopener">{{ item.title }}</a></td>
|
||||
{% if filters.display.show_date %}<td>{{ item.timestamp }}</td>{% endif %}
|
||||
{% if filters.display.show_user %}<td>{{ item.user }}</td>{% endif %}
|
||||
{% if filters.display.show_category %}<td>{{ item.categories|join(", ") }}</td>{% endif %}
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr><td colspan="4">Keine bearbeiteten Artikel im gewählten Zeitraum.</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -122,3 +190,7 @@
|
||||
</table>
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
<script src="/static/js/newsletter.js"></script>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user