clone of github.com/decent-newsroom/newsroom
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

103 lines
6.1 KiB

<aside class="editor-articlelist-sidebar" data-controller="editor--articlelist-panels">
<div class="editor-sidebar-tabs">
<button
type="button"
class="editor-sidebar-tab is-active"
data-editor--articlelist-panels-target="tab"
data-panel="articles"
data-action="editor--articlelist-panels#switch"
>
Articles
</button>
</div>
<section class="editor-sidebar-panels">
<div
class="editor-panel"
data-editor--articlelist-panels-target="panel"
data-panel="articles"
>
<div class="articlelist-content" data-articlelist-target="list">
{% if is_granted('ROLE_USER') %}
{% if readingLists is defined and readingLists|length > 0 %}
{% for list in readingLists %}
<details class="mb-2">
<summary>
{{ list.title|default('Untitled List') }}
{% if list.summary is defined and list.summary %}
<span class="readinglist-summary">&mdash; {{ list.summary }}</span>
{% endif %}
</summary>
<ul class="list-unstyled">
{% if list.articles|length > 0 %}
{% for articleObj in list.articles %}
{% set article = articleObj.article %}
<li class="readinglist-article">
<span class="article-icon" title="{{ article.kind == 30024 ? 'Draft' : 'Published' }}">
{% if article.kind == 30024 %}
<span style="color: orange; font-weight: bold;"></span><span class="article-kind">D</span>
{% else %}
<span style="color: #22c55e; font-weight: bold;"></span><span class="article-kind">A</span>
{% endif %}
</span>
<a href="{{ path('editor-preview-npub-slug', {npub: article.pubkey|toNpub , slug: article.slug}) }}">
{{ article.title|default(article.slug) }}
</a>
<span>by {{ articleObj.author.name }}</span>
</li>
{% endfor %}
{% else %}
<li class="readinglist-empty">No articles in this list.</li>
{% endif %}
</ul>
</details>
{% endfor %}
{% endif %}
<ul class="list-unstyled">
{% for recent in recentArticles %}
<li class="mb-2">
<span class="article-icon" title="Published">
<span style="color: #22c55e; font-weight: bold;"></span><span class="article-kind">A</span>
</span>
<a href="{{ path('editor-edit-slug', {slug: recent.slug}) }}">
{{ recent.title }} ({{ recent.publishedAt|date('Y-m-d') }})
</a>
</li>
{% else %}
<li>No recent articles found.</li>
{% endfor %}
</ul>
<ul class="list-unstyled">
{% for draft in drafts %}
<li>
<span class="article-icon" title="Draft">
<span style="color: orange; font-weight: bold;"></span><span class="article-kind">D</span>
</span>
<a href="{{ path('editor-edit-slug', {slug: draft.slug}) }}">
{{ draft.title }} ({{ draft.updatedAt|date('Y-m-d') }})
</a>
</li>
{% else %}
<li>No drafts found.</li>
{% endfor %}
</ul>
{% else %}
<div data-controller="utility--login utility--signer-modal">
<div class="articlelist-placeholder">Sign in to see your articles.</div>
<ul class="list-unstyled">
<li class="mb-2">
<div data-utility--login-target="nostrError" class="nostr-error-message" style="display:none;color:#b00;margin-bottom:0.5em;"></div>
<twig:Atoms:Button {{ ...stimulus_action('utility--login', 'loginAct') }} tag="a" variant="accent">Extension</twig:Atoms:Button>
</li>
<li>
<twig:Atoms:Button {{ ...stimulus_action('utility--signer-modal', 'openDialog') }} tag="a" variant="accent">Signer</twig:Atoms:Button>
</li>
</ul>
<twig:SignerModal />
</div>
{% endif %}
</div>
</div>
</section>
</aside>