feat(theme): home-active reuses trip-feed-col partial with stats + pre-departure state
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BftDn9vu9SonFAY4vxu4uk
This commit is contained in:
@@ -29,6 +29,13 @@
|
|||||||
{% set journal_count = journal_entries|length %}
|
{% set journal_count = journal_entries|length %}
|
||||||
{% set story_count = story_entries|length %}
|
{% set story_count = story_entries|length %}
|
||||||
|
|
||||||
|
{% set gps_points = [] %}
|
||||||
|
{% for entry in journal_entries %}
|
||||||
|
{% if entry.header.lat is not empty and entry.header.lng is not empty %}
|
||||||
|
{% set gps_points = gps_points|merge([[entry.header.lat, entry.header.lng]]) %}
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
{% set map_entries = [] %}
|
{% set map_entries = [] %}
|
||||||
{% for item in all_items %}
|
{% for item in all_items %}
|
||||||
{% if item.type == 'journal' and item.page.header.lat is not empty and item.page.header.lng is not empty %}
|
{% if item.type == 'journal' and item.page.header.lat is not empty and item.page.header.lng is not empty %}
|
||||||
@@ -57,30 +64,18 @@
|
|||||||
<div class="home-map" id="home-map"></div>
|
<div class="home-map" id="home-map"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="home-feed-col">
|
{% include 'partials/trip-feed-col.html.twig' with {
|
||||||
<div class="home-trip-header">
|
trip_page: trip,
|
||||||
<h1 class="home-trip-name">{{ trip ? trip.title : trip_route }}</h1>
|
all_items: all_items,
|
||||||
<span class="home-trip-counts">
|
journal_entries: journal_entries,
|
||||||
{{ journal_count }} journal {{ journal_count == 1 ? 'entry' : 'entries' }}
|
journal_count: journal_count,
|
||||||
{% if story_count > 0 %} · {{ story_count }} {{ story_count == 1 ? 'story' : 'stories' }}{% endif %}
|
story_count: story_count,
|
||||||
</span>
|
has_gpx: home_gpx_urls|length > 0,
|
||||||
</div>
|
gpx_urls: home_gpx_urls,
|
||||||
|
gps_points: gps_points,
|
||||||
<div class="feed">
|
show_sort: false,
|
||||||
{% if all_items|length > 0 %}
|
pre_departure: all_items|length == 0
|
||||||
{% for item in all_items %}
|
} only %}
|
||||||
{% set entry = item.page %}
|
|
||||||
{% if item.type == 'journal' %}
|
|
||||||
{% include 'partials/entry-journal.html.twig' %}
|
|
||||||
{% else %}
|
|
||||||
{% include 'partials/entry-story.html.twig' %}
|
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
{% else %}
|
|
||||||
<p class="feed-empty">No entries yet. The journey is about to begin.</p>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if map_entries|length > 0 %}
|
{% if map_entries|length > 0 %}
|
||||||
|
|||||||
Reference in New Issue
Block a user