nandi/gleanpublic Fork 0
89856f6
Commits
Clone
git clone https://git.rickub.com/nandi/glean.git
git clone ssh://git@rickub.com/nandi/glean.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Improve dashboard when no unread articleUnverified

Julien Robert committed 2026-04-24T00:05:45+02:00 Browse files
89856f6 parent: 144a7d4
modified internal/tmpl/dashboard.html +92 -43
@@ -15,52 +15,47 @@
1515 {{if eq .SubscriptionCount 0}}
1616 <div id="new-articles-poll" hx-get="/articles/new-count?since={{.Now.Unix}}&return=/dashboard" hx-trigger="every 30s" hx-swap="innerHTML"></div>
1717
18-<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
19- <div class="lg:col-span-2 space-y-6">
20- <div class="bg-spot-surface rounded-xl py-12 px-6 text-center">
21- <div class="w-16 h-16 rounded-full bg-spot-hover flex items-center justify-center mb-4 mx-auto">
22- <svg class="w-8 h-8 text-spot-muted" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M12.75 19.5v-15m0 0l-6.75 6.75M12.75 4.5l6.75 6.75"/></svg>
23- </div>
24- <h2 class="text-lg font-semibold text-spot-text mb-2">Add your first feed</h2>
25- <p class="text-sm text-spot-secondary mb-6">Subscribe to RSS feeds to start building your personalized reading experience.</p>
26- <a href="/feeds" class="inline-flex items-center gap-2 px-5 py-2.5 rounded-lg bg-spot-green text-white text-sm font-medium hover:opacity-90 transition">
27- <svg class="w-4 h-4" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15"/></svg>
28- Add feeds
29- </a>
30- </div>
18+<div class="bg-spot-surface rounded-xl py-12 px-6 text-center mb-8">
19+ <div class="w-16 h-16 rounded-full bg-spot-hover flex items-center justify-center mb-4 mx-auto">
20+ <svg class="w-8 h-8 text-spot-muted" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M12.75 19.5v-15m0 0l-6.75 6.75M12.75 4.5l6.75 6.75"/></svg>
21+ </div>
22+ <h2 class="text-lg font-semibold text-spot-text mb-2">Add your first feed</h2>
23+ <p class="text-sm text-spot-secondary mb-6">Subscribe to RSS feeds to start building your personalized reading experience.</p>
24+ <a href="/feeds" class="inline-flex items-center gap-2 px-5 py-2.5 rounded-lg bg-spot-green text-white text-sm font-medium hover:opacity-90 transition">
25+ <svg class="w-4 h-4" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15"/></svg>
26+ Add feeds
27+ </a>
28+</div>
3129
32- {{if .GlobalTrending}}
33- <div>
34- <div class="flex items-center justify-between mb-3">
35- <h2 class="text-lg font-semibold text-spot-text">Trending</h2>
36- <a href="/trending" class="text-xs text-spot-secondary hover:text-spot-green uppercase tracking-button transition">See all</a>
37- </div>
38- <div class="space-y-3">
39- {{range .GlobalTrending}}
40- {{template "trending-card.html" .}}
41- {{end}}
42- </div>
43- </div>
30+{{if .GlobalTrending}}
31+<div class="mb-8">
32+ <div class="flex items-center justify-between mb-3">
33+ <h2 class="text-lg font-semibold text-spot-text">Trending</h2>
34+ <a href="/trending" class="text-xs text-spot-secondary hover:text-spot-green uppercase tracking-button transition">See all</a>
35+ </div>
36+ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3">
37+ {{range .GlobalTrending}}
38+ {{template "trending-card.html" .}}
4439 {{end}}
4540 </div>
41+</div>
42+{{end}}
4643
47- <div class="space-y-8">
48- {{if .FeedRecommendations}}
49- <div>
50- <h2 class="text-lg font-semibold text-spot-text mb-4">Popular feeds to get started</h2>
51- <div class="space-y-3">
52- {{range .FeedRecommendations}}
53- {{template "recommendation-feed-card.html" (dict "title" .Title "feed_url" .FeedURL "description" .Description "favicon_url" .FaviconURL "subscriber_count" .SubscriberCount "CSRFToken" $.CSRFToken)}}
54- {{end}}
55- </div>
56- </div>
44+{{if .FeedRecommendations}}
45+<div class="mb-8">
46+ <h2 class="text-lg font-semibold text-spot-text mb-4">Popular feeds to get started</h2>
47+ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3">
48+ {{range .FeedRecommendations}}
49+ {{template "recommendation-feed-card.html" (dict "title" .Title "feed_url" .FeedURL "description" .Description "favicon_url" .FaviconURL "subscriber_count" .SubscriberCount "CSRFToken" $.CSRFToken)}}
5750 {{end}}
5851 </div>
5952 </div>
53+{{end}}
6054
6155 {{else}}
6256 <div id="new-articles-poll" hx-get="/articles/new-count?since={{.Now.Unix}}&return=/dashboard" hx-trigger="every 30s" hx-swap="innerHTML"></div>
6357
58+{{if .Articles}}
6459 <div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
6560 <div class="lg:col-span-2">
6661 {{if .ArticleRecommendations}}
@@ -78,14 +73,6 @@
7873 <div id="article-list" class="space-y-3">
7974 {{range .Articles}}
8075 {{template "article-card.html" .}}
81- {{else}}
82- <div class="bg-spot-surface rounded-xl py-12 px-6 text-center">
83- <div class="w-14 h-14 rounded-full bg-spot-hover flex items-center justify-center mb-4 mx-auto">
84- <svg class="w-7 h-7 text-spot-muted" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/></svg>
85- </div>
86- <p class="text-sm text-spot-secondary mb-1">No unread articles</p>
87- <p class="text-xs text-spot-muted">You're all caught up!</p>
88- </div>
8976 {{end}}
9077 </div>
9178
@@ -130,5 +117,67 @@
130117 {{end}}
131118 </div>
132119 </div>
120+{{else}}
121+<div id="article-list"></div>
122+<div class="bg-spot-surface rounded-xl py-16 px-6 text-center mb-8">
123+ <div class="w-16 h-16 rounded-full bg-spot-hover flex items-center justify-center mb-4 mx-auto">
124+ <svg class="w-8 h-8 text-spot-green" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/></svg>
125+ </div>
126+ <h2 class="text-xl font-semibold text-spot-text mb-2">You're all caught up!</h2>
127+ <p class="text-sm text-spot-secondary">No unread articles. Check back later for new content.</p>
128+</div>
129+
130+{{if .ArticleRecommendations}}
131+<div class="mb-8">
132+ <h2 class="text-lg font-semibold text-spot-text mb-3">Recommended for you</h2>
133+ <div class="grid grid-cols-1 md:grid-cols-2 gap-3">
134+ {{range .ArticleRecommendations}}
135+ {{template "recommendation-article-card.html" .}}
136+ {{end}}
137+ </div>
138+</div>
139+{{end}}
140+
141+{{if or .PersonalTrending .PeopleRecommendations .FeedRecommendations}}
142+<div class="space-y-8">
143+ {{if .PersonalTrending}}
144+ <div>
145+ <div class="flex items-center justify-between mb-4">
146+ <h2 class="text-lg font-semibold text-spot-text">Trending in your network</h2>
147+ <a href="/trending?scope=for-me" class="text-xs text-spot-secondary hover:text-spot-green uppercase tracking-button transition">See all</a>
148+ </div>
149+ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3">
150+ {{range .PersonalTrending}}
151+ {{template "trending-card.html" .}}
152+ {{end}}
153+ </div>
154+ </div>
155+ {{end}}
156+
157+ {{if .PeopleRecommendations}}
158+ <div>
159+ <h2 class="text-lg font-semibold text-spot-text mb-4">Similar readers</h2>
160+ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3">
161+ {{range .PeopleRecommendations}}
162+ {{template "profile-card.html" .}}
163+ {{end}}
164+ </div>
165+ </div>
166+ {{end}}
167+
168+ {{if .FeedRecommendations}}
169+ <div>
170+ <h2 class="text-lg font-semibold text-spot-text mb-4">Recommended feeds</h2>
171+ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3">
172+ {{range .FeedRecommendations}}
173+ {{template "recommendation-feed-card.html" (dict "title" .Title "feed_url" .FeedURL "description" .Description "favicon_url" .FaviconURL "subscriber_count" .SubscriberCount "CSRFToken" $.CSRFToken)}}
174+ {{end}}
175+ </div>
176+ </div>
177+ {{end}}
178+</div>
179+{{end}}
180+
181+{{end}}
133182 {{end}}
134183 {{end}}
@@ -15,52 +15,47 @@
15 {{if eq .SubscriptionCount 0}}15 {{if eq .SubscriptionCount 0}}
16 <div id="new-articles-poll" hx-get="/articles/new-count?since={{.Now.Unix}}&return=/dashboard" hx-trigger="every 30s" hx-swap="innerHTML"></div>16 <div id="new-articles-poll" hx-get="/articles/new-count?since={{.Now.Unix}}&return=/dashboard" hx-trigger="every 30s" hx-swap="innerHTML"></div>
17 17
18-<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">18+<div class="bg-spot-surface rounded-xl py-12 px-6 text-center mb-8">
19- <div class="lg:col-span-2 space-y-6">19+ <div class="w-16 h-16 rounded-full bg-spot-hover flex items-center justify-center mb-4 mx-auto">
20- <div class="bg-spot-surface rounded-xl py-12 px-6 text-center">20+ <svg class="w-8 h-8 text-spot-muted" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M12.75 19.5v-15m0 0l-6.75 6.75M12.75 4.5l6.75 6.75"/></svg>
21- <div class="w-16 h-16 rounded-full bg-spot-hover flex items-center justify-center mb-4 mx-auto">21+ </div>
22- <svg class="w-8 h-8 text-spot-muted" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M12.75 19.5v-15m0 0l-6.75 6.75M12.75 4.5l6.75 6.75"/></svg>22+ <h2 class="text-lg font-semibold text-spot-text mb-2">Add your first feed</h2>
23- </div>23+ <p class="text-sm text-spot-secondary mb-6">Subscribe to RSS feeds to start building your personalized reading experience.</p>
24- <h2 class="text-lg font-semibold text-spot-text mb-2">Add your first feed</h2>24+ <a href="/feeds" class="inline-flex items-center gap-2 px-5 py-2.5 rounded-lg bg-spot-green text-white text-sm font-medium hover:opacity-90 transition">
25- <p class="text-sm text-spot-secondary mb-6">Subscribe to RSS feeds to start building your personalized reading experience.</p>25+ <svg class="w-4 h-4" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15"/></svg>
26- <a href="/feeds" class="inline-flex items-center gap-2 px-5 py-2.5 rounded-lg bg-spot-green text-white text-sm font-medium hover:opacity-90 transition">26+ Add feeds
27- <svg class="w-4 h-4" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15"/></svg>27+ </a>
28- Add feeds28+</div>
29- </a>
30- </div>
31 29
32- {{if .GlobalTrending}}30+{{if .GlobalTrending}}
33- <div>31+<div class="mb-8">
34- <div class="flex items-center justify-between mb-3">32+ <div class="flex items-center justify-between mb-3">
35- <h2 class="text-lg font-semibold text-spot-text">Trending</h2>33+ <h2 class="text-lg font-semibold text-spot-text">Trending</h2>
36- <a href="/trending" class="text-xs text-spot-secondary hover:text-spot-green uppercase tracking-button transition">See all</a>34+ <a href="/trending" class="text-xs text-spot-secondary hover:text-spot-green uppercase tracking-button transition">See all</a>
37- </div>35+ </div>
38- <div class="space-y-3">36+ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3">
39- {{range .GlobalTrending}}37+ {{range .GlobalTrending}}
40- {{template "trending-card.html" .}}38+ {{template "trending-card.html" .}}
41- {{end}}
42- </div>
43- </div>
44 {{end}}39 {{end}}
45 </div>40 </div>
41+</div>
42+{{end}}
46 43
47- <div class="space-y-8">44+{{if .FeedRecommendations}}
48- {{if .FeedRecommendations}}45+<div class="mb-8">
49- <div>46+ <h2 class="text-lg font-semibold text-spot-text mb-4">Popular feeds to get started</h2>
50- <h2 class="text-lg font-semibold text-spot-text mb-4">Popular feeds to get started</h2>47+ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3">
51- <div class="space-y-3">48+ {{range .FeedRecommendations}}
52- {{range .FeedRecommendations}}49+ {{template "recommendation-feed-card.html" (dict "title" .Title "feed_url" .FeedURL "description" .Description "favicon_url" .FaviconURL "subscriber_count" .SubscriberCount "CSRFToken" $.CSRFToken)}}
53- {{template "recommendation-feed-card.html" (dict "title" .Title "feed_url" .FeedURL "description" .Description "favicon_url" .FaviconURL "subscriber_count" .SubscriberCount "CSRFToken" $.CSRFToken)}}
54- {{end}}
55- </div>
56- </div>
57 {{end}}50 {{end}}
58 </div>51 </div>
59 </div>52 </div>
53+{{end}}
60 54
61 {{else}}55 {{else}}
62 <div id="new-articles-poll" hx-get="/articles/new-count?since={{.Now.Unix}}&return=/dashboard" hx-trigger="every 30s" hx-swap="innerHTML"></div>56 <div id="new-articles-poll" hx-get="/articles/new-count?since={{.Now.Unix}}&return=/dashboard" hx-trigger="every 30s" hx-swap="innerHTML"></div>
63 57
58+{{if .Articles}}
64 <div class="grid grid-cols-1 lg:grid-cols-3 gap-6">59 <div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
65 <div class="lg:col-span-2">60 <div class="lg:col-span-2">
66 {{if .ArticleRecommendations}}61 {{if .ArticleRecommendations}}
@@ -78,14 +73,6 @@
78 <div id="article-list" class="space-y-3">73 <div id="article-list" class="space-y-3">
79 {{range .Articles}}74 {{range .Articles}}
80 {{template "article-card.html" .}}75 {{template "article-card.html" .}}
81- {{else}}
82- <div class="bg-spot-surface rounded-xl py-12 px-6 text-center">
83- <div class="w-14 h-14 rounded-full bg-spot-hover flex items-center justify-center mb-4 mx-auto">
84- <svg class="w-7 h-7 text-spot-muted" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/></svg>
85- </div>
86- <p class="text-sm text-spot-secondary mb-1">No unread articles</p>
87- <p class="text-xs text-spot-muted">You're all caught up!</p>
88- </div>
89 {{end}}76 {{end}}
90 </div>77 </div>
91 78
@@ -130,5 +117,67 @@
130 {{end}}117 {{end}}
131 </div>118 </div>
132 </div>119 </div>
120+{{else}}
121+<div id="article-list"></div>
122+<div class="bg-spot-surface rounded-xl py-16 px-6 text-center mb-8">
123+ <div class="w-16 h-16 rounded-full bg-spot-hover flex items-center justify-center mb-4 mx-auto">
124+ <svg class="w-8 h-8 text-spot-green" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/></svg>
125+ </div>
126+ <h2 class="text-xl font-semibold text-spot-text mb-2">You're all caught up!</h2>
127+ <p class="text-sm text-spot-secondary">No unread articles. Check back later for new content.</p>
128+</div>
129+
130+{{if .ArticleRecommendations}}
131+<div class="mb-8">
132+ <h2 class="text-lg font-semibold text-spot-text mb-3">Recommended for you</h2>
133+ <div class="grid grid-cols-1 md:grid-cols-2 gap-3">
134+ {{range .ArticleRecommendations}}
135+ {{template "recommendation-article-card.html" .}}
136+ {{end}}
137+ </div>
138+</div>
139+{{end}}
140+
141+{{if or .PersonalTrending .PeopleRecommendations .FeedRecommendations}}
142+<div class="space-y-8">
143+ {{if .PersonalTrending}}
144+ <div>
145+ <div class="flex items-center justify-between mb-4">
146+ <h2 class="text-lg font-semibold text-spot-text">Trending in your network</h2>
147+ <a href="/trending?scope=for-me" class="text-xs text-spot-secondary hover:text-spot-green uppercase tracking-button transition">See all</a>
148+ </div>
149+ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3">
150+ {{range .PersonalTrending}}
151+ {{template "trending-card.html" .}}
152+ {{end}}
153+ </div>
154+ </div>
155+ {{end}}
156+
157+ {{if .PeopleRecommendations}}
158+ <div>
159+ <h2 class="text-lg font-semibold text-spot-text mb-4">Similar readers</h2>
160+ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3">
161+ {{range .PeopleRecommendations}}
162+ {{template "profile-card.html" .}}
163+ {{end}}
164+ </div>
165+ </div>
166+ {{end}}
167+
168+ {{if .FeedRecommendations}}
169+ <div>
170+ <h2 class="text-lg font-semibold text-spot-text mb-4">Recommended feeds</h2>
171+ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3">
172+ {{range .FeedRecommendations}}
173+ {{template "recommendation-feed-card.html" (dict "title" .Title "feed_url" .FeedURL "description" .Description "favicon_url" .FaviconURL "subscriber_count" .SubscriberCount "CSRFToken" $.CSRFToken)}}
174+ {{end}}
175+ </div>
176+ </div>
177+ {{end}}
178+</div>
179+{{end}}
180+
181+{{end}}
133 {{end}}182 {{end}}
134 {{end}}183 {{end}}