Add phase 5: link import, Instagram fallback and share target
- SSRF-safe fetcher: public IPs only, connects to the checked address, redirects re-validated, size/time limits, honest user agent - schema.org/Recipe JSON-LD extraction (graphs, HowToSections, ISO durations, yields, keywords, images) without extra dependencies; AI fallback on plain page text when no structured recipe exists - Instagram: one login-free request to the public embed page; when Instagram withholds the caption, the import page explains how to paste the text or import a screenshot instead - Suggested source photo can be downloaded and attached on save - Text import works without AI (text becomes the description) - Installable PWA with manifest, icons and Android share target - Offline tests for SSRF rules, parsers, Instagram and import views Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
1bf8ef8b65
commit
60785e2437
@@ -6,6 +6,11 @@
|
||||
<meta name="theme-color" content="#b4532a">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<title>{% block title %}Kochbuch{% endblock %} · Kochbuch</title>
|
||||
<link rel="manifest" href="{% url 'core:manifest' %}">
|
||||
<link rel="icon" type="image/png" href="{% static 'icons/favicon.png' %}">
|
||||
<link rel="apple-touch-icon" href="{% static 'icons/apple-touch-icon.png' %}">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-title" content="Kochbuch">
|
||||
<link rel="stylesheet" href="{% static 'css/app.css' %}">
|
||||
<script src="{% static 'js/app.js' %}" defer></script>
|
||||
</head>
|
||||
@@ -17,6 +22,8 @@
|
||||
<summary aria-label="Menü">☰</summary>
|
||||
<nav>
|
||||
<a href="{% url 'recipes:list' %}">Rezepte</a>
|
||||
<a href="{% url 'recipes:list' %}?ansicht=favoriten">Favoriten</a>
|
||||
<a href="{% url 'recipes:import' %}">Importieren</a>
|
||||
<a href="{% url 'accounts:profile' %}">Mein Konto</a>
|
||||
{% if user.is_admin %}
|
||||
<a href="{% url 'accounts:admin_users' %}">Nutzer verwalten</a>
|
||||
|
||||
@@ -4,7 +4,26 @@
|
||||
<h1>Rezept importieren</h1>
|
||||
<p class="muted">Das Ergebnis ist immer ein Entwurf, den du prüfst und erst dann speicherst.</p>
|
||||
|
||||
{% block link_import %}{% endblock %}
|
||||
<section class="card">
|
||||
<h2>🔗 Link</h2>
|
||||
<form method="post" action="{% url 'recipes:import_link' %}" novalidate>
|
||||
{% csrf_token %}
|
||||
{% with form=link_form %}{% include "form_fields.html" %}{% endwith %}
|
||||
<p class="muted small">Rezeptseiten werden direkt ausgelesen. Bei Instagram wird die Beschreibung des Beitrags übernommen{% if ai_enabled %} und per KI aufbereitet{% endif %}.</p>
|
||||
<button type="submit" class="button" data-busy-text="Wird geladen …">Importieren</button>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
{% if instagram_failed %}
|
||||
<section class="card help-box">
|
||||
<h2>So klappt es mit Instagram</h2>
|
||||
<ol>
|
||||
<li>Öffne den Beitrag in der Instagram-App und tippe auf „… mehr“, damit die ganze Beschreibung sichtbar ist.</li>
|
||||
<li>Mach einen <strong>Screenshot</strong> und lade ihn unten bei „Foto oder Screenshot“ hoch{% if not ai_enabled %} (braucht die KI){% endif %}, <em>oder</em></li>
|
||||
<li>öffne den Beitrag im Browser, markiere den Text, kopiere ihn und füge ihn unten bei „Text einfügen“ ein.</li>
|
||||
</ol>
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
<section class="card">
|
||||
<h2>📷 Foto oder Screenshot</h2>
|
||||
@@ -22,15 +41,16 @@
|
||||
|
||||
<section class="card">
|
||||
<h2>📝 Text einfügen</h2>
|
||||
{% if ai_enabled %}
|
||||
<form method="post" action="{% url 'recipes:import_text' %}" novalidate>
|
||||
{% csrf_token %}
|
||||
{% with form=text_form %}{% include "form_fields.html" %}{% endwith %}
|
||||
{% if ai_enabled %}
|
||||
<button type="submit" class="button" data-busy-text="KI bereitet auf …">Mit KI aufbereiten</button>
|
||||
{% else %}
|
||||
<p class="muted small">Ohne KI wird der Text als Beschreibung übernommen und du teilst ihn selbst auf.</p>
|
||||
<button type="submit" class="button">Als Entwurf übernehmen</button>
|
||||
{% endif %}
|
||||
</form>
|
||||
{% else %}
|
||||
{% include "recipes/_ai_disabled.html" %}
|
||||
{% endif %}
|
||||
</section>
|
||||
|
||||
<p><a href="{% url 'recipes:create' %}">Oder ganz von Hand eintragen →</a></p>
|
||||
|
||||
Reference in New Issue
Block a user