import net.pterodactylus.util.service.AbstractService;
import net.pterodactylus.util.template.DateFilter;
import net.pterodactylus.util.template.DefaultTemplateFactory;
+import net.pterodactylus.util.template.MatchFilter;
import net.pterodactylus.util.template.PaginationPlugin;
import net.pterodactylus.util.template.ReflectionAccessor;
import net.pterodactylus.util.template.Template;
templateFactory.addFilter("substring", new SubstringFilter());
templateFactory.addFilter("xml", new XmlFilter());
templateFactory.addFilter("change", new RequestChangeFilter());
+ templateFactory.addFilter("match", new MatchFilter());
templateFactory.addPlugin("getpage", new GetPagePlugin());
templateFactory.addPlugin("paginate", new PaginationPlugin());
templateFactory.setTemplateProvider(new ClassPathTemplateProvider(templateFactory));
function updatePostLikes(postId) {
$.getJSON("ajax/getPostLikes.ajax", { "post": postId }, function(data, textStatus) {
if (data.success) {
+ $("#sone .post#" + postId + " > .status-line .likes").toggleClass("hidden", data.likes == 0)
$("#sone .post#" + postId + " > .status-line .likes span.like-count").text(data.likes);
}
});
</div>
<div class="status-line">
<div class="time"><a href="viewPost.html?post=<% post.id|html>"><% post.time|date format="MMM d, yyyy, HH:mm:ss"></a></div>
- <div class="likes"><span>⬆<span class="like-count"><% post.likes.size></span></span></div>
+ <div class="likes<%if post.likes.size|match value=0> hidden<%/if>"><span>⬆<span class="like-count"><% post.likes.size></span></span></div>
<%ifnull ! currentSone>
<form class="like<%if post.liked> hidden<%/if>" action="likePost.html" method="post">
<input type="hidden" name="formPassword" value="<% formPassword|html>" />