🔖 Release v1.4.5
This commit is contained in:
parent
691c9e00b6
commit
e7d98dba3a
10 changed files with 1322 additions and 147 deletions
52
app.py
52
app.py
|
|
@ -15,25 +15,16 @@ import os
|
|||
st.set_page_config(page_title="📰 RSS Artikel Manager", layout="wide")
|
||||
st.title("📰 RSS Artikel Manager")
|
||||
|
||||
# RSS Feed Verwaltung
|
||||
# === Sidebar: Feed-Verwaltung ===
|
||||
st.sidebar.header("📡 RSS Feeds verwalten")
|
||||
feeds = load_feeds()
|
||||
new_feed = st.sidebar.text_input("Neuen RSS Feed hinzufügen")
|
||||
if st.sidebar.button("Feed hinzufügen"):
|
||||
if new_feed and new_feed not in feeds:
|
||||
if new_feed and new_feed not in [f.get("url", f) for f in feeds]:
|
||||
feeds.append({"url": new_feed})
|
||||
save_feeds(feeds)
|
||||
st.sidebar.success("Feed hinzugefügt")
|
||||
|
||||
#if feeds:
|
||||
# st.sidebar.write("### Aktuelle Feeds:")
|
||||
# for feed in feeds:
|
||||
# url = feed["url"] if isinstance(feed, dict) else feed
|
||||
# st.sidebar.markdown(f"- {url}")
|
||||
#else:
|
||||
# st.sidebar.info("Noch keine Feeds hinzugefügt.")
|
||||
|
||||
# Artikel laden
|
||||
if st.sidebar.button("🔄 Alle Feeds neu laden"):
|
||||
existing_ids = [a["id"] for a in load_articles()]
|
||||
process_articles(existing_ids)
|
||||
|
|
@ -43,27 +34,40 @@ if st.sidebar.button("✍️ Artikel umschreiben (Rewrite)"):
|
|||
rewrite_articles()
|
||||
st.rerun()
|
||||
|
||||
# Artikelübersicht
|
||||
# === Hauptbereich: Artikelübersicht ===
|
||||
st.header("📋 Artikelübersicht")
|
||||
status_filter = st.selectbox("Status filtern", ["Alle", "New", "Rewrite", "Process", "Online", "On Hold", "Trash"])
|
||||
status_filter = st.selectbox("Status filtern", ["Alle", "New", "Rewrite", "Process", "Online", "On Hold", "Trash"], index=1)
|
||||
|
||||
articles = load_articles()
|
||||
if status_filter != "Alle":
|
||||
articles = [a for a in articles if a.get("status") == status_filter]
|
||||
|
||||
# Tabelle anzeigen
|
||||
# === Artikel-Tabelle ===
|
||||
if articles:
|
||||
st.markdown("### 📄 Übersichtstabelle")
|
||||
st.write("**Spaltenübersicht:** Auswahl | Datum | Titel | Zusammenfassung | Wörter | Tags | Status")
|
||||
|
||||
for article in articles:
|
||||
has_incomplete_images = any(
|
||||
not all(k in img and img[k] for k in ("caption", "copyright", "copyright_url"))
|
||||
for img in article.get("images", [])
|
||||
)
|
||||
|
||||
cols = st.columns([0.05, 0.1, 0.2, 0.25, 0.05, 0.2, 0.15])
|
||||
with cols[0]:
|
||||
st.checkbox("", key=f"select_{article['id']}")
|
||||
with cols[1]:
|
||||
st.markdown(datetime.strptime(article["date"], "%a, %d %b %Y %H:%M:%S %z").strftime("%d.%m.%y") if "GMT" in article["date"] or "+" in article["date"] else article["date"][:10])
|
||||
date_str = article["date"]
|
||||
if "GMT" in date_str or "+" in date_str:
|
||||
date_str = datetime.strptime(date_str, "%a, %d %b %Y %H:%M:%S %z").strftime("%d.%m.%y")
|
||||
else:
|
||||
date_str = date_str[:10]
|
||||
st.markdown(date_str)
|
||||
with cols[2]:
|
||||
st.markdown(f"**{article['title']}**")
|
||||
title = f"**{article['title']}**"
|
||||
if has_incomplete_images:
|
||||
title += " ⚠️"
|
||||
st.markdown(title)
|
||||
with cols[3]:
|
||||
st.markdown(article.get("summary", "")[:150])
|
||||
with cols[4]:
|
||||
|
|
@ -83,13 +87,23 @@ if articles:
|
|||
st.markdown("#### ✍️ Artikeltext")
|
||||
st.code(f"{article['title']}\n\n{article['text']}\n\nQuelle: {article['link']}", language="markdown")
|
||||
|
||||
st.markdown("#### 🏷️ Tags")
|
||||
st.markdown("#### 🌿 Tags")
|
||||
st.code(", ".join(article.get("tags", [])), language="markdown")
|
||||
|
||||
st.markdown("#### 🖼️ Bilder")
|
||||
for img in article.get("images", []):
|
||||
for i, img in enumerate(article.get("images", [])):
|
||||
st.image(img["url"], caption=img.get("caption", "Kein Titel"), use_column_width=True)
|
||||
st.caption(f"© {img.get('copyright', 'Unbekannt')} | [Quelle]({img.get('copyright_url', '#')})")
|
||||
|
||||
with st.form(f"edit_image_{article['id']}_{i}", clear_on_submit=False):
|
||||
caption = st.text_input("Bildtitel", value=img.get("caption", ""))
|
||||
copyright = st.text_input("Copyright", value=img.get("copyright", ""))
|
||||
copyright_url = st.text_input("Quelle", value=img.get("copyright_url", ""))
|
||||
if st.form_submit_button("Änderungen speichern"):
|
||||
img["caption"] = caption or "Kein Bildtitel vorhanden"
|
||||
img["copyright"] = copyright or "Unbekannt"
|
||||
img["copyright_url"] = copyright_url or "#"
|
||||
save_articles(articles)
|
||||
st.success("Bilddaten gespeichert")
|
||||
|
||||
else:
|
||||
st.info("Keine Artikel für den gewählten Status gefunden.")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue