<%# Like/favourite button for a post. Logged in → htmx toggle (POST /posts/:id/like, swaps outerHTML back with this partial). Not logged in → link to login. Expects: post (with .id), likedByMe, likeCount, loggedIn, loginNext. %> <% var _liked = (typeof likedByMe !== 'undefined' && likedByMe); var _cnt = (typeof likeCount !== 'undefined' && likeCount != null) ? likeCount : 0; var _logged = (typeof loggedIn !== 'undefined' && loggedIn); %> <% if (_logged) { %> <% } else { %> <%= _cnt %> <% } %>