diff --git a/frontend/src/pages/communities.astro b/frontend/src/pages/communities.astro index ed3d202..23f1c78 100644 --- a/frontend/src/pages/communities.astro +++ b/frontend/src/pages/communities.astro @@ -56,6 +56,7 @@ import { API_BASE as apiBase } from '../lib/api'; var allCommunities = []; var currentQuery = ''; var currentSort = 'name_asc'; + var token = localStorage.getItem('token'); function escapeHtml(value) { return String(value || '').replace(/[&<>\"']/g, function(ch) { @@ -122,8 +123,18 @@ import { API_BASE as apiBase } from '../lib/api'; var container = document.getElementById('communities-list'); if (!container) return; - var label = isFiltered ? 'No communities match your search.' : 'No communities found.'; - var hint = isFiltered ? 'Try a different keyword or clear the search.' : 'Please try again later.'; + var isLoggedIn = !!token; + var label; + var hint; + if (isFiltered) { + label = 'No communities match your search.'; + hint = 'Try a different keyword or clear the search.'; + } else { + label = isLoggedIn ? 'No communities yet.' : 'No communities found.'; + hint = isLoggedIn + ? 'Create the first community to start organizing proposals.' + : 'Sign in to create a community, or refresh to try again.'; + } container.innerHTML = '
' + hint + '
' + 'No proposals found.
No proposals yet.
+Create the first proposal for this community to start collecting feedback and votes.
+ +${isFiltered ? 'No proposals match your filters.' : 'No proposals found.'}
-Try adjusting search, status, or sort.
+${label}
+${hint}