Browse Source

Follows

imwald
Nuša Pukšič 1 month ago
parent
commit
0c80215ab0
  1. 39
      templates/event/_kind39089_followPack.html.twig
  2. 2
      templates/event/index.html.twig
  3. 45
      templates/follows/index.html.twig

39
templates/event/_kind39089_followPack.html.twig

@ -0,0 +1,39 @@
{% set peeps = [] %}
{% set description = '' %}
{% set cover = null %}
{% for tag in event.tags %}
{% if tag[0] == 'description' %}
{% set description = tag[1] %}
{% endif %}
{% if tag[0] == 'image' %}
{% set cover = tag[1] %}
{% endif %}
{% if tag[0] == 'p' %}
{% set peeps = peeps|merge([tag[1]]) %}
{% endif %}
{% endfor %}
{% if not description is empty %}
<div class="event-description">
<p>{{ description }}</p>
</div>
{% endif %}
{% if cover %}
<div class="event-cover">
<img src="{{ cover }}" alt="Event Cover Image" />
</div>
{% endif %}
{% if peeps %}
<div class="tag-cloud">
<h3>People</h3>
<div class="tags">
{% for person in peeps %}
{# Use pre-fetched profile if available #}
{% set userProfile = followPackProfiles[person] ?? null %}
<twig:Molecules:UserFromNpub ident="{{ person }}" :user="userProfile" />
{% endfor %}
</div>
</div>
{% endif %}

2
templates/event/index.html.twig

@ -117,6 +117,8 @@
{% include 'event/_kind1450_tabular.html.twig' %} {% include 'event/_kind1450_tabular.html.twig' %}
{% elseif event.kind == 10015 %} {% elseif event.kind == 10015 %}
{% include 'event/_kind10015_tags.html.twig' %} {% include 'event/_kind10015_tags.html.twig' %}
{% elseif event.kind == 39089 %}
{% include 'event/_kind39089_followPack.html.twig' %}
{% else %} {% else %}
{# Regular event content for non-picture and non-video events #} {# Regular event content for non-picture and non-video events #}
<div class="event-content"> <div class="event-content">

45
templates/follows/index.html.twig

@ -0,0 +1,45 @@
{% extends 'layout.html.twig' %}
{% block body %}
<section class="d-flex gap-3 center ln-section--newsstand">
<div class="container mt-5 mb-1">
<h1>Following</h1>
<p class="eyebrow">articles from people you follow</p>
</div>
</section>
<div class="w-container mb-5 mt-5">
{% if not isLoggedIn %}
<div class="alert alert-info">
<h4>Sign in to see articles from people you follow</h4>
<p class="mb-3">You need to be logged in to view articles from your follow list.</p>
<a href="{{ path('app_login') }}" class="btn btn-primary">Sign In</a>
</div>
{% elseif error is defined %}
<div class="alert alert-danger">
<h4>Error</h4>
<p class="mb-0">{{ error }}</p>
</div>
{% elseif followCount is defined and followCount == 0 %}
<div class="alert alert-info">
<h4>You're not following anyone yet</h4>
<p class="mb-0">Start following people on Nostr to see their articles here. Your follow list will be synced automatically.</p>
</div>
{% elseif articles is empty %}
<div class="alert alert-info">
<h4>No articles found</h4>
<p class="mb-0">The people you follow haven't published any articles yet, or they haven't been synced to this newsroom.</p>
</div>
{% else %}
<div class="discover-section">
<twig:Organisms:CardList :list="articles" :authorsMetadata="authorsMetadata" class="article-list" />
</div>
{% endif %}
</div>
{% endblock %}
{% block aside %}
<twig:Atoms:FeaturedWriters />
<twig:Atoms:ForumAside />
{% endblock %}
Loading…
Cancel
Save