Files
indiekit-endpoint-blogroll/views/blogroll-sources.njk
Ricardo 4ad4c13bbc refactor: align views with upstream @indiekit/frontend patterns
- Extract ~560 lines of inline CSS to external assets/styles.css
- Create intermediate layout (layouts/blogroll.njk) for CSS loading
- Use section(), badge(), button(), prose() macros instead of raw HTML
- Remove custom page headers (document.njk heading() handles via title/parent)
- Add parent breadcrumb navigation to all sub-pages
- Add consumeFlashMessage() to dashboard and sources controllers
- Rename CSS class prefix from br-* to blogroll-* for clarity
- Use upstream CSS custom properties without fallback values
- Fix Microsub orphan detection (soft-delete unsubscribed blogs)
- Fix upsert to conditionally set microsub fields (avoid path conflicts)
- Skip soft-deleted blogs during clear-and-resync

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 18:42:27 +01:00

53 lines
2.3 KiB
Plaintext

{% extends "layouts/blogroll.njk" %}
{% block blogroll %}
<div class="blogroll-actions">
{{ button({ href: baseUrl + "/sources/new", text: __("blogroll.sources.add") }) }}
</div>
{% if sources.length > 0 %}
<ul class="blogroll-list">
{% for source in sources %}
<li class="blogroll-list__item">
<div class="blogroll-item__info">
<h2 class="blogroll-item__title">{{ source.name }}</h2>
<p class="blogroll-item__meta">
{{ badge({ color: "green" if source.enabled else "yellow", text: __("blogroll.enabled") if source.enabled else __("blogroll.disabled") }) }}
<span>{{ source.type }}</span>
<span>· {{ __("blogroll.sources.interval", { minutes: source.syncInterval }) }}</span>
</p>
{% if source.url %}
<p class="blogroll-item__url">{{ source.url }}</p>
{% endif %}
{% if source.lastSyncError %}
<p class="blogroll-item__error">{{ source.lastSyncError }}</p>
{% endif %}
<p class="blogroll-item__meta">
{{ __("blogroll.sources.lastSync") }}:
{% if source.lastSyncAt %}{{ source.lastSyncAt | date("PPpp") }}{% else %}{{ __("blogroll.never") }}{% endif %}
</p>
</div>
<div class="blogroll-item__actions">
<form method="post" action="{{ baseUrl }}/sources/{{ source._id }}/sync" style="display: inline;">
<button type="submit" class="button button--small button--secondary">
{{ icon("syndicate") }} {{ __("blogroll.sync") }}
</button>
</form>
{{ button({ href: baseUrl + "/sources/" + source._id, text: __("blogroll.edit"), classes: "button--small button--secondary" }) }}
<form method="post" action="{{ baseUrl }}/sources/{{ source._id }}/delete" style="display: inline;" onsubmit="return confirm('{{ __("blogroll.sources.deleteConfirm") }}');">
<button type="submit" class="button button--small button--warning">
{{ icon("delete") }}
</button>
</form>
</div>
</li>
{% endfor %}
</ul>
{% else %}
<div class="blogroll-empty">
{{ prose({ text: __("blogroll.sources.empty") }) }}
{{ button({ href: baseUrl + "/sources/new", text: __("blogroll.sources.add") }) }}
</div>
{% endif %}
{% endblock %}