Articles as the IndieWeb defines them: a name separate from the content.
- Migration 023 adds notes.title and notes.summary. A one-time Python data
step (migrations.DATA_MIGRATIONS) moves each note's '# Heading' first line
into title, rewrites the file and hash, empties FTS for a rebuild, and puts
files back if the migration fails. Trashed notes included.
- Micropub: name -> title, summary stored when sent with content, summary
updatable, q=source returns both. MCP tools take a summary.
- Feeds: titles only for articles (RSS/JSON none, Atom empty); Atom and
JSON Feed summaries; the title is no longer repeated in the content.
- Pages: p-name/p-summary on the article page. Homepage and tag pages show
articles as title, summary and "Read more" without images (hidden u-photo
keeps the post type for parsers).
- Crossposts: articles go out as title, summary, link and hashtags, no
images; the Bluesky card is the article. Notes unchanged.
- Editor: Title and Summary fields; an article may have no body.
- Fix: a line starting with a hashtag ('#indieweb ...') was rendered as a
heading and crossposted without its '#' (HashtagLineExtension).
- Fix: excerpts showed raw Markdown; they are plain text now.
Back up the database and the data folder before deploying: the migration
rewrites note files.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
131 lines
5.6 KiB
HTML
131 lines
5.6 KiB
HTML
{% extends "admin/base.html" %}
|
|
|
|
{% block title %}Edit Note - StarPunk Admin{% endblock %}
|
|
|
|
{% block admin_content %}
|
|
<div class="note-editor">
|
|
<h2>Edit Note</h2>
|
|
<p class="note-meta">
|
|
Slug: <code>{{ note.slug }}</code> |
|
|
Created: {{ note.created_at.strftime('%B %d, %Y at %I:%M %p') }}
|
|
</p>
|
|
|
|
<form action="{{ url_for('admin.update_note_submit', note_id=note.id) }}" method="POST" class="note-form"><input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
|
<div class="form-group">
|
|
<label for="title">Title (optional)</label>
|
|
<input type="text" id="title" name="title" value="{{ note.title or '' }}" maxlength="200"
|
|
placeholder="Leave blank for a note; a title makes it an article">
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
{% if note.reacts_to %}
|
|
<p class="note-meta">{{ {'like': '★ Like of', 'repost': '🔁 Repost of', 'bookmark': '🔖 Bookmark of'}[note.kind] }} <a href="{{ note.reacts_to }}">{{ note.reacts_to }}</a></p>
|
|
{% endif %}
|
|
<label for="content">{% if note.reacts_to %}Comment (optional, Markdown){% else %}Content (Markdown){% endif %}</label>
|
|
<textarea
|
|
id="content"
|
|
name="content"
|
|
rows="{{ 6 if note.reacts_to else 20 }}"
|
|
autofocus
|
|
>{{ note.content }}</textarea>
|
|
<small>Use Markdown syntax for formatting</small>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="summary">Summary (optional)</label>
|
|
<textarea id="summary" name="summary" rows="2"
|
|
placeholder="A sentence or two for the homepage, feeds and crossposts">{{ note.summary or '' }}</textarea>
|
|
<small>Articles only. Leave blank to use the start of the text.</small>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="slug">Slug (permanent)</label>
|
|
<input type="text"
|
|
id="slug"
|
|
name="slug"
|
|
value="{{ note.slug }}"
|
|
readonly
|
|
class="form-control"
|
|
disabled>
|
|
<small class="form-text text-muted">
|
|
Slugs cannot be changed after creation to preserve permalinks.
|
|
</small>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="tags">Tags</label>
|
|
<input type="text"
|
|
id="tags"
|
|
name="tags"
|
|
value="{{ note.tags|map(attribute='display_name')|join(', ') if note.tags else '' }}"
|
|
placeholder="Comma-separated tags (e.g., IndieWeb, Python, Thoughts)">
|
|
<small>Separate multiple tags with commas. Leave blank to remove all tags.</small>
|
|
</div>
|
|
|
|
<div class="form-group form-checkbox">
|
|
<input type="checkbox" id="published" name="published" {% if note.published %}checked{% endif %}>
|
|
<label for="published">Published</label>
|
|
</div>
|
|
|
|
{% if syndication_targets %}
|
|
<input type="hidden" name="syndication_form" value="1">
|
|
<fieldset class="form-group">
|
|
<legend>Crosspost</legend>
|
|
{% for target in syndication_targets %}
|
|
<div class="form-checkbox">
|
|
<input type="checkbox" id="syndicate-{{ target.id }}" name="syndicate_to" value="{{ target.id }}"{% if target.id in syndication_enabled %} checked{% endif %}>
|
|
<label for="syndicate-{{ target.id }}">{{ target.name }}</label>
|
|
</div>
|
|
{% endfor %}
|
|
</fieldset>
|
|
{% endif %}
|
|
|
|
<div class="form-actions">
|
|
<button type="submit" class="button button-primary">Update Note</button>
|
|
<a href="{{ url_for('admin.dashboard') }}" class="button button-secondary">Cancel</a>
|
|
<button type="submit" form="delete-note-form" class="button button-danger">Delete Note</button>
|
|
</div>
|
|
</form>
|
|
|
|
{# Outside the edit form: nested forms are not allowed in HTML #}
|
|
<form id="delete-note-form" action="{{ url_for('admin.delete_note_submit', note_id=note.id) }}" method="POST" class="delete-form" onsubmit="return confirm('Are you sure you want to delete this note? This cannot be undone.');"><input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
|
<input type="hidden" name="confirm" value="yes">
|
|
</form>
|
|
|
|
{% if syndications %}
|
|
<section class="syndication-status">
|
|
<h3>Crossposts</h3>
|
|
<ul>
|
|
{% for s in syndications %}
|
|
<li>
|
|
<strong>{{ s.name }}</strong>:
|
|
{% if s.state == 'synced' and s.remote_url %}
|
|
<a href="{{ s.remote_url }}" rel="noopener">posted</a>
|
|
{% elif s.state == 'synced' %}
|
|
removed
|
|
{% elif s.state == 'pending' %}
|
|
pending{% if s.attempts %} (retry {{ s.attempts }}){% endif %}
|
|
{% else %}
|
|
failed
|
|
{% endif %}
|
|
{% if s.last_error %}<br><small>{{ s.last_error }}</small>{% endif %}
|
|
{% if s.state != 'synced' %}
|
|
<form action="{{ url_for('admin.retry_syndication', syndication_id=s.id) }}" method="POST" style="display: inline;"><input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
|
<button type="submit" class="button button-secondary">Retry now</button>
|
|
</form>
|
|
{% endif %}
|
|
{% if backfeed_enabled and s.state == 'synced' and s.remote_id %}
|
|
<br><small>Responses {% if s.backfeed_checked_at %}checked {{ s.backfeed_checked_at }} UTC{% else %}not checked yet{% endif %}{% if s.backfeed_error %}: {{ s.backfeed_error }}{% endif %}</small>
|
|
<form action="{{ url_for('admin.check_syndication_responses', syndication_id=s.id) }}" method="POST" style="display: inline;"><input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
|
<button type="submit" class="button button-secondary">Check now</button>
|
|
</form>
|
|
{% endif %}
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
</section>
|
|
{% endif %}
|
|
</div>
|
|
{% endblock %}
|
|
|